./build.gradle

Print this page
rev 6157 : RT-35443 Provide a headless glass implementation integrated with our JUnit tests


 321     IS_WINDOWS && !IS_64 ? "org.eclipse.swt.win32.win32.x86_3.7.2.v3740f" :
 322     IS_LINUX && IS_64 ? "org.eclipse.swt.gtk.linux.x86_64_3.7.2.v3740f" :
 323     IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.7.2.v3740f" : ""
 324 
 325 // Build javadocs only if BUILD_JAVADOC=true
 326 defineProperty("BUILD_JAVADOC", "false")
 327 ext.IS_BUILD_JAVADOC = Boolean.parseBoolean(BUILD_JAVADOC)
 328 
 329 // Specifies whether to build the javafx-src bundle
 330 defineProperty("BUILD_SRC_ZIP", "false")
 331 ext.IS_BUILD_SRC_ZIP = Boolean.parseBoolean(BUILD_SRC_ZIP)
 332 
 333 // Specifies whether to run full tests (true) or smoke tests (false)
 334 defineProperty("FULL_TEST", "false")
 335 ext.IS_FULL_TEST = Boolean.parseBoolean(FULL_TEST);
 336 
 337 // Specifies whether to run robot-based visual tests (only used when FULL_TEST is also enabled)
 338 defineProperty("USE_ROBOT", "true")
 339 ext.IS_USE_ROBOT = Boolean.parseBoolean(USE_ROBOT);
 340 




 341 // Specifies whether to run system tests that depend on AWT (only used when FULL_TEST is also enabled)
 342 defineProperty("AWT_TEST", "true")
 343 ext.IS_AWT_TEST = Boolean.parseBoolean(AWT_TEST);
 344 
 345 // Specify the build configuration (Release, Debug, or DebugNative)
 346 defineProperty("CONF", "Debug")
 347 ext.IS_DEBUG_JAVA = CONF == "Debug" || CONF == "DebugNative"
 348 ext.IS_DEBUG_NATIVE = CONF == "DebugNative"
 349 
 350 // Defines the compiler warning levels to use. If empty, then no warnings are generated. If
 351 // not empty, then the expected syntax is as a space or comma separated list of names, such
 352 // as defined in the javac documentation.
 353 defineProperty("LINT", "none")
 354 ext.IS_LINT = LINT != "none"
 355 
 356 defineProperty("DOC_LINT", "none")
 357 ext.IS_DOC_LINT = DOC_LINT != "none"
 358 
 359 // Specifies whether to use the "useDepend" option when compiling Java sources
 360 defineProperty("USE_DEPEND", "true")


