< prev index next >

./build.gradle

Print this page




 598     String v = inStream.readLine().trim();
 599     if (v != null) {
 600         int ib = v.indexOf("full version \"");
 601         if (ib != -1) {
 602             String str = v.substring(ib);
 603             String ver = str.substring(str.indexOf("\"") + 1, str.size() - 1);
 604 
 605             defineProperty("jdkRuntimeVersion", ver)
 606             def jdkVersionInfo = parseJavaVersion(ver)
 607             defineProperty("jdkVersion", jdkVersionInfo[0])
 608             defineProperty("jdkBuildNumber", jdkVersionInfo[1])
 609         }
 610     }
 611 } finally {
 612     inStream.close();
 613 }
 614 if (!project.hasProperty("jdkRuntimeVersion")) throw new Exception("Unable to determine the version of Java in JDK_HOME at $JDK_HOME");
 615 
 616 
 617 // Determine whether the javafx.* modules are present in the JDK. To do this,
 618 // we will execute "java --list-modules" and search for javafx.base


 619 ext.HAS_JAVAFX_MODULES = false;

 620 def inStream2 = new java.io.BufferedReader(new java.io.InputStreamReader(new java.lang.ProcessBuilder(JAVA, "--list-modules").start().getInputStream()));
 621 try {
 622     String v;
 623     while ((v = inStream2.readLine()) != null) {
 624         v = v.trim();
 625         if (v.startsWith("javafx.base")) ext.HAS_JAVAFX_MODULES = true;

 626     }
 627 } finally {
 628     inStream2.close();
 629 }
 630 
 631 // The HAS_JAVAFX_MODULES flag will be used to determine the mode for building
 632 // and running the applications and tests.
 633 // If HAS_JAVAFX_MODULES is true, then we will build / test javafx modules
 634 // for exporting to a JDK build. If HAS_JAVAFX_MODULES is false, then we will
 635 // build / test a standalone sdk for running with a JDK that does not include
 636 // the javafx modules.
 637 
 638 
 639 /**
 640  * Fetch/Check that external tools are present for the build. This method
 641  * will conditionally download the packages from project defined ivy repositories
 642  * and unpack them into the specified destdir
 643  *
 644  * @param configName A unique name to distinguish the configuration (ie "ARMSFV6")
 645  * @param packages A list of required packages (with extensions .tgz, .zip)


1281  *                                                                            *
1282  *  Log some of the settings we've determined. We could log more here, it     *
1283  *  doesn't really hurt.                                                      *
1284  *                                                                            *
1285  *****************************************************************************/
1286 
1287 logger.quiet("gradle.gradleVersion: $gradle.gradleVersion")
1288 logger.quiet("OS_NAME: $OS_NAME")
1289 logger.quiet("OS_ARCH: $OS_ARCH")
1290 logger.quiet("JAVA_HOME: $JAVA_HOME")
1291 logger.quiet("JDK_HOME: $JDK_HOME")
1292 logger.quiet("java.runtime.version: ${javaRuntimeVersion}")
1293 logger.quiet("java version: ${javaVersion}")
1294 logger.quiet("java build number: ${javaBuildNumber}")
1295 logger.quiet("jdk.runtime.version: ${jdkRuntimeVersion}")
1296 logger.quiet("jdk version: ${jdkVersion}")
1297 logger.quiet("jdk build number: ${jdkBuildNumber}")
1298 logger.quiet("minimum jdk version: ${jfxBuildJdkVersionMin}")
1299 logger.quiet("minimum jdk build number: ${jfxBuildJdkBuildnumMin}")
1300 logger.quiet("HAS_JAVAFX_MODULES: $HAS_JAVAFX_MODULES")

