@@ -952,7 +952,7 @@ var getJibProfilesProfiles = function (input, common, data) {
952952
953953 // Profiles used to run tests using Jib for internal dependencies.
954954 var testedProfile = input . testedProfile ;
955- if ( testedProfile == null ) {
955+ if ( testedProfile == null || testedProfile == "docs" ) {
956956 testedProfile = input . build_os + "-" + input . build_cpu ;
957957 }
958958 var testedProfileJdk = testedProfile + ".jdk" ;
@@ -994,25 +994,38 @@ var getJibProfilesProfiles = function (input, common, data) {
994994 testOnlyProfilesPrebuilt [ "run-test-prebuilt" ] [ "dependencies" ] . push ( testedProfile + ".jdk_symbols" ) ;
995995 }
996996
997+ var testOnlyProfilesPrebuiltDocs = {
998+ "run-test-prebuilt-docs" : clone ( testOnlyProfilesPrebuilt [ "run-test-prebuilt" ] )
999+ } ;
1000+
1001+ testOnlyProfilesPrebuiltDocs [ "run-test-prebuilt-docs" ] . dependencies . push ( "docs.doc_api_spec" , "tidy" ) ;
1002+ testOnlyProfilesPrebuiltDocs [ "run-test-prebuilt-docs" ] . environment [ "DOCS_JDK_IMAGE_DIR" ]
1003+ = input . get ( "docs.doc_api_spec" , "install_path" ) ;
1004+ testOnlyProfilesPrebuiltDocs [ "run-test-prebuilt-docs" ] . environment [ "TIDY" ]
1005+ = input . get ( "tidy" , "home_path" ) + "/bin/tidy" ;
1006+ testOnlyProfilesPrebuiltDocs [ "run-test-prebuilt-docs" ] . labels = "test-docs" ;
1007+
9971008 // If actually running the run-test-prebuilt profile, verify that the input
9981009 // variable is valid and if so, add the appropriate target_* values from
9991010 // the tested profile. Use testImageProfile value as backup.
1000- if ( input . profile == "run-test-prebuilt" ) {
1011+ if ( input . profile == "run-test-prebuilt" || input . profile == "run-test-prebuilt-docs" ) {
10011012 if ( profiles [ testedProfile ] == null && profiles [ testImageProfile ] == null ) {
10021013 error ( "testedProfile is not defined: " + testedProfile + " " + testImageProfile ) ;
10031014 }
10041015 }
1005- if ( profiles [ testedProfile ] != null ) {
1006- testOnlyProfilesPrebuilt [ "run-test-prebuilt" ] [ "target_os" ]
1007- = profiles [ testedProfile ] [ "target_os" ] ;
1008- testOnlyProfilesPrebuilt [ "run-test-prebuilt" ] [ "target_cpu" ]
1009- = profiles [ testedProfile ] [ "target_cpu" ] ;
1010- } else if ( profiles [ testImageProfile ] != null ) {
1011- testOnlyProfilesPrebuilt [ "run-test-prebuilt" ] [ "target_os" ]
1012- = profiles [ testImageProfile ] [ "target_os" ] ;
1013- testOnlyProfilesPrebuilt [ "run-test-prebuilt" ] [ "target_cpu" ]
1014- = profiles [ testImageProfile ] [ "target_cpu" ] ;
1016+ function updateProfileTargets ( profiles , testedProfile , testImageProfile , targetProfile , runTestProfile ) {
1017+ var profileToCheck = profiles [ testedProfile ] || profiles [ testImageProfile ] ;
1018+
1019+ if ( profileToCheck != null ) {
1020+ targetProfile [ runTestProfile ] [ "target_os" ] = profileToCheck [ "target_os" ] ;
1021+ targetProfile [ runTestProfile ] [ "target_cpu" ] = profileToCheck [ "target_cpu" ] ;
1022+ }
10151023 }
1024+
1025+ updateProfileTargets ( profiles , testedProfile , testImageProfile , testOnlyProfilesPrebuilt , "run-test-prebuilt" ) ;
1026+ updateProfileTargets ( profiles , testedProfile , testImageProfile , testOnlyProfilesPrebuiltDocs , "run-test-prebuilt-docs" ) ;
1027+
1028+ profiles = concatObjects ( profiles , testOnlyProfilesPrebuiltDocs ) ;
10161029 profiles = concatObjects ( profiles , testOnlyProfilesPrebuilt ) ;
10171030
10181031 // On macosx add the devkit bin dir to the path in all the run-test profiles.
@@ -1062,6 +1075,8 @@ var getJibProfilesProfiles = function (input, common, data) {
10621075 }
10631076 profiles [ "run-test-prebuilt" ] = concatObjects ( profiles [ "run-test-prebuilt" ] ,
10641077 runTestPrebuiltSrcFullExtra ) ;
1078+ profiles [ "run-test-prebuilt-docs" ] = concatObjects ( profiles [ "run-test-prebuilt-docs" ] ,
1079+ runTestPrebuiltSrcFullExtra ) ;
10651080 }
10661081
10671082 // Generate the missing platform attributes
0 commit comments