./build.gradle
Print this page
*** 669,681 ****
--- 669,685 ----
// a common name for the hosted build (for use when building apps)
// and a unique name for cross builds.
if (rootProject.defaultHostTarget.equals(t.name)) {
// use a simple common default for the "host" build
targetProperties.sdkDirName="sdk"
+ targetProperties.exportDirName="export"
+ targetProperties.bundleDirName="bundles"
} else {
// and a more complex one for cross builds
targetProperties.sdkDirName="${t.name}-sdk"
+ targetProperties.exportDirName="${t.name}-export"
+ targetProperties.bundleDirName="${t.name}-bundles"
}
}
/******************************************************************************
* *
*** 2805,2824 ****
}
// TODO: consider moving the "public-sdk" portion of this task here
task publicExports() {
doFirst {
! if (!IS_BUILD_JAVADOC) {
fail("publicExports task requires: -PBUILD_JAVADOC=true")
}
}
dependsOn(sdk)
- doLast {
- if (!BUILD_CLOSED) {
- println "publicExports task is only run for a closed build"
- }
- }
}
task perf() {
dependsOn(sdk,apps)
doLast {
--- 2809,2823 ----
}
// TODO: consider moving the "public-sdk" portion of this task here
task publicExports() {
doFirst {
! if (BUILD_CLOSED && !IS_BUILD_JAVADOC) {
fail("publicExports task requires: -PBUILD_JAVADOC=true")
}
}
dependsOn(sdk)
}
task perf() {
dependsOn(sdk,apps)
doLast {
*** 2828,2847 ****
}
}
task zips() {
doFirst {
! if (!IS_BUILD_JAVADOC) {
fail("zips task requires: -PBUILD_JAVADOC=true")
}
}
dependsOn(sdk,publicExports,apps,perf)
- doLast {
- if (!BUILD_CLOSED) {
- println "zips task is only run for a closed build"
- }
- }
}
task copySources(type: Copy) {
enabled = IS_BUILD_SRC_ZIP
def projectsToCopy = [
--- 2827,2841 ----
}
}
task zips() {
doFirst {
! if (BUILD_CLOSED && !IS_BUILD_JAVADOC) {
fail("zips task requires: -PBUILD_JAVADOC=true")
}
}
dependsOn(sdk,publicExports,apps,perf)
}
task copySources(type: Copy) {
enabled = IS_BUILD_SRC_ZIP
def projectsToCopy = [
*** 3258,3267 ****
--- 3252,3405 ----
}
}
/******************************************************************************
* *
+ * OpenExport *
+ * *
+ *****************************************************************************/
+
+ task openExport() {
+ if (!BUILD_CLOSED) {
+ publicExports.dependsOn(openExport)
+ }
+ }
+
+ task openZip() {
+ if (!BUILD_CLOSED) {
+ zips.dependsOn(openZip)
+ }
+ }
+
+ compileTargets { t ->
+ def targetProperties = project.ext[t.upper]
+
+ def sdkDir = "${project.buildDir}/${targetProperties.sdkDirName}"
+ def exportDir = "${project.buildDir}/${targetProperties.exportDirName}"
+ def exportSDKDir = "${exportDir}/sdk"
+ def bundleDir = "${project.buildDir}/${targetProperties.bundleDirName}"
+ def jfxrtJar = "$sdkDir/rt/lib/ext/jfxrt.jar"
+
+ def isWindows = false
+ if (IS_WINDOWS && t.name == "win") {
+ isWindows = true
+ }
+
+ def String compressJar = "false"
+ if (targetProperties.containsKey('deploy') &&
+ targetProperties.deploy.containsKey('compressBigJar')) {
+ compressJar = targetProperties.deploy.compressBigJar
+ }
+
+ def exportTask = project.task("openExport$t.capital", group: "Build") {
+ //dependsOn("sdk$t.capital")
+
+ doLast {
+ def exportTmp = "${exportDir}/tmp/classes"
+
+ // delete any old exports dir before rebuilding it
+ file("${exportDir}").deleteDir()
+
+ mkdir "${exportTmp}"
+
+ copy {
+ from "${sdkDir}"
+ into "${exportSDKDir}"
+ exclude '**/jfxrt.jar'
+
+ if (isWindows) {
+ exclude '**/prism_es2.dll'
+ }
+
+ eachFile {details ->
+ if (details.path.startsWith('rt/')) {
+ details.path = 'jre/' + details.path.substring(3);
+ }
+ }
+ }
+
+ copy {
+ from zipTree("${jfxrtJar}")
+ into "${exportTmp}"
+ }
+
+ mkdir "${exportSDKDir}/jre/lib/ext"
+
+ ant.jar(
+ destfile: "${exportSDKDir}/jre/lib/ext/jfxrt.jar",
+ index: true,
+ compress: compressJar
+ ) {
+ delegate.manifest {
+ attribute(name: 'Implementation-Title', value: 'JavaFX.graphics')
+ }
+
+ fileset(dir: "${exportTmp}") {
+ exclude(name:'META-INF/*')
+ exclude(name:'com/sun/javafx/tools/ant/*')
+
+ //-- Obsolete or experimental code --
+ exclude(name:'com/sun/embeddedswing/**')
+ exclude(name:'com/sun/javafx/tk/glass/**')
+ exclude(name:'com/sun/javafx/tk/swing/**')
+ exclude(name:'com/sun/prism/null3d/**')
+ exclude(name:'com/sun/scenario/scenegraph/**')
+ exclude(name:'com/sun/scenario/utils/**')
+ exclude(name:'com/sun/webpane/sg/swing/**')
+ exclude(name:'com/sun/webpane/swing/**')
+ exclude(name:'com/sun/glass/ui/swt/**')
+
+ if (isWindows) {
+ //-- Strip ES2 pipeline on Windows platform only --
+ exclude(name:'com/sun/prism/es2/**')
+ exclude(name:'com/sun/scenario/effect/impl/es2/**')
+ exclude(name:'com/sun/scenario/effect/impl/hw/ogl/**')
+ exclude(name:'com/sun/scenario/effect/impl/j2d/jogl/**')
+ exclude(name:'com/sun/scenario/effect/impl/j2d/rsl/**')
+ }
+
+ if(!targetProperties.includeLens) {
+ exclude(name:'com/sun/glass/ui/lens/**')
+ }
+
+ if(!targetProperties.includeMonocle) {
+ exclude(name:'com/sun/glass/ui/monocle/**')
+ exclude(name:'com/sun/prism/es2/Monocle*')
+ }
+ }
+ } // ant.jar
+
+ // remove {exportTmp}
+ file("${exportTmp}").deleteDir()
+ }
+ }
+
+ def jfxBundle = 'javafx-sdk-overlay.zip'
+
+ def zipTask = project.task("openZip$t.capital", type: Zip, group: "Build") {
+
+ doFirst() {
+ file("${bundleDir}/${jfxBundle}").delete()
+ }
+
+ archiveName = jfxBundle
+ destinationDir = file("$bundleDir")
+ includeEmptyDirs = false
+ from "${exportSDKDir}"
+
+ dependsOn(exportTask)
+ }
+
+ if (!BUILD_CLOSED) {
+ publicExports.dependsOn(exportTask)
+ zips.dependsOn(zipTask)
+ }
+ }
+
+
+ /******************************************************************************
+ * *
* BUILD_CLOSED *
* *
* This next section should remain at the end of the build script. It allows *
* for a "supplemental" gradle file to be used to extend the normal build *
* structure. For example, this is used for passing a supplemental gradle *