1301 logger.quiet("STUB_RUNTIME: $STUB_RUNTIME")
1302 logger.quiet("CONF: $CONF")
1303 logger.quiet("NUM_COMPILE_THREADS: $NUM_COMPILE_THREADS")
1304 logger.quiet("COMPILE_TARGETS: $COMPILE_TARGETS")
1305 logger.quiet("COMPILE_FLAGS_FILES: $COMPILE_FLAGS_FILES")
1306 logger.quiet("HUDSON_JOB_NAME: $HUDSON_JOB_NAME")
1307 logger.quiet("HUDSON_BUILD_NUMBER: $HUDSON_BUILD_NUMBER")
1308 logger.quiet("PROMOTED_BUILD_NUMBER: $PROMOTED_BUILD_NUMBER")
1309 logger.quiet("PRODUCT_NAME: $PRODUCT_NAME")
1310 logger.quiet("RELEASE_VERSION: $RELEASE_VERSION")
1311 logger.quiet("RELEASE_SUFFIX: $RELEASE_SUFFIX")
1312 logger.quiet("RELEASE_VERSION_SHORT: $RELEASE_VERSION_SHORT")
1313 logger.quiet("RELEASE_VERSION_LONG: $RELEASE_VERSION_LONG")
1314 logger.quiet("RELEASE_VERSION_PADDED: $RELEASE_VERSION_PADDED")
1315 logger.quiet("UPDATE_STUB_CACHE: $UPDATE_STUB_CACHE")
1316 
1317 /******************************************************************************
1318  *                                                                            *
1319  *                Definition of Native Code Compilation Tasks                 *
1320  *                                                                            *


2313         //shims // no test shims needed
2314         test
2315     }
2316 
2317     project.ext.moduleSourcePath = defaultModuleSourcePath
2318     project.ext.moduleSourcePathShim = defaultModuleSourcePathShim
2319 
2320     commonModuleSetup(project, [ 'base', 'graphics', 'swing' ])
2321 
2322     dependencies {
2323     }
2324 
2325     test {
2326         enabled = IS_FULL_TEST && IS_AWT_TEST
2327 
2328         if (!HAS_JAVAFX_MODULES) {
2329             jvmArgs += qualExportsSwing
2330         }
2331     }
2332 















2333     compileJava.options.compilerArgs.addAll(qualExportsSwing)
2334 }
2335 
2336 project(":swt") {
2337     tasks.all {
2338         if (!COMPILE_SWT) it.enabled = false
2339     }
2340 
2341     // javafx.swt is an automatic module
2342     project.ext.buildModule = false
2343 
2344     commonModuleSetup(project, [ 'base', 'graphics' ])
2345 
2346     dependencies {
2347         compile name: SWT_FILE_NAME
2348     }
2349 
2350     classes {
2351         doLast {
2352             // Copy all of the download libraries to libs directory for the sake of the IDEs


4760         def srcCmdsDir = "${buildDir}/${platformPrefix}module-bin"
4761         def dstCmdsDir = "${modulesCmdsDir}/${moduleName}"
4762         def copyBinFilesTask = project.task("copyBinFiles$t.capital", type: Copy, dependsOn: copyClassFilesTask) {
4763             from srcCmdsDir
4764             into dstCmdsDir
4765         }
4766 
4767         def srcLibsDir = "${buildDir}/${platformPrefix}module-lib"
4768         def dstLibsDir = "${modulesLibsDir}/${moduleName}"
4769         def copyLibFilesTask = project.task("copyLibFiles$t.capital", type: Copy, dependsOn: copyBinFilesTask) {
4770             from srcLibsDir
4771             into dstLibsDir
4772         }
4773 
4774         // Copy module sources
4775         // FIXME: javafx.swt sources?
4776         def copySources = project.hasProperty("includeSources") && project.includeSources
4777         def copySourceFilesTask = project.task("copySourceFiles$t.capital", type: Copy, dependsOn: copyLibFilesTask) {
4778             if (copySources) {
4779                 from "${project.projectDir}/src/main/java"
4780                 if (project.name.equals("base")) {
4781                     from "${project.projectDir}/build/gensrc/java"
4782                 }
4783                 if (project.name.equals("web")) {
4784                     from "${project.projectDir}/src/main/native/Source/WebCore/bindings/java/dom3/java"
4785                 }
4786             } else {
4787                 from "${project.projectDir}/src/main/java/module-info.java"
4788             }
4789             into "${modulesSrcDir}/${moduleName}"
4790             include "**/*.java"




