< prev index next >

./build.gradle

Print this page
rev 9808 : 8131888: Need to deliver javafx.swt as a modular jar in JDK 9


1802 
1803     dependencies {
1804         compile BUILD_SRC, project(":base"), project(":graphics")
1805     }
1806 
1807     Set<String> testInclude = [ "test/**" ]
1808     configureJigsawTests(project, [ "base", "graphics", "controls" ],
1809         null, testInclude,
1810         null // no addExports
1811     )
1812 
1813     test {
1814         enabled = IS_FULL_TEST && IS_AWT_TEST
1815     }
1816 }
1817 
1818 project(":swt") {
1819     tasks.all {
1820         if (!COMPILE_SWT) it.enabled = false
1821     }




1822     dependencies {
1823         compile BUILD_SRC, project(":base"), project(":graphics")
1824         compile name: SWT_FILE_NAME
1825     }
1826     classes << {
1827         // Copy all of the download libraries to libs directory for the sake of the IDEs
1828         File libsDir = rootProject.file("build/libs");
1829         File swtLib = new File(libsDir, "swt-debug.jar")
1830         libsDir.mkdirs();
1831 
1832         // Skip copy if file is present.
1833         if (swtLib.exists()) return;
1834 
1835         for (File f : configurations.compile.files) {
1836             // Have to rename the swt jar because it is some platform specific name but
1837             // for the sake of the IDEs we need to have a single stable name that works
1838             // on every platform
1839             copy {
1840                 into libsDir
1841                 from f.getParentFile()


1843                 includeEmptyDirs = false
1844                 rename ".*swt.*jar", "swt-debug\\.jar"
1845             }
1846         }
1847     }
1848 }
1849 
1850 project(":fxml") {
1851     project.ext.buildModule = true
1852     project.ext.moduleRuntime = true
1853     project.ext.moduleName = "javafx.fxml"
1854 
1855     Set<String> testInclude = [ "test/**" ]
1856     configureJigsawTests(project, [ "base", "graphics" ],
1857         null, testInclude,
1858         project.projectDir.path + "/src/test/addExports"
1859     )
1860 
1861     dependencies {
1862         compile BUILD_SRC, project(":base"), project(":graphics"),
1863                 project(":controls"), project(":swt"), project(":swing")
1864         testCompile project(":graphics").sourceSets.test.output
1865     }
1866     test {
1867         // StubToolkit is not *really* needed here, but because some code inadvertently invokes performance
1868         // tracker and this attempts to fire up the toolkit and this looks for native libraries and fails,
1869         // we have to use the stub toolkit for now.
1870         jvmArgs "-Djavafx.toolkit=test.com.sun.javafx.pgstub.StubToolkit"
1871         // FIXME: change this to also allow JDK 9 boot jdk
1872         classpath += files("$JDK_HOME/jre/lib/ext/nashorn.jar")
1873     }
1874 }
1875 
1876 project(":jmx") {
1877     project.ext.buildModule = false // true
1878     project.ext.moduleRuntime = false
1879     project.ext.moduleName = "javafx.jmx"
1880     dependencies {
1881         compile project(":base")
1882         compile project(":graphics")
1883         compile project(":swing")


3163 
3164         moduleProjList.each { project ->
3165             if (project.ext.moduleRuntime) {
3166                 from("${modulesDir}/${project.ext.moduleName}");
3167             }
3168         }
3169 
3170         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
3171     }
3172 
3173     def jfxrtIndexTask = task("jfxrtIndex$t.capital") {
3174         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
3175         dependsOn(jfxrtTask)
3176 
3177         doLast() {
3178             ant.jar (update: true, index: true, destfile: jfxrtTask.archiveName)
3179         }
3180     }
3181     jfxrt.dependsOn(jfxrtIndexTask)
3182 
3183     // FIXME: JIGSAW -- update this for modules
3184     def jfxswtTask = task("jfxswt$t.capital", type: Jar) {
3185         enabled = COMPILE_SWT
3186         group = "Basic"
3187         description = "Creates the jfxswt.jar for the $t.name target"
3188         archiveName = "build/${sdkDirName}/lib/jfxswt.jar";
3189         includeEmptyDirs = false
3190         from("modules/swt/build/classes/main");
3191         include("**/javafx/embed/swt/**")
3192         exclude("**/*.java");  // Builder java files are in build/classes and should be excluded
3193 
3194         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
3195     }
3196 
3197     def jfxswtIndexTask = task("jfxswtIndex$t.capital") {
3198         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
3199         dependsOn(jfxswtTask)
3200 
3201         doLast() {
3202             ant.jar (update: true, index: true, destfile: jfxswtTask.archiveName)
3203         }
3204     }
3205     jfxrt.dependsOn(jfxswtIndexTask)
3206 
3207     def jmxTask = task ("jmx${t.capital}", type: Jar) {
3208         group = "Basic"
3209         description = "Creates the javafx-mx.jar"
3210         archiveName = "build/${sdkDirName}/lib/javafx-mx.jar";
3211         includeEmptyDirs = false
3212         from "modules/jmx/build/classes/main"
3213         from "modules/jmx/build/resources/main"
3214         dependsOn project(":jmx").assemble
3215     }
3216 
3217     // The 'sdk' task will build the rest of the legacy SDK, and depends
3218     // on the 'jfxrtTask' task. After executing this task the sdk bundle for
3219     // the current COMPILE_TARGETS will be fully created.
3220     def sdkTask = task("sdk$t.capital") {
3221         group = "Basic"
3222         description = "Creates the SDK for $t.name"
3223         doLast {
3224             copy {
3225                 moduleProjList.each { project ->


3247             }
3248 
3249             // FIXME: JIGSAW -- update this for modules
3250             // Copy over the javafx-src bundle
3251             if (IS_BUILD_SRC_ZIP) {
3252                 copy {
3253                     from "build/javafx-src.zip"
3254                     into "build/${sdkDirName}"
3255                 }
3256             }
3257 
3258             // FIXME: JIGSAW -- update this for modules
3259             // Copy over the javapackager man files
3260             copy {
3261                 from "modules/fxpackager/build/man"
3262                 into "build/${sdkDirName}/man"
3263             }
3264         }
3265         dependsOn(jmxTask);
3266         dependsOn(jfxrtIndexTask)
3267         dependsOn(jfxswtIndexTask)
3268         dependsOn(javadoc)
3269         dependsOn(src)
3270     }
3271 
3272     def generateSymbols = targetProperties.containsKey('generateSymbols') ? targetProperties.generateSymbols : false
3273     if (generateSymbols) {
3274         def exportedSymbolsTask = project.task("exportedSymbols${t.capital}", type: ExportedSymbolsTask, dependsOn: sdkTask, group: "Build") {
3275             description = "Generates exported symbols file for iOS build (from .a libraries)"
3276             def libDirName = "build/${sdkDirName}/$targetProperties.libDest"
3277             libDir = file("$libDirName")
3278             outputFile = file("$libDirName/exported.symbols")
3279             excludes = targetProperties.generateSymbolsExcludes
3280         }
3281         sdk.dependsOn(exportedSymbolsTask)
3282     }
3283 
3284     sdk.dependsOn(sdkTask)
3285 }
3286 
3287 /*


3607                     */
3608                 }
3609             }
3610         }
3611         buildModulesTask.dependsOn(buildModuleClassesTask)
3612     }
3613 
3614 
3615     def buildModuleLibsTask = task("buildModuleLibs$t.capital") {
3616         group = "Basic"
3617 
3618         def graphicsProject = project(":graphics");
3619         dependsOn(graphicsProject.assemble)
3620 
3621         def mediaProject = project(":media");
3622         dependsOn(mediaProject.assemble)
3623 
3624         def webProject = project(":web");
3625         dependsOn(webProject.assemble)
3626 






3627         def packagerProject = project(":fxpackager");
3628         //dependsOn(packagerProject.assemble)
3629         dependsOn(packagerProject.jar)
3630         dependsOn(project(":fxpackagerservices").jar)
3631 
3632         doLast {
3633 
3634             def library = targetProperties.library
3635 
3636             // javafx.base (lib/javafx.properties)
3637 
3638             def baseProject = project(":base");
3639             def moduleLibDir = "${baseProject.buildDir}/${platformPrefix}module-lib"
3640             mkdir moduleLibDir
3641             final File javafxProperties = file("${moduleLibDir}/javafx.properties")
3642             javafxProperties.delete()
3643             javafxProperties << "javafx.version=$RELEASE_VERSION_SHORT";
3644             javafxProperties << "\n"
3645             javafxProperties << "javafx.runtime.version=$RELEASE_VERSION_LONG";
3646             javafxProperties << "\n"


3726                         from ("$LIBRARY_STUB/${library("glib-lite")}")
3727                     }
3728                 }
3729             }
3730 
3731 
3732             // javafx.web native libraries
3733 
3734             copy {
3735                 into "${webProject.buildDir}/${moduleNativeDirName}"
3736 
3737                 if (IS_COMPILE_WEBKIT) {
3738                     from ("modules/web/build/libs/${t.name}/${library('jfxwebkit')}")
3739                 } else {
3740                     if (t.name != "android" && t.name != "ios" && t.name != "dalvik") {
3741                         from ("$LIBRARY_STUB/${library('jfxwebkit')}")
3742                     }
3743                 }
3744             }
3745 