1022     def sdkDir = "${rootProject.buildDir}/${defaultHostTarget}-sdk"
1023     def jfxrtJar = "$sdkDir/rt/lib/ext/jfxrt.jar"
1024 
1025     // At the moment the ASM library shipped with Gradle that is used to
1026     // discover the different test classes fails on Java 8, so in order
1027     // to have sourceCompatibility set to 1.8 I have to also turn scanForClasses off
1028     // and manually specify the includes / excludes. At the moment we use
1029     // Java 7 but when we switch to 8 this will be needed, and probably again when
1030     // we start building with Java 9.
1031     test {
1032         jvmArgs("-Djava.ext.dirs=");
1033         executable = JAVA;
1034         enableAssertions = true;
1035         testLogging.exceptionFormat = "full";
1036         scanForTestClasses = false;
1037         include("**/*Test.*");
1038         if (BUILD_CLOSED && DO_JCOV) {
1039             addJCov(project, test)
1040         }
1041         classpath = files("$jfxrtJar") + classpath





1042     }
1043 
1044     compileTestJava {
1045         classpath = files("$jfxrtJar") + classpath
1046     }
1047 
1048     // Exclude any non-public-API classes from having javadoc generated. This block is used
1049     // when generating JavaDocs for a specific project. When generating the JavaDocs for the
1050     // entire SDK, a different javadoc command is used (see the javadoc task on the top level)
1051     javadoc {
1052         enabled = IS_BUILD_JAVADOC
1053         exclude("com/**/*", "javafx/scene/ParentDesignInfo*", "Compile*", "javafx/builder/**/*");
1054         executable = JAVADOC;
1055         options.windowTitle("JavaFX Project ${project.name} ${RELEASE_NAME}")
1056         options.links(JDK_DOCS);
1057         options.addBooleanOption("XDignore.symbol.file").setValue(true);
1058         options.addBooleanOption("Xdoclint:none").setValue(!IS_DOC_LINT);
1059         options.addBooleanOption("javafx").setValue(true);
1060         // All doc-files are located in src/main/docs because Gradle's javadoc doesn't copy
1061         // over the doc-files if they are embedded with the sources. I find this arrangement




 321     IS_WINDOWS && !IS_64 ? "org.eclipse.swt.win32.win32.x86_3.7.2.v3740f" :
 322     IS_LINUX && IS_64 ? "org.eclipse.swt.gtk.linux.x86_64_3.7.2.v3740f" :
 323     IS_LINUX && !IS_64 ? "org.eclipse.swt.gtk.linux.x86_3.7.2.v3740f" : ""
 324 
 325 // Build javadocs only if BUILD_JAVADOC=true
 326 defineProperty("BUILD_JAVADOC", "false")
 327 ext.IS_BUILD_JAVADOC = Boolean.parseBoolean(BUILD_JAVADOC)
 328 
 329 // Specifies whether to build the javafx-src bundle
 330 defineProperty("BUILD_SRC_ZIP", "false")
 331 ext.IS_BUILD_SRC_ZIP = Boolean.parseBoolean(BUILD_SRC_ZIP)
 332 
 333 // Specifies whether to run full tests (true) or smoke tests (false)
 334 defineProperty("FULL_TEST", "false")
 335 ext.IS_FULL_TEST = Boolean.parseBoolean(FULL_TEST);
 336 
 337 // Specifies whether to run robot-based visual tests (only used when FULL_TEST is also enabled)
 338 defineProperty("USE_ROBOT", "true")
 339 ext.IS_USE_ROBOT = Boolean.parseBoolean(USE_ROBOT);
 340 
 341 // Specified whether to run tests in headless mode
 342 defineProperty("HEADLESS_TEST", "false")
 343 ext.IS_HEADLESS_TEST = Boolean.parseBoolean(HEADLESS_TEST);
 344 
 345 // Specifies whether to run system tests that depend on AWT (only used when FULL_TEST is also enabled)
 346 defineProperty("AWT_TEST", "true")
 347 ext.IS_AWT_TEST = Boolean.parseBoolean(AWT_TEST);
 348 
 349 // Specify the build configuration (Release, Debug, or DebugNative)
 350 defineProperty("CONF", "Debug")
 351 ext.IS_DEBUG_JAVA = CONF == "Debug" || CONF == "DebugNative"
 352 ext.IS_DEBUG_NATIVE = CONF == "DebugNative"
 353 
 354 // Defines the compiler warning levels to use. If empty, then no warnings are generated. If
 355 // not empty, then the expected syntax is as a space or comma separated list of names, such
 356 // as defined in the javac documentation.
 357 defineProperty("LINT", "none")
 358 ext.IS_LINT = LINT != "none"
 359 
 360 defineProperty("DOC_LINT", "none")
 361 ext.IS_DOC_LINT = DOC_LINT != "none"
 362 
 363 // Specifies whether to use the "useDepend" option when compiling Java sources
 364 defineProperty("USE_DEPEND", "true")


1026     def sdkDir = "${rootProject.buildDir}/${defaultHostTarget}-sdk"
1027     def jfxrtJar = "$sdkDir/rt/lib/ext/jfxrt.jar"
1028 
1029     // At the moment the ASM library shipped with Gradle that is used to
1030     // discover the different test classes fails on Java 8, so in order
1031     // to have sourceCompatibility set to 1.8 I have to also turn scanForClasses off
1032     // and manually specify the includes / excludes. At the moment we use
1033     // Java 7 but when we switch to 8 this will be needed, and probably again when
1034     // we start building with Java 9.
1035     test {
1036         jvmArgs("-Djava.ext.dirs=");
1037         executable = JAVA;
1038         enableAssertions = true;
1039         testLogging.exceptionFormat = "full";
1040         scanForTestClasses = false;
1041         include("**/*Test.*");
1042         if (BUILD_CLOSED && DO_JCOV) {
1043             addJCov(project, test)
1044         }
1045         classpath = files("$jfxrtJar") + classpath
1046         if (IS_HEADLESS_TEST) {
1047             systemProperty 'glass.platform', 'Monocle'
1048             systemProperty 'monocle.platform', 'Headless'
1049             systemProperty 'prism.order', 'sw'
1050         }
1051     }
1052 
1053     compileTestJava {
1054         classpath = files("$jfxrtJar") + classpath
1055     }
1056 
1057     // Exclude any non-public-API classes from having javadoc generated. This block is used
1058     // when generating JavaDocs for a specific project. When generating the JavaDocs for the
1059     // entire SDK, a different javadoc command is used (see the javadoc task on the top level)
1060     javadoc {
1061         enabled = IS_BUILD_JAVADOC
1062         exclude("com/**/*", "javafx/scene/ParentDesignInfo*", "Compile*", "javafx/builder/**/*");
1063         executable = JAVADOC;
1064         options.windowTitle("JavaFX Project ${project.name} ${RELEASE_NAME}")
1065         options.links(JDK_DOCS);
1066         options.addBooleanOption("XDignore.symbol.file").setValue(true);
1067         options.addBooleanOption("Xdoclint:none").setValue(!IS_DOC_LINT);
1068         options.addBooleanOption("javafx").setValue(true);
1069         // All doc-files are located in src/main/docs because Gradle's javadoc doesn't copy
1070         // over the doc-files if they are embedded with the sources. I find this arrangement