4791             if (project.hasProperty("sourceFilter")) {
4792                 filter(project.sourceFilter)
4793             }
4794         }
4795 
4796         // Copy .html and other files needed for doc bundles
4797         def copyDocFiles = project.task("copyDocFiles$t.capital", type: Copy, dependsOn: copySourceFilesTask) {
4798             if (copySources) {
4799                 from("${project.projectDir}/src/main/docs") {
4800                     include "**/*.html"
4801                     filter { line->
4802                         line = line.replace("@FXVERSION@", RELEASE_VERSION)
4803                     }
4804                 }
4805                 from("${project.projectDir}/src/main/docs") {
4806                     exclude "**/*.html"
4807                 }
4808                 from("${project.projectDir}/src/main/java") {
4809                     exclude "**/*.java"
4810                 }




 598     String v = inStream.readLine().trim();
 599     if (v != null) {
 600         int ib = v.indexOf("full version \"");
 601         if (ib != -1) {
 602             String str = v.substring(ib);
 603             String ver = str.substring(str.indexOf("\"") + 1, str.size() - 1);
 604 
 605             defineProperty("jdkRuntimeVersion", ver)
 606             def jdkVersionInfo = parseJavaVersion(ver)
 607             defineProperty("jdkVersion", jdkVersionInfo[0])
 608             defineProperty("jdkBuildNumber", jdkVersionInfo[1])
 609         }
 610     }
 611 } finally {
 612     inStream.close();
 613 }
 614 if (!project.hasProperty("jdkRuntimeVersion")) throw new Exception("Unable to determine the version of Java in JDK_HOME at $JDK_HOME");
 615 
 616 
 617 // Determine whether the javafx.* modules are present in the JDK. To do this,
 618 // we will execute "java --list-modules" and search for javafx.base.
 619 // Also, check if jdk.unsupported.desktop module is present in JDK to ensure 
 620 // javafx.swing do not use internal JDK classes directly.
 621 ext.HAS_JAVAFX_MODULES = false;
 622 ext.HAS_UNSUPPORTED_DESKTOP = false;
 623 def inStream2 = new java.io.BufferedReader(new java.io.InputStreamReader(new java.lang.ProcessBuilder(JAVA, "--list-modules").start().getInputStream()));
 624 try {
 625     String v;
 626     while ((v = inStream2.readLine()) != null) {
 627         v = v.trim();
 628         if (v.startsWith("javafx.base")) ext.HAS_JAVAFX_MODULES = true;
 629         if (v.startsWith("jdk.unsupported.desktop")) ext.HAS_UNSUPPORTED_DESKTOP = true;
 630     }
 631 } finally {
 632     inStream2.close();
 633 }
 634 
 635 // The HAS_JAVAFX_MODULES flag will be used to determine the mode for building
 636 // and running the applications and tests.
 637 // If HAS_JAVAFX_MODULES is true, then we will build / test javafx modules
 638 // for exporting to a JDK build. If HAS_JAVAFX_MODULES is false, then we will
 639 // build / test a standalone sdk for running with a JDK that does not include
 640 // the javafx modules.
 641 
 642 
 643 /**
 644  * Fetch/Check that external tools are present for the build. This method
 645  * will conditionally download the packages from project defined ivy repositories
 646  * and unpack them into the specified destdir
 647  *
 648  * @param configName A unique name to distinguish the configuration (ie "ARMSFV6")
 649  * @param packages A list of required packages (with extensions .tgz, .zip)


1285  *                                                                            *
1286  *  Log some of the settings we've determined. We could log more here, it     *
1287  *  doesn't really hurt.                                                      *
1288  *                                                                            *
1289  *****************************************************************************/
1290 
1291 logger.quiet("gradle.gradleVersion: $gradle.gradleVersion")
1292 logger.quiet("OS_NAME: $OS_NAME")
1293 logger.quiet("OS_ARCH: $OS_ARCH")
1294 logger.quiet("JAVA_HOME: $JAVA_HOME")
1295 logger.quiet("JDK_HOME: $JDK_HOME")
1296 logger.quiet("java.runtime.version: ${javaRuntimeVersion}")
1297 logger.quiet("java version: ${javaVersion}")
1298 logger.quiet("java build number: ${javaBuildNumber}")
1299 logger.quiet("jdk.runtime.version: ${jdkRuntimeVersion}")
1300 logger.quiet("jdk version: ${jdkVersion}")
1301 logger.quiet("jdk build number: ${jdkBuildNumber}")
1302 logger.quiet("minimum jdk version: ${jfxBuildJdkVersionMin}")
1303 logger.quiet("minimum jdk build number: ${jfxBuildJdkBuildnumMin}")
1304 logger.quiet("HAS_JAVAFX_MODULES: $HAS_JAVAFX_MODULES")
1305 logger.quiet("HAS_UNSUPPORTED_DESKTOP: $HAS_UNSUPPORTED_DESKTOP")
1306 logger.quiet("STUB_RUNTIME: $STUB_RUNTIME")
1307 logger.quiet("CONF: $CONF")
1308 logger.quiet("NUM_COMPILE_THREADS: $NUM_COMPILE_THREADS")
1309 logger.quiet("COMPILE_TARGETS: $COMPILE_TARGETS")
1310 logger.quiet("COMPILE_FLAGS_FILES: $COMPILE_FLAGS_FILES")
1311 logger.quiet("HUDSON_JOB_NAME: $HUDSON_JOB_NAME")
1312 logger.quiet("HUDSON_BUILD_NUMBER: $HUDSON_BUILD_NUMBER")
1313 logger.quiet("PROMOTED_BUILD_NUMBER: $PROMOTED_BUILD_NUMBER")
1314 logger.quiet("PRODUCT_NAME: $PRODUCT_NAME")
1315 logger.quiet("RELEASE_VERSION: $RELEASE_VERSION")
1316 logger.quiet("RELEASE_SUFFIX: $RELEASE_SUFFIX")
1317 logger.quiet("RELEASE_VERSION_SHORT: $RELEASE_VERSION_SHORT")
1318 logger.quiet("RELEASE_VERSION_LONG: $RELEASE_VERSION_LONG")
1319 logger.quiet("RELEASE_VERSION_PADDED: $RELEASE_VERSION_PADDED")
1320 logger.quiet("UPDATE_STUB_CACHE: $UPDATE_STUB_CACHE")
1321 
1322 /******************************************************************************
1323  *                                                                            *
1324  *                Definition of Native Code Compilation Tasks                 *
1325  *                                                                            *


2318         //shims // no test shims needed
2319         test
2320     }
2321 
2322     project.ext.moduleSourcePath = defaultModuleSourcePath
2323     project.ext.moduleSourcePathShim = defaultModuleSourcePathShim
2324 
2325     commonModuleSetup(project, [ 'base', 'graphics', 'swing' ])
2326 
2327     dependencies {
2328     }
2329 
2330     test {
2331         enabled = IS_FULL_TEST && IS_AWT_TEST
2332 
2333         if (!HAS_JAVAFX_MODULES) {
2334             jvmArgs += qualExportsSwing
2335         }
2336     }
2337 
2338     sourceSets.main.java.srcDirs += "$buildDir/gensrc/java"
2339     sourceSets.main.java {
2340         if (!HAS_UNSUPPORTED_DESKTOP) {
2341             exclude("com/sun/javafx/embed/swing/newimpl/**")
2342         }
2343     }
2344     task checkJDKUnsupportedModule(type: Copy, description: "copy module-info file to gensrc") {
2345         from "src/main/module-info/module-info.java"
2346         into "$buildDir/gensrc/java/"
2347         filter { line->
2348             !HAS_UNSUPPORTED_DESKTOP && line.contains('jdk.unsupported.desktop') ? null : line
2349         }
2350     }
2351     compileJava.dependsOn checkJDKUnsupportedModule
2352 
2353     compileJava.options.compilerArgs.addAll(qualExportsSwing)
2354 }
2355 
2356 project(":swt") {
2357     tasks.all {
2358         if (!COMPILE_SWT) it.enabled = false
2359     }
2360 
2361     // javafx.swt is an automatic module
2362     project.ext.buildModule = false
2363 
2364     commonModuleSetup(project, [ 'base', 'graphics' ])
2365 
2366     dependencies {
2367         compile name: SWT_FILE_NAME
2368     }
2369 
2370     classes {
2371         doLast {
2372             // Copy all of the download libraries to libs directory for the sake of the IDEs


4780         def srcCmdsDir = "${buildDir}/${platformPrefix}module-bin"
4781         def dstCmdsDir = "${modulesCmdsDir}/${moduleName}"
4782         def copyBinFilesTask = project.task("copyBinFiles$t.capital", type: Copy, dependsOn: copyClassFilesTask) {
4783             from srcCmdsDir
4784             into dstCmdsDir
4785         }
4786 
4787         def srcLibsDir = "${buildDir}/${platformPrefix}module-lib"
4788         def dstLibsDir = "${modulesLibsDir}/${moduleName}"
4789         def copyLibFilesTask = project.task("copyLibFiles$t.capital", type: Copy, dependsOn: copyBinFilesTask) {
4790             from srcLibsDir
4791             into dstLibsDir
4792         }
4793 
4794         // Copy module sources
4795         // FIXME: javafx.swt sources?
4796         def copySources = project.hasProperty("includeSources") && project.includeSources
4797         def copySourceFilesTask = project.task("copySourceFiles$t.capital", type: Copy, dependsOn: copyLibFilesTask) {
4798             if (copySources) {
4799                 from "${project.projectDir}/src/main/java"
4800                 if (project.name.equals("base") || project.name.equals("swing")) {
4801                     from "${project.projectDir}/build/gensrc/java"
4802                 }
4803                 if (project.name.equals("web")) {
4804                     from "${project.projectDir}/src/main/native/Source/WebCore/bindings/java/dom3/java"
4805                 }
4806             } else {
4807                 from "${project.projectDir}/src/main/java/module-info.java"
4808             }
4809             into "${modulesSrcDir}/${moduleName}"
4810             include "**/*.java"
4811             if (!HAS_UNSUPPORTED_DESKTOP) {
4812                 exclude("com/sun/javafx/embed/swing/newimpl/**")
4813             }  
4814 
4815             if (project.hasProperty("sourceFilter")) {
4816                 filter(project.sourceFilter)
4817             }
4818         }
4819 
4820         // Copy .html and other files needed for doc bundles
4821         def copyDocFiles = project.task("copyDocFiles$t.capital", type: Copy, dependsOn: copySourceFilesTask) {
4822             if (copySources) {
4823                 from("${project.projectDir}/src/main/docs") {
4824                     include "**/*.html"
4825                     filter { line->
4826                         line = line.replace("@FXVERSION@", RELEASE_VERSION)
4827                     }
4828                 }
4829                 from("${project.projectDir}/src/main/docs") {
4830                     exclude "**/*.html"
4831                 }
4832                 from("${project.projectDir}/src/main/java") {
4833                     exclude "**/*.java"
4834                 }


< prev index next >