3746 
3747             // javafx.packager libraries and executable
3748 
3749             // Copy over the javapackager libs
3750             copy {
3751                 from "modules/fxpackager/build/libs"
3752                 into "${packagerProject.buildDir}/${platformPrefix}module-lib"
3753             }
3754 
3755             // Copy over the javapackager executable
3756             if (t.name == "win" || t.name == "linux" || t.name == "mac") {
3757                 copy {
3758                     from "modules/fxpackager/build/javapackager"
3759                     into "${packagerProject.buildDir}/${platformPrefix}module-bin"
3760                 }
3761             }
3762 
3763         }
3764     }
3765     buildModulesTask.dependsOn(buildModuleLibsTask)




1802 
1803     dependencies {
1804         compile BUILD_SRC, project(":base"), project(":graphics")
1805     }
1806 
1807     Set<String> testInclude = [ "test/**" ]
1808     configureJigsawTests(project, [ "base", "graphics", "controls" ],
1809         null, testInclude,
1810         null // no addExports
1811     )
1812 
1813     test {
1814         enabled = IS_FULL_TEST && IS_AWT_TEST
1815     }
1816 }
1817 
1818 project(":swt") {
1819     tasks.all {
1820         if (!COMPILE_SWT) it.enabled = false
1821     }
1822 
1823     // javafx.swt is an automatic module
1824     project.ext.buildModule = false
1825 
1826     dependencies {
1827         compile BUILD_SRC, project(":base"), project(":graphics")
1828         compile name: SWT_FILE_NAME
1829     }
1830     classes << {
1831         // Copy all of the download libraries to libs directory for the sake of the IDEs
1832         File libsDir = rootProject.file("build/libs");
1833         File swtLib = new File(libsDir, "swt-debug.jar")
1834         libsDir.mkdirs();
1835 
1836         // Skip copy if file is present.
1837         if (swtLib.exists()) return;
1838 
1839         for (File f : configurations.compile.files) {
1840             // Have to rename the swt jar because it is some platform specific name but
1841             // for the sake of the IDEs we need to have a single stable name that works
1842             // on every platform
1843             copy {
1844                 into libsDir
1845                 from f.getParentFile()


1847                 includeEmptyDirs = false
1848                 rename ".*swt.*jar", "swt-debug\\.jar"
1849             }
1850         }
1851     }
1852 }
1853 
1854 project(":fxml") {
1855     project.ext.buildModule = true
1856     project.ext.moduleRuntime = true
1857     project.ext.moduleName = "javafx.fxml"
1858 
1859     Set<String> testInclude = [ "test/**" ]
1860     configureJigsawTests(project, [ "base", "graphics" ],
1861         null, testInclude,
1862         project.projectDir.path + "/src/test/addExports"
1863     )
1864 
1865     dependencies {
1866         compile BUILD_SRC, project(":base"), project(":graphics"),
1867                 project(":controls")
1868         testCompile project(":graphics").sourceSets.test.output
1869     }
1870     test {
1871         // StubToolkit is not *really* needed here, but because some code inadvertently invokes performance
1872         // tracker and this attempts to fire up the toolkit and this looks for native libraries and fails,
1873         // we have to use the stub toolkit for now.
1874         jvmArgs "-Djavafx.toolkit=test.com.sun.javafx.pgstub.StubToolkit"
1875         // FIXME: change this to also allow JDK 9 boot jdk
1876         classpath += files("$JDK_HOME/jre/lib/ext/nashorn.jar")
1877     }
1878 }
1879 
1880 project(":jmx") {
1881     project.ext.buildModule = false // true
1882     project.ext.moduleRuntime = false
1883     project.ext.moduleName = "javafx.jmx"
1884     dependencies {
1885         compile project(":base")
1886         compile project(":graphics")
1887         compile project(":swing")


3167 
3168         moduleProjList.each { project ->
3169             if (project.ext.moduleRuntime) {
3170                 from("${modulesDir}/${project.ext.moduleName}");
3171             }
3172         }
3173 
3174         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
3175     }
3176 
3177     def jfxrtIndexTask = task("jfxrtIndex$t.capital") {
3178         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
3179         dependsOn(jfxrtTask)
3180 
3181         doLast() {
3182             ant.jar (update: true, index: true, destfile: jfxrtTask.archiveName)
3183         }
3184     }
3185     jfxrt.dependsOn(jfxrtIndexTask)
3186 
3187     def javafxSwtTask = task("javafxSwt$t.capital", type: Jar) {

3188         enabled = COMPILE_SWT
3189         group = "Basic"
3190         description = "Creates the javafx-swt.jar for the $t.name target"
3191         archiveName = "modules/swt/build/libs/javafx-swt.jar";
3192         includeEmptyDirs = false
3193         from("modules/swt/build/classes/main");
3194         include("**/javafx/embed/swt/**")

3195 
3196         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
3197     }
3198 
3199     def javafxSwtIndexTask = task("javafxSwtIndex$t.capital") {
3200         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
3201         dependsOn(javafxSwtTask)
3202 
3203         doLast() {
3204             ant.jar (update: true, index: true, destfile: javafxSwtTask.archiveName)
3205         }
3206     }
3207     jfxrt.dependsOn(javafxSwtIndexTask)
3208 
3209     def jmxTask = task ("jmx${t.capital}", type: Jar) {
3210         group = "Basic"
3211         description = "Creates the javafx-mx.jar"
3212         archiveName = "build/${sdkDirName}/lib/javafx-mx.jar";
3213         includeEmptyDirs = false
3214         from "modules/jmx/build/classes/main"
3215         from "modules/jmx/build/resources/main"
3216         dependsOn project(":jmx").assemble
3217     }
3218 
3219     // The 'sdk' task will build the rest of the legacy SDK, and depends
3220     // on the 'jfxrtTask' task. After executing this task the sdk bundle for
3221     // the current COMPILE_TARGETS will be fully created.
3222     def sdkTask = task("sdk$t.capital") {
3223         group = "Basic"
3224         description = "Creates the SDK for $t.name"
3225         doLast {
3226             copy {
3227                 moduleProjList.each { project ->


3249             }
3250 
3251             // FIXME: JIGSAW -- update this for modules
3252             // Copy over the javafx-src bundle
3253             if (IS_BUILD_SRC_ZIP) {
3254                 copy {
3255                     from "build/javafx-src.zip"
3256                     into "build/${sdkDirName}"
3257                 }
3258             }
3259 
3260             // FIXME: JIGSAW -- update this for modules
3261             // Copy over the javapackager man files
3262             copy {
3263                 from "modules/fxpackager/build/man"
3264                 into "build/${sdkDirName}/man"
3265             }
3266         }
3267         dependsOn(jmxTask);
3268         dependsOn(jfxrtIndexTask)
3269         dependsOn(javafxSwtIndexTask)
3270         dependsOn(javadoc)
3271         dependsOn(src)
3272     }
3273 
3274     def generateSymbols = targetProperties.containsKey('generateSymbols') ? targetProperties.generateSymbols : false
3275     if (generateSymbols) {
3276         def exportedSymbolsTask = project.task("exportedSymbols${t.capital}", type: ExportedSymbolsTask, dependsOn: sdkTask, group: "Build") {
3277             description = "Generates exported symbols file for iOS build (from .a libraries)"
3278             def libDirName = "build/${sdkDirName}/$targetProperties.libDest"
3279             libDir = file("$libDirName")
3280             outputFile = file("$libDirName/exported.symbols")
3281             excludes = targetProperties.generateSymbolsExcludes
3282         }
3283         sdk.dependsOn(exportedSymbolsTask)
3284     }
3285 
3286     sdk.dependsOn(sdkTask)
3287 }
3288 
3289 /*


3609                     */
3610                 }
3611             }
3612         }
3613         buildModulesTask.dependsOn(buildModuleClassesTask)
3614     }
3615 
3616 
3617     def buildModuleLibsTask = task("buildModuleLibs$t.capital") {
3618         group = "Basic"
3619 
3620         def graphicsProject = project(":graphics");
3621         dependsOn(graphicsProject.assemble)
3622 
3623         def mediaProject = project(":media");
3624         dependsOn(mediaProject.assemble)
3625 
3626         def webProject = project(":web");
3627         dependsOn(webProject.assemble)
3628 
3629         def swtProject = project(":swt");
3630         if (COMPILE_SWT) {
3631             def javafxSwtIndexTask = tasks.getByName("javafxSwtIndex${t.capital}");
3632             dependsOn(javafxSwtIndexTask)
3633         }
3634 
3635         def packagerProject = project(":fxpackager");
3636         //dependsOn(packagerProject.assemble)
3637         dependsOn(packagerProject.jar)
3638         dependsOn(project(":fxpackagerservices").jar)
3639 
3640         doLast {
3641 
3642             def library = targetProperties.library
3643 
3644             // javafx.base (lib/javafx.properties)
3645 
3646             def baseProject = project(":base");
3647             def moduleLibDir = "${baseProject.buildDir}/${platformPrefix}module-lib"
3648             mkdir moduleLibDir
3649             final File javafxProperties = file("${moduleLibDir}/javafx.properties")
3650             javafxProperties.delete()
3651             javafxProperties << "javafx.version=$RELEASE_VERSION_SHORT";
3652             javafxProperties << "\n"
3653             javafxProperties << "javafx.runtime.version=$RELEASE_VERSION_LONG";
3654             javafxProperties << "\n"


3734                         from ("$LIBRARY_STUB/${library("glib-lite")}")
3735                     }
3736                 }
3737             }
3738 
3739 
3740             // javafx.web native libraries
3741 
3742             copy {
3743                 into "${webProject.buildDir}/${moduleNativeDirName}"
3744 
3745                 if (IS_COMPILE_WEBKIT) {
3746                     from ("modules/web/build/libs/${t.name}/${library('jfxwebkit')}")
3747                 } else {
3748                     if (t.name != "android" && t.name != "ios" && t.name != "dalvik") {
3749                         from ("$LIBRARY_STUB/${library('jfxwebkit')}")
3750                     }
3751                 }
3752             }
3753 
3754             // FIXME: the following is a hack to workaround the fact that there
3755             // is no way to deliver javafx-swt.jar other than in one of the
3756             // existing runtime modules.
3757             if (COMPILE_SWT) {
3758                 // Copy javafx-swt.jar to the javafx-graphics module lib dir
3759                 copy {
3760                     from "${swtProject.buildDir}/libs/javafx-swt.jar"
3761                     into "${graphicsProject.buildDir}/${platformPrefix}module-lib"
3762                 }
3763             }
3764 
3765             // javafx.packager libraries and executable
3766 
3767             // Copy over the javapackager libs
3768             copy {
3769                 from "modules/fxpackager/build/libs"
3770                 into "${packagerProject.buildDir}/${platformPrefix}module-lib"
3771             }
3772 
3773             // Copy over the javapackager executable
3774             if (t.name == "win" || t.name == "linux" || t.name == "mac") {
3775                 copy {
3776                     from "modules/fxpackager/build/javapackager"
3777                     into "${packagerProject.buildDir}/${platformPrefix}module-bin"
3778                 }
3779             }
3780 
3781         }
3782     }
3783     buildModulesTask.dependsOn(buildModuleLibsTask)


< prev index next >