< prev index next >

./build.gradle

Print this page
rev 10149 : 8201553: Update FX build to use gradle 4.8
Reviewed-by:


 752     }
 753 } finally {
 754     inStream.close();
 755 }
 756 if (!project.hasProperty("jdkRuntimeVersion")) throw new Exception("Unable to determine the version of Java in JDK_HOME at $JDK_HOME");
 757 
 758 
 759 
 760 // Verify that CONF is something useful
 761 if (CONF != "Release" && CONF != "Debug" && CONF != "DebugNative") {
 762     logger.warn("Unknown configuration CONF='$CONF'. Treating as 'Release'")
 763 }
 764 
 765 // If the number of compile threads is less than 1 then we have a problem!
 766 if (Integer.parseInt(NUM_COMPILE_THREADS.toString()) < 1) {
 767     logger.warn("NUM_COMPILE_THREADS was specified as '$NUM_COMPILE_THREADS' which is less than the minimum value of 1. " +
 768             "Building with a value of 1 instead.")
 769     NUM_COMPILE_THREADS = 1
 770 }
 771 
 772 // Check that Gradle 1.8 is in use.
 773 if (gradle.gradleVersion != "1.8") {
 774     def ver = gradle.gradleVersion.split("[\\.]");
 775     def gradleMajor = Integer.parseInt(ver[0]);
 776     def gradleMinor = Integer.parseInt(ver[1]);
 777     def err = "";
 778     if (gradleMajor == 1) {
 779         if (gradleMinor < 8) {
 780             err = "Gradle version too old: ${gradle.gradleVersion}; must be at least 1.8"
 781         }
 782 
 783         // Blacklisted versions of gradle
 784         if (gradleMinor == 11) {
 785             err = "JavaFX fails to build with Gradle ${gradle.gradleVersion}; supported version is 1.8"
 786         }
 787     }
 788 
 789     if (IS_GRADLE_VERSION_CHECK && err != "") {
 790         fail(err);
 791     }
 792 
 793     logger.warn("*****************************************************************");
 794     logger.warn("Unsupported gradle version $gradle.gradleVersion in use.");
 795     logger.warn("Only version 1.8 is supported. Use this version at your own risk");
 796     if ( err != "") logger.warn(err);
 797     logger.warn("*****************************************************************");
 798 }
 799 
 800 /******************************************************************************
 801  *                                                                            *
 802  *                      Logging of Properties and Settings                    *
 803  *                                                                            *
 804  *  Log some of the settings we've determined. We could log more here, it     *
 805  *  doesn't really hurt.                                                      *
 806  *                                                                            *
 807  *****************************************************************************/
 808 

 809 logger.quiet("OS_NAME: $OS_NAME")
 810 logger.quiet("OS_ARCH: $OS_ARCH")
 811 logger.quiet("JAVA_HOME: $JAVA_HOME")
 812 logger.quiet("JDK_HOME: $JDK_HOME")
 813 logger.quiet("java.runtime.version: ${javaRuntimeVersion}")
 814 logger.quiet("java version: ${javaVersion}")
 815 logger.quiet("java build number: ${javaBuildNumber}")
 816 logger.quiet("jdk.runtime.version: ${jdkRuntimeVersion}")
 817 logger.quiet("jdk version: ${jdkVersion}")
 818 logger.quiet("jdk build number: ${jdkBuildNumber}")
 819 logger.quiet("minimum java build number: ${jfxBuildJdkBuildnumMin}")
 820 logger.quiet("CONF: $CONF")
 821 logger.quiet("NUM_COMPILE_THREADS: $NUM_COMPILE_THREADS")
 822 logger.quiet("COMPILE_TARGETS: $COMPILE_TARGETS")
 823 logger.quiet("COMPILE_FLAGS_FILES: $COMPILE_FLAGS_FILES")
 824 logger.quiet("HUDSON_JOB_NAME: $HUDSON_JOB_NAME")
 825 logger.quiet("HUDSON_BUILD_NUMBER: $HUDSON_BUILD_NUMBER")
 826 logger.quiet("PROMOTED_BUILD_NUMBER: $PROMOTED_BUILD_NUMBER")
 827 logger.quiet("PRODUCT_NAME: $PRODUCT_NAME")
 828 logger.quiet("RAW_VERSION: $RAW_VERSION")


 890         def nativeDir = file("$nativeRootDir/${t.name}")
 891         def headerDir = file("$headerRootDir/${t.name}")
 892 
 893         // If there is not a library clause in the properties, assume it is not wanted
 894         if (!targetProperties.containsKey(name)) {
 895             println("Ignoring native library ${name}. Not defined in ${t.name} project properties");
 896             return
 897         }
 898 
 899         // check for the property disable${name} = true
 900         def String disableKey = "disable${name}"
 901         def boolean disabled = targetProperties.containsKey(disableKey) ? targetProperties.get(disableKey) : false
 902         if (disabled) {
 903             println("Native library ${name} disabled in ${t.name} project properties");
 904             return
 905         }
 906 
 907         def javahTask = project.task("javah${t.capital}${capitalName}", type: JavaHeaderTask, dependsOn: project.classes, group: "Build") {
 908             description = "Generates JNI Headers for ${name} for ${t.name}"
 909             if (properties.javahSource == null) {
 910                 source(project.sourceSets.main.output.classesDir)
 911             } else {
 912                 source(properties.javahSource)
 913             }
 914             if (properties.javahClasspath == null) {
 915                 classpath = project.files(project.sourceSets.main.output.classesDir)
 916                 classpath += project.sourceSets.main.compileClasspath
 917             } else {
 918                 classpath = project.files(properties.javahClasspath)
 919             }
 920             output = headerDir
 921             include(properties.javahInclude)
 922             cleanTask.delete headerDir
 923         }
 924 
 925         def variants = properties.containsKey("variants") ? properties.variants : [""];
 926         variants.each { variant ->
 927             def variantProperties = variant == "" ? properties : properties.get(variant)
 928             def capitalVariant = variant.capitalize()
 929             def ccOutput = variant == "" ? nativeDir : file("$nativeDir/$variant")
 930             def ccTask = project.task("cc${t.capital}$capitalName$capitalVariant", type: CCTask, dependsOn: javahTask, group: "Build") {
 931                 description = "Compiles native sources for ${name} for ${t.name}${capitalVariant != '' ? ' for variant ' + capitalVariant : ''}"
 932                 matches = ".*\\.c|.*\\.cpp|.*\\.m|.*\\.cc"
 933                 headers = headerDir
 934                 output(ccOutput)
 935                 params.addAll(variantProperties.ccFlags)


 961             }
 962         }
 963 
 964         def useLipo = targetProperties.containsKey('useLipo') ? targetProperties.useLipo : false
 965         if (useLipo) {
 966             def lipoTask = project.task("lipo${t.capital}$capitalName", type: LipoTask, dependsOn: javahTask, group: "Build") {
 967                 description = "Creates native fat library for $name for ${t.name}"
 968                 libDir = file("$libRootDir/${t.name}")
 969                 lib = file("$libRootDir/${t.name}/${library(properties.lib)}")
 970             }
 971             nativeTask.dependsOn(lipoTask)
 972         }
 973     }
 974 }
 975 
 976 void addJSL(Project project, String name, String pkg, Closure compile) {
 977     def lowerName = name.toLowerCase()
 978 
 979     def compileCompilers = project.task("compile${name}Compilers", type: JavaCompile, dependsOn: project.compileJava) {
 980         description = "Compile the $name JSL Compilers"
 981         classpath = project.files(project.sourceSets.main.output.classesDir) +
 982                 rootProject.BUILD_SRC +
 983                 project.configurations.antlr3
 984         source = [project.file("src/main/jsl-$lowerName")]
 985         destinationDir = project.file("$project.buildDir/classes/jsl-compilers/$lowerName")
 986     }
 987 
 988     def generateShaders = project.task("generate${name}Shaders", dependsOn: compileCompilers) {
 989         description = "Generate $name shaders from JSL"
 990         def sourceDir = project.file("src/main/jsl-$lowerName")
 991         def destinationDir = project.file("$project.buildDir/generated-src/jsl-$lowerName")
 992         inputs.dir sourceDir
 993         outputs.dir destinationDir
 994         doLast {
 995             compile(sourceDir, destinationDir)
 996         }
 997     }
 998 
 999     project.task("compile${name}JavaShaders", type: JavaCompile, dependsOn: generateShaders) {
1000         description = "Compile the Java $name JSL shaders"
1001         classpath = project.files(project.sourceSets.main.output.classesDir) + rootProject.BUILD_SRC
1002         source = [project.file("$project.buildDir/generated-src/jsl-$lowerName")]
1003         destinationDir = project.file("$project.buildDir/classes/jsl-$lowerName")
1004     }
1005 
1006     def compileHLSLShaders = project.task("compile${name}HLSLShaders", dependsOn: generateShaders, type: CompileHLSLTask) {
1007         enabled = IS_WINDOWS
1008         description = "Compile $name HLSL files into .obj files"
1009         matches = ".*\\.hlsl"
1010         output project.file("$project.buildDir/hlsl/$name/$pkg")
1011         source project.file("$project.buildDir/generated-src/jsl-$lowerName/$pkg")
1012     }
1013 
1014     project.task("process${name}Shaders", dependsOn: [generateShaders, compileHLSLShaders], type: Copy, description: "Copy hlsl / frag shaders to build/resources/jsl-$lowerName") {
1015         from("$project.buildDir/hlsl/$name") {
1016             include "**/*.obj"
1017         }
1018         from("$project.buildDir/generated-src/jsl-$lowerName") {
1019             include("**/*.frag")
1020         }
1021         into "$project.buildDir/resources/jsl-$lowerName"


1444     // addition to these steps, the clean task is created. Note that I didn't bother to create
1445     // a new task for each of the decora files, preferring instead just to create a rule?? Also
1446     // need "clean" tasks for each compile task.
1447 
1448     addJSL(project, "Decora", "com/sun/scenario/effect/impl/hw/d3d/hlsl") { sourceDir, destinationDir ->
1449         [[fileName: "ColorAdjust", generator: "CompileJSL", outputs: "-all"],
1450          [fileName: "Brightpass", generator: "CompileJSL", outputs: "-all"],
1451          [fileName: "SepiaTone", generator: "CompileJSL", outputs: "-all"],
1452          [fileName: "PerspectiveTransform", generator: "CompileJSL", outputs: "-all"],
1453          [fileName: "DisplacementMap", generator: "CompileJSL", outputs: "-all"],
1454          [fileName: "InvertMask", generator: "CompileJSL", outputs: "-all"],
1455          [fileName: "Blend", generator: "CompileBlend", outputs: "-all"],
1456          [fileName: "PhongLighting", generator: "CompilePhong", outputs: "-all"],
1457          [fileName: "LinearConvolve", generator: "CompileLinearConvolve", outputs: "-hw"],
1458          [fileName: "LinearConvolveShadow", generator: "CompileLinearConvolve", outputs: "-hw"]].each { settings ->
1459             javaexec {
1460                 executable = JAVA
1461                 workingDir = "modules/graphics"
1462                 main = settings.generator
1463                 classpath = configurations.compile + configurations.antlr3
1464                 classpath += files("$buildDir/classes/main")
1465                 classpath += files("$buildDir/classes/jsl-compilers/decora")
1466                 args = ["-i", sourceDir, "-o", destinationDir, "-t", "-pkg", "com/sun/scenario/effect", "$settings.outputs", "$settings.fileName"]
1467                 jvmArgs "-Djava.ext.dirs="
1468             }
1469         }
1470     }
1471 
1472     task generateDecoraNativeHeaders(type: JavaHeaderTask, dependsOn: compileDecoraJavaShaders) {
1473         description = "Generates JNI Headers for Decora SSE Natives"
1474         source file("$buildDir/classes/jsl-decora")
1475         source file("$buildDir/classes/main")
1476         include("com/sun/scenario/effect/impl/sw/sse/*");
1477         classpath = files("$buildDir/classes/main", "$buildDir/classes/jsl-decora")
1478         output = file("$buildDir/generated-src/headers/jsl-decora")
1479     }
1480 
1481     task nativeDecora(dependsOn: compileDecoraHLSLShaders, group: "Build") {
1482         description = "Generates JNI headers, compiles, and builds native dynamic library for Decora"
1483     }
1484     task cleanNativeDecora(type: Delete, group: "Build") {
1485         description = "Clean native objects for Decora"
1486     }
1487 
1488     def headerDir = file("$buildDir/generated-src/headers/jsl-decora")
1489     def nativeRootDir = project.file("$project.buildDir/native/jsl-decora")
1490     def libRootDir = project.file("$project.buildDir/libs/jsl-decora")
1491     // For each compile target, create cc and link tasks
1492     compileTargets { t ->
1493         def target = t.name
1494         def upperTarget = t.upper
1495         def capitalTarget = t.capital
1496         def targetProperties = rootProject.ext[upperTarget];
1497         def library = targetProperties.library


1552                 executable = JAVA
1553                 workingDir = "modules/graphics"
1554                 main = "CompileJSL"
1555                 classpath = configurations.compile + configurations.antlr3
1556                 classpath += files("$buildDir/classes/jsl-compilers/prism", "modules/graphics/src/main/jsl-prism") // for the .stg
1557                 args = ["-i", sourceDir, "-o", destinationDir, "-t", "-pkg", "com/sun/prism", "-d3d", "-es2", "-name", "$file"]
1558                 jvmArgs "-Djava.ext.dirs="
1559             }
1560         }
1561     }
1562 
1563     classes.dependsOn compilePrismJavaShaders;
1564     nativePrism.dependsOn compilePrismHLSLShaders;
1565 
1566     project.nativeAllTask.dependsOn nativeDecora
1567     project.cleanNativeAllTask.dependsOn cleanNativeDecora
1568     assemble.dependsOn nativeDecora
1569     processResources.dependsOn processDecoraShaders, processPrismShaders
1570 
1571     test {
1572         def cssDir = file("$buildDir/classes/main/javafx")
1573         jvmArgs "-Djava.ext.dirs=", "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit",
1574             "-DCSS_META_DATA_TEST_DIR=$cssDir"
1575         enableAssertions = true
1576         testLogging.exceptionFormat = "full"
1577         scanForTestClasses = false
1578         include "**/*Test.*"
1579         if (BUILD_CLOSED && DO_JCOV) {
1580             addJCov(project, test)
1581         }
1582     }
1583 
1584     // To enable the IDEs to all be happy (no red squiggles) we need to have the libraries
1585     // available in some known location. Maybe in the future the Gradle plugins to each
1586     // of the IDEs will be good enough that we won't need this hack anymore.
1587     classes << {

1588         // Copy all of the download libraries to the libs directory for the sake of the IDEs
1589         File libsDir = rootProject.file("build/libs");
1590 
1591         // In some IDEs (Eclipse for example), touching these libraries cauese a full build
1592         // within the IDE.  When gradle is used outside of the IDE, for example to build the
1593         // native code, a full rebuild is caused within the IDE.  The fix is to check for the
1594         // lib directory and not copy the files
1595         //
1596         // This means that in order to update the dependent libraries for the IDE's, a clean
1597         // build is required
1598         //
1599         if (libsDir.exists()) return;
1600         libsDir.mkdirs();
1601         for (File f : [configurations.compile.files, configurations.antlr3.files].flatten()) {
1602             copy {
1603                 into libsDir
1604                 from f.getParentFile()
1605                 include "**/antlr-3.1.3.jar"
1606                 include "**/stringtemplate-3.2.jar"
1607                 include "**/antlr-runtime-3.1.3.jar"
1608                 includeEmptyDirs = false
1609             }
1610             // Have to rename the swt jar because it is some platform specific name but
1611             // for the sake of the IDEs we need to have a single stable name that works
1612             // on every platform
1613             copy {
1614                 into libsDir
1615                 from f.getParentFile()
1616                 include "**/*swt*.jar"
1617                 includeEmptyDirs = false
1618                 rename ".*swt.*jar", "swt-debug\\.jar"
1619             }
1620         }
1621     }

1622 }
1623 
1624 project(":controls") {
1625     dependencies {
1626         compile BUILD_SRC, project(":base"), project(":graphics")
1627         // TODO not sure how to specify this? processResources project(":base"), project(":graphics")
1628         testCompile project(":graphics").sourceSets.test.output
1629         testCompile project(":base").sourceSets.test.output
1630     }
1631 
1632     test {
1633         def cssDir = file("$buildDir/classes/main/javafx")
1634         jvmArgs "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit",
1635             "-DCSS_META_DATA_TEST_DIR=$cssDir"
1636     }
1637 
1638     // TODO Css2Bin really should be moved out and put into buildSrc if it can be
1639     // TODO could change script to dynamically locate all .css files and create bss for them, probably better
1640     // TODO also not sure there is any benefit to having css files in the jfxrt.jar at all
1641     processResources << {

1642         ["$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian.css",
1643         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css",
1644         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded-qvga.css",
1645         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded.css",
1646         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/fxvk.css",
1647         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/highcontrast.css",
1648         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena.css",
1649         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css",
1650         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/touch.css"].each { css ->
1651             javaexec {
1652                 executable = JAVA
1653                 workingDir = "modules/controls"
1654                 classpath files("$buildDir/classes/main",
1655                         project(":graphics").sourceSets.main.output,
1656                         project(":base").sourceSets.main.output)
1657                 main = "com.sun.javafx.css.parser.Css2Bin"
1658                 args css
1659                 jvmArgs "-Djava.ext.dirs="
1660             }
1661         }
1662     }

1663 }
1664 
1665 project(":extensions") {
1666     dependencies {
1667         compile BUILD_SRC, project(":base"), project(":graphics")
1668     }
1669 }
1670 
1671 project(":swing") {
1672     /* should not be built, but needed in builders and JMX
1673     tasks.all {
1674         if (!COMPILE_SWING) it.enabled = false
1675     }
1676     */
1677     dependencies {
1678         compile BUILD_SRC, project(":base"), project(":graphics")
1679     }
1680     test {
1681         enabled = IS_FULL_TEST && IS_AWT_TEST
1682     }


1821         if (IS_MAC) exclude "**/ja_JP.UTF-8/**"
1822     }
1823     processResources.dependsOn man
1824 
1825     // Compile the native launchers. These are included in ant-javafx.jar.
1826     if (IS_WINDOWS && COMPILE_FXPACKAGER) {
1827         task buildWinLauncher(type: CCTask, group: "Build") {
1828             description = "Compiles native sources for the application co-bundle launcher";
1829             matches = "WinLauncher\\.cpp";
1830             params.addAll(WIN.launcher.ccFlags);
1831             output(file("$buildDir/native/WinLauncher"));
1832             source(file("src/main/native/launcher/win"));
1833             compiler = WIN.launcher.compiler
1834             exe = true;
1835             linkerOptions.addAll(WIN.launcher.linkFlags);
1836             doLast {
1837                 copy {
1838                     from "$buildDir/native/WinLauncher/WinLauncher.exe"
1839                     from "$MSVCR"
1840                     from "$MSVCP"
1841                     into "$buildDir/classes/main/com/oracle/tools/packager/windows"
1842                 }
1843             }
1844         }
1845         task compileWinLibrary(type: CCTask, group: "Build") {
1846             description = "Compiles native sources for the application co-bundle launcher library";
1847             matches = ".*\\.cpp"
1848             source(file("src/main/native/library/common"));
1849             params.addAll(WIN.launcherlibrary.ccFlags)
1850             output(file("$buildDir/native/WinLauncher/obj"));
1851             compiler = WIN.launcherlibrary.compiler
1852         }
1853         task linkWinLibrary(type: LinkTask, group: "Build", dependsOn: compileWinLibrary) {
1854             description = "Links native sources for the application co-bundle launcher library";
1855             objectDir = file("$buildDir/native/WinLauncher/obj")
1856             linkParams.addAll(WIN.launcherlibrary.linkFlags);
1857             lib = file("$buildDir/native/WinLauncher/packager.dll")
1858             linker = WIN.launcherlibrary.linker
1859             doLast {
1860                 copy {
1861                     from "$buildDir/native/WinLauncher/packager.dll"
1862                     into "$buildDir/classes/main/com/oracle/tools/packager/windows"
1863                 }
1864             }
1865         }
1866         task buildWinLauncherSvc(type: CCTask, group: "Build") {
1867             description = "Compiles native sources for the application co-bundle launcher";
1868             matches = "WinLauncherSvc\\.cpp";
1869             params.addAll(WIN.launcher.ccFlags);
1870             output(file("$buildDir/native/WinLauncherSvc"));
1871             source(file("src/main/native/service/win"));
1872             compiler = WIN.launcher.compiler
1873             exe = true;
1874             linkerOptions.addAll(WIN.launcher.linkFlags);
1875             doLast {
1876                 copy {
1877                     from "$buildDir/native/WinLauncherSvc/WinLauncherSvc.exe"
1878                     into "$buildDir/classes/main/com/oracle/tools/packager/windows"
1879                 }
1880             }
1881         }
1882         task buildIconSwap(type: CCTask, group: "Build") {
1883             description = "Compiles native sources for the application co-bundle launcher"
1884             matches = "IconSwap\\.cpp"
1885             params.addAll(WIN.iconLauncher.ccFlags)
1886             output(file("$buildDir/native/IconSwap"))
1887             source file("src/main/native/tools/win")
1888             compiler = WIN.launcher.compiler
1889             exe = true
1890             linkerOptions.addAll(WIN.iconLauncher.linkFlags)
1891             doLast {
1892                 copy {
1893                     from "$buildDir/native/IconSwap/IconSwap.exe"
1894                     into "$buildDir/classes/main/com/oracle/tools/packager/windows"
1895                 }
1896             }
1897         }
1898         task compileLauncher(dependsOn: [buildWinLauncher, linkWinLibrary, buildWinLauncherSvc, buildIconSwap])
1899         jar.dependsOn compileLauncher;
1900     } else if (IS_MAC && COMPILE_FXPACKAGER) {
1901         task buildMacLauncher(type: CCTask, group: "Build") {
1902             description = "Compiles native sources for the application co-bundle launcher"
1903             matches = ".*\\.m"
1904             source file("src/main/native/launcher/mac")
1905             params.addAll(MAC.launcher.ccFlags)
1906             compiler = MAC.launcher.compiler
1907             output(file("$buildDir/classes/main/com/oracle/tools/packager/mac"))
1908             eachOutputFile = { f ->
1909                 return new File(f.getParent(), "JavaAppLauncher")
1910             }
1911         }
1912         task compileMacLibrary(type: CCTask, group: "Build") {
1913             description = "Compiles native sources for the application co-bundle launcher library"
1914             matches = ".*\\.cpp|.*\\.mm"
1915             source file("src/main/native/library/common");
1916             params.addAll(MAC.launcherlibrary.ccFlags)
1917             compiler = MAC.launcherlibrary.compiler
1918             output(file("$buildDir/native/maclauncher/obj"))
1919         }
1920         task linkMacLibrary(type: LinkTask, group: "Build", dependsOn: compileMacLibrary) {
1921             description = "Links native sources for the application co-bundle launcher library"
1922             objectDir = file("$buildDir/native/maclauncher/obj")
1923             linkParams.addAll(MAC.launcherlibrary.linkFlags)
1924             linker = MAC.launcherlibrary.linker
1925             lib = file("$buildDir/classes/main/com/oracle/tools/packager/mac/libpackager.dylib")
1926         }
1927         task compileLauncher(dependsOn: [buildMacLauncher, linkMacLibrary])
1928         jar.dependsOn compileLauncher;
1929     } else if (IS_LINUX && COMPILE_FXPACKAGER) {
1930         task compileLinuxLauncher(type: CCTask, group: "Build") {
1931             description = "Compiles native sources for the application co-bundle launcher"
1932             matches = ".*\\.cpp"
1933             source file("src/main/native/launcher/linux")
1934             params.addAll(LINUX.launcher.ccFlags)
1935             compiler = LINUX.launcher.compiler
1936             output(file("$buildDir/native/linuxlauncher/launcherobj"))
1937         }
1938         task linkLinuxLauncher(type: LinkTask, dependsOn: compileLinuxLauncher, group: "Build") {
1939             description = "Links native dynamic library for the application co-bundle launcher"
1940             objectDir = file("$buildDir/native/linuxlauncher/launcherobj")
1941             linkParams.addAll(LINUX.launcher.linkFlags)
1942             linker = LINUX.launcher.linker
1943             lib = file("$buildDir/classes/main/com/oracle/tools/packager/linux/JavaAppLauncher")
1944         }
1945         task compileLinuxLibrary(type: CCTask, group: "Build") {
1946             description = "Compiles native sources for the application co-bundle launcher library"
1947             matches = ".*\\.cpp"
1948             source file("src/main/native/library/common")
1949             params.addAll(LINUX.launcherlibrary.ccFlags)
1950             compiler = LINUX.launcherlibrary.compiler
1951             output(file("$buildDir/native/linuxlauncher/obj"))
1952         }
1953         task linkLinuxLibrary(type: LinkTask, dependsOn: compileLinuxLibrary, group: "Build") {
1954             description = "Links native dynamic library for the application co-bundle launcher library"
1955             objectDir = file("$buildDir/native/linuxlauncher/obj")
1956             linkParams.addAll(LINUX.launcherlibrary.linkFlags)
1957             linker = LINUX.launcherlibrary.linker
1958             lib = file("$buildDir/classes/main/com/oracle/tools/packager/linux/libpackager.so")
1959         }
1960         task compileLauncher(dependsOn: [linkLinuxLauncher, linkLinuxLibrary])
1961         jar.dependsOn compileLauncher;
1962     }
1963 
1964     // Builds the javapackager executable. For everything other than windows,
1965     // this is simply moving the existing shell script and ensuring it has proper
1966     // permissions. For Windows, this includes compiling the native executable
1967     if (IS_WINDOWS && COMPILE_FXPACKAGER){
1968         task buildJavaPackager(type: CCTask, group: "Build") {
1969             description = "Compiles native sources for javapackager.exe"
1970             matches = "javapackager\\.cpp"
1971             params.addAll(WIN.fxpackager.ccFlags)
1972             compiler = WIN.fxpackager.compiler
1973             output(file("$buildDir/native/javapackager"))
1974             source WIN.fxpackager.nativeSource
1975             doFirst {
1976                 copy {
1977                     mkdir "$buildDir/native"
1978                     mkdir "$buildDir/native/javapackager"


2028                 copy {
2029                     from "src/main/native/javapackager/shell"
2030                     into "$buildDir/javapackager"
2031                     fileMode = 0755
2032                 }
2033                 copy {
2034                     from "src/main/native/javapackager/shell"
2035                     into "$buildDir/javapackager"
2036                     rename ('javapackager', 'javafxpackager')
2037                     fileMode = 0755
2038                 }
2039             }
2040         }
2041     }
2042 
2043     task packagerJar(type: Jar) {
2044         group = "Basic"
2045         description = "Creates the packager.jar"
2046         archiveName = "packager.jar";
2047         includeEmptyDirs = false
2048         from("$buildDir/classes/main");
2049         from("$buildDir/resources/main");
2050         include('jdk/packager/**')
2051 
2052         dependsOn(buildJavaPackager);
2053     }
2054 
2055     jar.dependsOn buildJavaPackager
2056     jar.dependsOn packagerJar
2057 
2058     classes << {

2059         // Copy all of the download libraries to libs directory for the sake of the IDEs
2060         File libsDir = rootProject.file("build/libs");
2061         File antLib = new File(libsDir, "ant-1.8.2.jar")
2062         libsDir.mkdirs();
2063         for (File f : configurations.compile.files) {
2064             copy {
2065                 into libsDir
2066                 from f.getParentFile()
2067                 include "**/ant-1.8.2.jar"
2068                 includeEmptyDirs = false
2069             }
2070         }
2071     }

2072 
2073     task packagerFakeJar(type: Jar) {
2074         dependsOn compileTestJava
2075         from compileTestJava.destinationDir
2076         include "hello/**"
2077 
2078         destinationDir project.file("build/tmp/tests/appResources")
2079         archiveName "mainApp.jar"
2080 
2081         manifest {
2082             attributes(
2083                     "Main-Class": "hello.HelloRectangle",
2084                     "Custom-Attribute": " Is it stripped?"
2085             )
2086         }
2087 
2088         doFirst {
2089             copy {
2090                 from "$projectDir/src/main/resources/com/oracle/tools/packager/linux/javalogo_white_48.png"
2091                 from "$projectDir/src/main/resources/com/oracle/tools/packager/mac/GenericAppHiDPI.icns"


2365                                              "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
2366                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
2367                                              "SUFFIX=-ffmpeg", IS_64 ? "ARCH=x64" : "ARCH=x32")
2368                                     }
2369                                 }
2370                             }
2371                         } else {
2372                             // Building fxavcodec plugin (libav plugin)
2373                             exec {
2374                                 commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
2375                                 args("CC=${mediaProperties.compiler}", "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
2376                                      "BASE_NAME=avplugin", IS_64 ? "ARCH=x64" : "ARCH=x32")
2377                             }
2378                         }
2379                     }
2380                 }
2381                 buildNative.dependsOn buildAVPlugin
2382             }
2383 
2384             if (t.name == "win") {
2385                 def buildResources = task("buildResources") << {

2386                     def rcOutputDir = "${nativeOutputDir}/${buildType}"
2387                     mkdir rcOutputDir
2388                     exec {
2389                         environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2390                         commandLine (WIN.media.rcCompiler)
2391                         args(WIN.media.glibRcFlags)
2392                         args("/Fo${rcOutputDir}/${WIN.media.glibRcFile}", WIN.media.rcSource)
2393                     }
2394 
2395                     exec {
2396                         environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2397                         commandLine (WIN.media.rcCompiler)
2398                         args(WIN.media.gstreamerRcFlags)
2399                         args("/Fo${rcOutputDir}/${WIN.media.gstreamerRcFile}", WIN.media.rcSource)
2400                     }
2401 
2402                     exec {
2403                         environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2404                         commandLine (WIN.media.rcCompiler)
2405                         args(WIN.media.fxpluginsRcFlags)
2406                         args("/Fo${rcOutputDir}/${WIN.media.fxpluginsRcFile}", WIN.media.rcSource)
2407                     }
2408 
2409                     exec {
2410                         environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2411                         commandLine (WIN.media.rcCompiler)
2412                         args(WIN.media.jfxmediaRcFlags)
2413                         args("/Fo${rcOutputDir}/${WIN.media.jfxmediaRcFile}", WIN.media.rcSource)
2414                     }
2415                 }

2416 
2417                 def buildGlib = task("build${t.capital}Glib", dependsOn: [buildResources]) {
2418                     enabled = IS_COMPILE_MEDIA
2419                     doLast {
2420                         exec {
2421                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2422                             commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
2423                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite",
2424                                  IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.glibRcFile}")
2425                         }
2426                     }
2427                 }
2428                 buildGStreamer.dependsOn buildGlib
2429 
2430             } else if (t.name == "mac") {
2431                 def buildGlib = task("build${t.capital}Glib") {
2432                     enabled = IS_COMPILE_MEDIA
2433                     doLast {
2434                         exec {
2435                             commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/libffi")


2494             include "**/archive-*.*"
2495         }
2496         archiveName = "webArchiveJar.jar"
2497         destinationDir = file("$buildDir/testing/resources")
2498     }
2499 
2500     test {
2501         // Run web tests in headless mode
2502         systemProperty 'glass.platform', 'Monocle'
2503         systemProperty 'monocle.platform', 'Headless'
2504         systemProperty 'prism.order', 'sw'
2505         dependsOn webArchiveJar
2506         def testResourceDir = file("$buildDir/testing/resources")
2507         jvmArgs "-DWEB_ARCHIVE_JAR_TEST_DIR=$testResourceDir"
2508     }
2509 
2510     sourceSets.main.java.srcDirs += "src/main/native/Source/WebCore/bindings/java/dom3/java"
2511 
2512     task generateHeaders(dependsOn: compileJava) {
2513         doLast {
2514             def classpath = files("$buildDir/classes/main",
2515                                   project(":graphics").sourceSets.main.output.classesDir)
2516             def dest = file("$buildDir/generated-src/headers");
2517             mkdir dest;
2518             exec {
2519                 commandLine("$JAVAH", "-J-Djava.ext.dirs=", "-d", "$dest",
2520                             "-classpath", "${classpath.asPath}");
2521                 args("com.sun.webkit.ContextMenu",
2522                      "com.sun.webkit.ContextMenuItem",
2523                      "com.sun.webkit.CursorManager",
2524                      "com.sun.webkit.PageCache",
2525                      "com.sun.webkit.PopupMenu",
2526                      "com.sun.webkit.SharedBuffer",
2527                      "com.sun.webkit.WebPage",
2528                      "com.sun.webkit.LoadListenerClient",
2529                      "com.sun.webkit.event.WCFocusEvent",
2530                      "com.sun.webkit.event.WCKeyEvent",
2531                      "com.sun.webkit.event.WCMouseEvent",
2532                      "com.sun.webkit.event.WCMouseWheelEvent",
2533                      "com.sun.webkit.graphics.GraphicsDecoder",
2534                      "com.sun.webkit.graphics.RenderMediaControls",
2535                      "com.sun.webkit.graphics.RenderTheme",


2550                      "com.sun.webkit.text.TextBreakIterator",
2551                      "com.sun.webkit.text.TextNormalizer");
2552             }
2553         }
2554     }
2555 
2556     task compileNative()
2557 
2558     compileTargets { t ->
2559         def targetProperties = project.rootProject.ext[t.upper]
2560         def webkitProperties = targetProperties.webkit
2561         def classifier = (t.name != "linux" && t.name != "win") ? t.name :
2562                           IS_64 ? "${t.name}-amd64" : "${t.name}-i586"
2563 
2564         def webkitOutputDir = cygpath("$buildDir/${t.name}")
2565         def webkitConfig = IS_DEBUG_NATIVE ? "Debug" : "Release"
2566 
2567         File nativeBuildDir = new File("${webkitOutputDir}")
2568         nativeBuildDir.mkdirs()
2569 
2570         def compileNativeTask = task("compileNative${t.capital}", dependsOn: generateHeaders) << {

2571             println "Building Webkit configuration /$webkitConfig/ into $webkitOutputDir"
2572 
2573             exec {
2574                 workingDir("$webkitOutputDir")
2575                 commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/set-webkit-configuration", "--$webkitConfig")
2576                 environment(["WEBKIT_OUTPUTDIR" : webkitOutputDir])
2577             }
2578 
2579             exec {
2580                 workingDir("$projectDir/src/main/native")
2581                 def cmakeArgs = "-DENABLE_TOOLS=1"
2582                 if (t.name == "win") {
2583                     String parfaitPath = IS_COMPILE_PARFAIT ? System.getenv().get("PARFAIT_PATH") + ";" : "";
2584                     Map environmentSettings = new HashMap(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2585                     environmentSettings["PATH"] = parfaitPath + "$WINDOWS_VS_PATH"
2586                     /* To build with ICU:
2587                     1. Download http://javaweb.us.oracle.com/jcg/fx-webrevs/RT-17164/WebKitLibrariesICU.zip
2588                     and unzip it to WebKitLibraries folder.
2589                     2. Copy DLLs from
2590                     WebKitLibrariesICU.zip\WebKitLibraries\import\runtime


2633                 }
2634 
2635                 cmakeArgs += " -DJAVAFX_RELEASE_VERSION=8.0"
2636                 commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/build-webkit",
2637                     "--java", "--icu-unicode", targetCpuBitDepthSwitch,
2638                     "--cmakeargs=${cmakeArgs}")
2639             }
2640 
2641             // Cmake places Windows DLL in bin directory
2642             def dllDir = IS_WINDOWS ? "bin" : "lib"
2643             def library = rootProject.ext[t.upper].library
2644             copy {
2645                 from "$webkitOutputDir/$webkitConfig/$dllDir/${library('jfxwebkit')}"
2646                 into "$buildDir/libs/${t.name}"
2647             }
2648             copy {
2649                 from "$webkitOutputDir/$webkitConfig/$dllDir/${library('DumpRenderTreeJava')}"
2650                 into "$buildDir/test/${t.name}"
2651             }
2652         }

2653 
2654         compileNative.dependsOn compileNativeTask
2655 
2656         if (IS_WINDOWS && t.name == "win") {
2657             def rcTask = project.task("rc${t.capital}", type: CompileResourceTask) {
2658                 compiler = webkitProperties.rcCompiler
2659                 source(webkitProperties.rcSource)
2660                 if (webkitProperties.rcFlags) {
2661                     rcParams.addAll(webkitProperties.rcFlags)
2662                 }
2663                 output(file("$webkitOutputDir/$webkitConfig/WebCore/obj"))
2664             }
2665             compileNativeTask.dependsOn rcTask
2666         }
2667 
2668         if (!targetProperties.compileWebnodeNative) {
2669             println("Not compiling native Webkit for ${t.name} per configuration request");
2670             compileNativeTask.enabled = false
2671         }
2672     }
2673 
2674     def drtClasses = "com/sun/javafx/webkit/drt/**"
2675     jar.exclude(drtClasses)
2676     task drtJar(type: Jar, dependsOn: compileJava) {
2677         archiveName = "drt.jar"
2678         destinationDir = file("$buildDir/test")
2679         from "$buildDir/classes/main"
2680         include drtClasses
2681     }
2682     if (IS_COMPILE_WEBKIT) {
2683         jar.dependsOn compileNative, drtJar
2684     }
2685 }
2686 
2687 allprojects {
2688     // The following block is a workaround for the fact that presently Gradle
2689     // can't set the -XDignore.symbol.file flag, because it appears that the
2690     // javac API is lacking support for it. So what we'll do is find any Compile
2691     // task and manually provide the options necessary to fire up the
2692     // compiler with the right settings.
2693     //
2694     // Also, we need to remove jfxrt.jar from the ext classpath (if it is there)
2695     tasks.withType(JavaCompile) { compile ->
2696         if (compile.options.hasProperty("useAnt")) {
2697             compile.options.useAnt = true
2698             compile.options.useDepend = IS_USE_DEPEND
2699         } else if (compile.options.hasProperty("incremental")) {


2911 
2912 compileTargets { t ->
2913     def targetProperties = project.ext[t.upper]
2914     def sdkDirName = targetProperties.sdkDirName
2915     def library = targetProperties.library
2916     // The jfxrt task is responsible for creating the jfxrt.jar. A developer may
2917     // have multiple SDK's on their system at any one time, depending on which
2918     // cross compiles they have done. For example, I might have:
2919     //      build/ios-sdk/rt/lib/ext/jfxrt.jar
2920     //      build/armhf-sdk/rt/lib/ext/jfxrt.jar
2921     // and so forth. The default host build will always install into 'sdk'
2922     // allowing for uses where a known sdk path is needed (like IDEs)
2923     //      build/sdk/rt/lib/ext/jfxrt.jar
2924     // This arrangement allows for multiple independent SDKs to
2925     // exist on a developer's system.
2926     def jfxrtTask = task("jfxrt$t.capital", type: Jar) {
2927         group = "Basic"
2928         description = "Creates the jfxrt.jar for the $t.name target"
2929         archiveName = "build/${sdkDirName}/rt/lib/ext/jfxrt.jar";
2930         includeEmptyDirs = false
2931         from("modules/base/build/classes/main",
2932              "modules/base/build/resources/main",
2933              "modules/builders/build/classes/main",
2934              "modules/graphics/build/classes/main",
2935              "modules/graphics/build/resources/main",
2936              "modules/controls/build/classes/main",
2937              "modules/controls/build/resources/main",
2938              "modules/fxml/build/classes/main",
2939              "modules/fxml/build/resources/main",
2940              "modules/graphics/build/classes/jsl-decora",
2941              "modules/graphics/build/resources/jsl-decora",
2942              "modules/graphics/build/classes/jsl-prism",
2943              "modules/graphics/build/resources/jsl-prism",
2944              "modules/media/build/classes/main",
2945              "modules/media/build/resources/main")
2946         if (COMPILE_SWING) from ("modules/swing/build/classes/main", "modules/swing/build/resources/main")
2947 
2948         if (!IS_MAC) {
2949             exclude ("modules/media/build/classes/main/com/sun/media/jfxmediaimpl/platform/osx/**",
2950                      "com/sun/prism/es2/MacGL*",
2951                      "com/sun/glass/events/mac",
2952                      "com/sun/glass/ui/mac",
2953                      "com/sun/prism/es2/gl/mac"
2954                      )
2955         }
2956         if (!IS_WINDOWS) {
2957             exclude ("**/*.hlsl",
2958                      "com/sun/glass/ui/win",
2959                      "com/sun/prism/d3d",
2960                      "com/sun/prism/es2/gl/win",
2961                      "com/sun/prism/es2/WinGL*",
2962                      "com/sun/scenario/effect/impl/hw/d3d"
2963                      )
2964         }
2965         if (!targetProperties.includeGTK) { //usually IS_LINUX
2966             exclude (
2967                      "com/sun/glass/ui/gtk",
2968                      "com/sun/prism/es2/EGL*",
2969                      "com/sun/prism/es2/gl/eglfb",


2972                      "com/sun/prism/es2/X11GL*"
2973                      )
2974         }
2975         if (!targetProperties.includeEGL) {
2976             exclude ("com/sun/prism/es2/EGL*")
2977         }
2978         if (!targetProperties.includeLens) {
2979             exclude ("com/sun/glass/ui/lens")
2980         }
2981         /* Note: Monocle is used in the test harness, and so should
2982          * not be excluded until the deploy phase
2983         if (!targetProperties.includeMonocle) {
2984             exclude ("com/sun/glass/ui/monocle")
2985         }
2986         */
2987         if (!targetProperties.includeNull3d) {
2988             // "com/sun/prism/null3d", // TODO This is used in dev builds but not the final sdk
2989             exclude ("com/sun/prism/null3d")
2990         }
2991         if (t.name != 'ios') {
2992             exclude ("modules/media/build/classes/main/com/sun/media/jfxmediaimpl/platform/ios/**",
2993                      "com/sun/glass/ui/ios",
2994                      "com/sun/prism/es2/IOS*"
2995                      )
2996         }
2997         if (t.name != 'android' && t.name != 'dalvik') {
2998             exclude ("com/sun/glass/ui/android/*")
2999         }
3000 
3001         if (t.name == 'android') {
3002             from ("modules/web/build/classes/android",
3003                   "modules/web/build/resources/android",
3004                   "modules/controls/build/classes/android",
3005                   "modules/controls/build/resources/android")
3006         } else if (t.name == 'ios') {
3007             from ("modules/web/build/classes/ios",
3008                   "modules/web/build/resources/ios",
3009                   "modules/extensions/build/classes/ios")
3010         } else {
3011             from ("modules/web/build/classes/main", "modules/web/build/resources/main")
3012         }
3013 
3014         exclude("**/javafx/embed/swt/**")
3015 
3016         if (!targetProperties.includeSWT) {
3017             exclude("com/sun/glass/ui/swt")
3018         }
3019 
3020         if (!targetProperties.includeSwing) {
3021             exclude("javafx/embed/swing")
3022         }
3023         exclude("js/**/*", // er...
3024                 "PrismLoaderBackend*", // More decora stuff
3025                 "**/*.stg",    // any glue files for decora must be excluded
3026                 "**/*.java",   // Builder java files are in build/classes and should be excluded
3027                 "com/sun/javafx/webkit/drt"); // Drt class
3028 
3029         // Filter out platform specific Java sources (glass) when compiling for other targets
3030         if (targetProperties.containsKey('jfxrtJarExcludes')) {
3031             exclude(targetProperties.jfxrtJarExcludes)
3032         }
3033 
3034         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
3035     }
3036     def jfxrtIndexTask = task("jfxrtIndex$t.capital") {
3037         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
3038         dependsOn(jfxrtTask)
3039 
3040         doLast() {
3041             ant.jar (update: true, index: true, destfile: jfxrtTask.archiveName)
3042         }
3043     }
3044     jfxrt.dependsOn(jfxrtIndexTask)
3045 
3046     def jfxswtTask = task("jfxswt$t.capital", type: Jar) {
3047         enabled = COMPILE_SWT
3048         group = "Basic"
3049         description = "Creates the jfxswt.jar for the $t.name target"
3050         archiveName = "build/${sdkDirName}/rt/lib/jfxswt.jar";
3051         includeEmptyDirs = false
3052         from("modules/swt/build/classes/main");
3053         from("modules/builders/build/classes/main");
3054         include("**/javafx/embed/swt/**")
3055         exclude("**/*.java");  // Builder java files are in build/classes and should be excluded
3056 
3057         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
3058     }
3059     def jfxswtIndexTask = task("jfxswtIndex$t.capital") {
3060         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
3061         dependsOn(jfxswtTask)
3062 
3063         doLast() {
3064             ant.jar (update: true, index: true, destfile: jfxswtTask.archiveName)
3065         }
3066     }
3067     jfxrt.dependsOn(jfxswtIndexTask)
3068 
3069     def jmxTask = task ("jmx${t.capital}", type: Jar) {
3070         group = "Basic"
3071         description = "Creates the javafx-mx.jar"
3072         archiveName = "build/${sdkDirName}/lib/javafx-mx.jar";
3073         includeEmptyDirs = false
3074         from "modules/jmx/build/classes/main"
3075         from "modules/jmx/build/resources/main"
3076         dependsOn project(":jmx").assemble
3077     }
3078 
3079     // The 'sdk' task will build the rest of the SDK, and depends on the 'jfxrtTask' task. After
3080     // executing this task the sdk bundle for the current COMPILE_TARGETS will be fully created.
3081     def sdkTask = task("sdk$t.capital") {
3082         group = "Basic"
3083         description = "Creates the SDK for $t.name"
3084         doLast {
3085             // TODO instead of using copy everywhere, I probably want to use "sync" instead?
3086             // Copy all of the .dll / .so / .dylib native libraries into build/sdk/rt/lib/
3087             copy {
3088                 def useLipo = targetProperties.containsKey('useLipo') ? targetProperties.useLipo : false
3089                 from("modules/graphics/build/libs/jsl-decora/${t.name}/${library(targetProperties.decora.lib)}")
3090                 def libs = ['font', 'prism', 'prismSW', 'prismES2', 'glass', 'iio']
3091                 if (IS_COMPILE_PANGO) {
3092                     libs += ['fontFreetype', 'fontPango'];
3093                 }
3094                 libs.each { lib ->


3231 }
3232 
3233     //task integrationCheck {
3234     //    group = "Basic"
3235     //    description = "Performs all the tasks necessary to ensure that the current build is ready for integration."
3236     //    dependsOn sdk
3237     //    dependsOn subprojects.collect { project -> project.getTasksByName("check", true)}
3238     //}
3239 
3240 /*
3241  * This clause changes the way we handle a build.gradle within ./apps
3242  * It does a few things:
3243  *   modifies the classpath used to include the built runttime classes
3244  *   provides for copying the build applications to the artifacts tree
3245  *
3246  * The applications to be built will be under ./apps, but also must
3247  * be listed in the applications listed in the setting variable: JFXApplications
3248  */
3249 ext.JFXRT_CP =
3250     files(
3251         project(":base").sourceSets.main.output.classesDir,
3252         project(":graphics").sourceSets.main.output.classesDir,
3253         project(":controls").sourceSets.main.output.classesDir,
3254         project(":fxml").sourceSets.main.output.classesDir,
3255         project(":swing").sourceSets.main.output.classesDir, //NOTE - used by 3Dviewer
3256         project(":builders").sourceSets.main.output.classesDir,
3257             "modules/media/build/classes/main",
3258             "modules/web/build/classes/main",
3259     )
3260 
3261 project(":apps") {
3262     // The apps build is Ant based, and gradle lets us "import" ant build.xml
3263     // into our configuration.
3264 
3265     ant.importBuild 'build.xml'
3266 
3267     // Download the Lucene libraries needed for the Ensemble8 app
3268     def luceneVersion = "7.4.0"
3269     getConfigurations().create("lucene");
3270     dependencies {
3271         lucene group: "org.apache.lucene", name: "lucene-core", version: luceneVersion
3272         lucene group: "org.apache.lucene", name: "lucene-grouping", version: luceneVersion
3273         lucene group: "org.apache.lucene", name: "lucene-queryparser", version: luceneVersion
3274     }
3275 
3276     // Copy Lucene libraries into the Ensemble8/lib directory
3277     File ensembleLibDir = rootProject.file("apps/samples/Ensemble8/lib");
3278     def libNames = [ "lucene-core-${luceneVersion}.jar",




 752     }
 753 } finally {
 754     inStream.close();
 755 }
 756 if (!project.hasProperty("jdkRuntimeVersion")) throw new Exception("Unable to determine the version of Java in JDK_HOME at $JDK_HOME");
 757 
 758 
 759 
 760 // Verify that CONF is something useful
 761 if (CONF != "Release" && CONF != "Debug" && CONF != "DebugNative") {
 762     logger.warn("Unknown configuration CONF='$CONF'. Treating as 'Release'")
 763 }
 764 
 765 // If the number of compile threads is less than 1 then we have a problem!
 766 if (Integer.parseInt(NUM_COMPILE_THREADS.toString()) < 1) {
 767     logger.warn("NUM_COMPILE_THREADS was specified as '$NUM_COMPILE_THREADS' which is less than the minimum value of 1. " +
 768             "Building with a value of 1 instead.")
 769     NUM_COMPILE_THREADS = 1
 770 }
 771 
 772 // Check for Gradle 4.8, error if < 4.8.
 773 if (gradle.gradleVersion != "4.8") {
 774     def ver = gradle.gradleVersion.split("[\\.]");
 775     def gradleMajor = Integer.parseInt(ver[0]);
 776     def gradleMinor = Integer.parseInt(ver[1].split("[^0-9]")[0]);
 777     def err = "";
 778     if (gradleMajor < 4 || (gradleMajor == 4 && gradleMinor < 8)) {
 779         err = "Gradle version too old: ${gradle.gradleVersion}; must be at least 4.8"







 780     }
 781 
 782     if (IS_GRADLE_VERSION_CHECK && err != "") {
 783         fail(err);
 784     }
 785 
 786     logger.warn("*****************************************************************");
 787     logger.warn("Unsupported gradle version $gradle.gradleVersion in use.");
 788     logger.warn("Only version 4.8 is supported. Use this version at your own risk");
 789     if ( err != "") logger.warn(err);
 790     logger.warn("*****************************************************************");
 791 }
 792 
 793 /******************************************************************************
 794  *                                                                            *
 795  *                      Logging of Properties and Settings                    *
 796  *                                                                            *
 797  *  Log some of the settings we've determined. We could log more here, it     *
 798  *  doesn't really hurt.                                                      *
 799  *                                                                            *
 800  *****************************************************************************/
 801 
 802 logger.quiet("gradle.gradleVersion: $gradle.gradleVersion")
 803 logger.quiet("OS_NAME: $OS_NAME")
 804 logger.quiet("OS_ARCH: $OS_ARCH")
 805 logger.quiet("JAVA_HOME: $JAVA_HOME")
 806 logger.quiet("JDK_HOME: $JDK_HOME")
 807 logger.quiet("java.runtime.version: ${javaRuntimeVersion}")
 808 logger.quiet("java version: ${javaVersion}")
 809 logger.quiet("java build number: ${javaBuildNumber}")
 810 logger.quiet("jdk.runtime.version: ${jdkRuntimeVersion}")
 811 logger.quiet("jdk version: ${jdkVersion}")
 812 logger.quiet("jdk build number: ${jdkBuildNumber}")
 813 logger.quiet("minimum java build number: ${jfxBuildJdkBuildnumMin}")
 814 logger.quiet("CONF: $CONF")
 815 logger.quiet("NUM_COMPILE_THREADS: $NUM_COMPILE_THREADS")
 816 logger.quiet("COMPILE_TARGETS: $COMPILE_TARGETS")
 817 logger.quiet("COMPILE_FLAGS_FILES: $COMPILE_FLAGS_FILES")
 818 logger.quiet("HUDSON_JOB_NAME: $HUDSON_JOB_NAME")
 819 logger.quiet("HUDSON_BUILD_NUMBER: $HUDSON_BUILD_NUMBER")
 820 logger.quiet("PROMOTED_BUILD_NUMBER: $PROMOTED_BUILD_NUMBER")
 821 logger.quiet("PRODUCT_NAME: $PRODUCT_NAME")
 822 logger.quiet("RAW_VERSION: $RAW_VERSION")


 884         def nativeDir = file("$nativeRootDir/${t.name}")
 885         def headerDir = file("$headerRootDir/${t.name}")
 886 
 887         // If there is not a library clause in the properties, assume it is not wanted
 888         if (!targetProperties.containsKey(name)) {
 889             println("Ignoring native library ${name}. Not defined in ${t.name} project properties");
 890             return
 891         }
 892 
 893         // check for the property disable${name} = true
 894         def String disableKey = "disable${name}"
 895         def boolean disabled = targetProperties.containsKey(disableKey) ? targetProperties.get(disableKey) : false
 896         if (disabled) {
 897             println("Native library ${name} disabled in ${t.name} project properties");
 898             return
 899         }
 900 
 901         def javahTask = project.task("javah${t.capital}${capitalName}", type: JavaHeaderTask, dependsOn: project.classes, group: "Build") {
 902             description = "Generates JNI Headers for ${name} for ${t.name}"
 903             if (properties.javahSource == null) {
 904                 source(project.sourceSets.main.java.outputDir)
 905             } else {
 906                 source(properties.javahSource)
 907             }
 908             if (properties.javahClasspath == null) {
 909                 classpath = project.files(project.sourceSets.main.java.outputDir)
 910                 classpath += project.sourceSets.main.compileClasspath
 911             } else {
 912                 classpath = project.files(properties.javahClasspath)
 913             }
 914             output = headerDir
 915             include(properties.javahInclude)
 916             cleanTask.delete headerDir
 917         }
 918 
 919         def variants = properties.containsKey("variants") ? properties.variants : [""];
 920         variants.each { variant ->
 921             def variantProperties = variant == "" ? properties : properties.get(variant)
 922             def capitalVariant = variant.capitalize()
 923             def ccOutput = variant == "" ? nativeDir : file("$nativeDir/$variant")
 924             def ccTask = project.task("cc${t.capital}$capitalName$capitalVariant", type: CCTask, dependsOn: javahTask, group: "Build") {
 925                 description = "Compiles native sources for ${name} for ${t.name}${capitalVariant != '' ? ' for variant ' + capitalVariant : ''}"
 926                 matches = ".*\\.c|.*\\.cpp|.*\\.m|.*\\.cc"
 927                 headers = headerDir
 928                 output(ccOutput)
 929                 params.addAll(variantProperties.ccFlags)


 955             }
 956         }
 957 
 958         def useLipo = targetProperties.containsKey('useLipo') ? targetProperties.useLipo : false
 959         if (useLipo) {
 960             def lipoTask = project.task("lipo${t.capital}$capitalName", type: LipoTask, dependsOn: javahTask, group: "Build") {
 961                 description = "Creates native fat library for $name for ${t.name}"
 962                 libDir = file("$libRootDir/${t.name}")
 963                 lib = file("$libRootDir/${t.name}/${library(properties.lib)}")
 964             }
 965             nativeTask.dependsOn(lipoTask)
 966         }
 967     }
 968 }
 969 
 970 void addJSL(Project project, String name, String pkg, Closure compile) {
 971     def lowerName = name.toLowerCase()
 972 
 973     def compileCompilers = project.task("compile${name}Compilers", type: JavaCompile, dependsOn: project.compileJava) {
 974         description = "Compile the $name JSL Compilers"
 975         classpath = project.files(project.sourceSets.main.java.outputDir) +
 976                 rootProject.BUILD_SRC +
 977                 project.configurations.antlr3
 978         source = [project.file("src/main/jsl-$lowerName")]
 979         destinationDir = project.file("$project.buildDir/classes/jsl-compilers/$lowerName")
 980     }
 981 
 982     def generateShaders = project.task("generate${name}Shaders", dependsOn: compileCompilers) {
 983         description = "Generate $name shaders from JSL"
 984         def sourceDir = project.file("src/main/jsl-$lowerName")
 985         def destinationDir = project.file("$project.buildDir/generated-src/jsl-$lowerName")
 986         inputs.dir sourceDir
 987         outputs.dir destinationDir
 988         doLast {
 989             compile(sourceDir, destinationDir)
 990         }
 991     }
 992 
 993     project.task("compile${name}JavaShaders", type: JavaCompile, dependsOn: generateShaders) {
 994         description = "Compile the Java $name JSL shaders"
 995         classpath = project.files(project.sourceSets.main.java.outputDir) + rootProject.BUILD_SRC
 996         source = [project.file("$project.buildDir/generated-src/jsl-$lowerName")]
 997         destinationDir = project.file("$project.buildDir/classes/jsl-$lowerName")
 998     }
 999 
1000     def compileHLSLShaders = project.task("compile${name}HLSLShaders", dependsOn: generateShaders, type: CompileHLSLTask) {
1001         enabled = IS_WINDOWS
1002         description = "Compile $name HLSL files into .obj files"
1003         matches = ".*\\.hlsl"
1004         output project.file("$project.buildDir/hlsl/$name/$pkg")
1005         source project.file("$project.buildDir/generated-src/jsl-$lowerName/$pkg")
1006     }
1007 
1008     project.task("process${name}Shaders", dependsOn: [generateShaders, compileHLSLShaders], type: Copy, description: "Copy hlsl / frag shaders to build/resources/jsl-$lowerName") {
1009         from("$project.buildDir/hlsl/$name") {
1010             include "**/*.obj"
1011         }
1012         from("$project.buildDir/generated-src/jsl-$lowerName") {
1013             include("**/*.frag")
1014         }
1015         into "$project.buildDir/resources/jsl-$lowerName"


1438     // addition to these steps, the clean task is created. Note that I didn't bother to create
1439     // a new task for each of the decora files, preferring instead just to create a rule?? Also
1440     // need "clean" tasks for each compile task.
1441 
1442     addJSL(project, "Decora", "com/sun/scenario/effect/impl/hw/d3d/hlsl") { sourceDir, destinationDir ->
1443         [[fileName: "ColorAdjust", generator: "CompileJSL", outputs: "-all"],
1444          [fileName: "Brightpass", generator: "CompileJSL", outputs: "-all"],
1445          [fileName: "SepiaTone", generator: "CompileJSL", outputs: "-all"],
1446          [fileName: "PerspectiveTransform", generator: "CompileJSL", outputs: "-all"],
1447          [fileName: "DisplacementMap", generator: "CompileJSL", outputs: "-all"],
1448          [fileName: "InvertMask", generator: "CompileJSL", outputs: "-all"],
1449          [fileName: "Blend", generator: "CompileBlend", outputs: "-all"],
1450          [fileName: "PhongLighting", generator: "CompilePhong", outputs: "-all"],
1451          [fileName: "LinearConvolve", generator: "CompileLinearConvolve", outputs: "-hw"],
1452          [fileName: "LinearConvolveShadow", generator: "CompileLinearConvolve", outputs: "-hw"]].each { settings ->
1453             javaexec {
1454                 executable = JAVA
1455                 workingDir = "modules/graphics"
1456                 main = settings.generator
1457                 classpath = configurations.compile + configurations.antlr3
1458                 classpath += files("$buildDir/classes/java/main")
1459                 classpath += files("$buildDir/classes/jsl-compilers/decora")
1460                 args = ["-i", sourceDir, "-o", destinationDir, "-t", "-pkg", "com/sun/scenario/effect", "$settings.outputs", "$settings.fileName"]
1461                 jvmArgs "-Djava.ext.dirs="
1462             }
1463         }
1464     }
1465 
1466     task generateDecoraNativeHeaders(type: JavaHeaderTask, dependsOn: compileDecoraJavaShaders) {
1467         description = "Generates JNI Headers for Decora SSE Natives"
1468         source file("$buildDir/classes/jsl-decora")
1469         source file("$buildDir/classes/java/main")
1470         include("com/sun/scenario/effect/impl/sw/sse/*");
1471         classpath = files("$buildDir/classes/java/main", "$buildDir/classes/jsl-decora")
1472         output = file("$buildDir/generated-src/headers/jsl-decora")
1473     }
1474 
1475     task nativeDecora(dependsOn: compileDecoraHLSLShaders, group: "Build") {
1476         description = "Generates JNI headers, compiles, and builds native dynamic library for Decora"
1477     }
1478     task cleanNativeDecora(type: Delete, group: "Build") {
1479         description = "Clean native objects for Decora"
1480     }
1481 
1482     def headerDir = file("$buildDir/generated-src/headers/jsl-decora")
1483     def nativeRootDir = project.file("$project.buildDir/native/jsl-decora")
1484     def libRootDir = project.file("$project.buildDir/libs/jsl-decora")
1485     // For each compile target, create cc and link tasks
1486     compileTargets { t ->
1487         def target = t.name
1488         def upperTarget = t.upper
1489         def capitalTarget = t.capital
1490         def targetProperties = rootProject.ext[upperTarget];
1491         def library = targetProperties.library


1546                 executable = JAVA
1547                 workingDir = "modules/graphics"
1548                 main = "CompileJSL"
1549                 classpath = configurations.compile + configurations.antlr3
1550                 classpath += files("$buildDir/classes/jsl-compilers/prism", "modules/graphics/src/main/jsl-prism") // for the .stg
1551                 args = ["-i", sourceDir, "-o", destinationDir, "-t", "-pkg", "com/sun/prism", "-d3d", "-es2", "-name", "$file"]
1552                 jvmArgs "-Djava.ext.dirs="
1553             }
1554         }
1555     }
1556 
1557     classes.dependsOn compilePrismJavaShaders;
1558     nativePrism.dependsOn compilePrismHLSLShaders;
1559 
1560     project.nativeAllTask.dependsOn nativeDecora
1561     project.cleanNativeAllTask.dependsOn cleanNativeDecora
1562     assemble.dependsOn nativeDecora
1563     processResources.dependsOn processDecoraShaders, processPrismShaders
1564 
1565     test {
1566         def cssDir = file("$buildDir/classes/java/main/javafx")
1567         jvmArgs "-Djava.ext.dirs=", "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit",
1568             "-DCSS_META_DATA_TEST_DIR=$cssDir"
1569         enableAssertions = true
1570         testLogging.exceptionFormat = "full"
1571         scanForTestClasses = false
1572         include "**/*Test.*"
1573         if (BUILD_CLOSED && DO_JCOV) {
1574             addJCov(project, test)
1575         }
1576     }
1577 
1578     // To enable the IDEs to all be happy (no red squiggles) we need to have the libraries
1579     // available in some known location. Maybe in the future the Gradle plugins to each
1580     // of the IDEs will be good enough that we won't need this hack anymore.
1581     classes {
1582         doLast {
1583             // Copy all of the download libraries to the libs directory for the sake of the IDEs
1584             File libsDir = rootProject.file("build/libs");
1585 
1586             // In some IDEs (Eclipse for example), touching these libraries cauese a full build
1587             // within the IDE.  When gradle is used outside of the IDE, for example to build the
1588             // native code, a full rebuild is caused within the IDE.  The fix is to check for the
1589             // lib directory and not copy the files
1590             //
1591             // This means that in order to update the dependent libraries for the IDE's, a clean
1592             // build is required
1593             //
1594             if (libsDir.exists()) return;
1595             libsDir.mkdirs();
1596             for (File f : [configurations.compile.files, configurations.antlr3.files].flatten()) {
1597                 copy {
1598                     into libsDir
1599                     from f.getParentFile()
1600                     include "**/antlr-3.1.3.jar"
1601                     include "**/stringtemplate-3.2.jar"
1602                     include "**/antlr-runtime-3.1.3.jar"
1603                     includeEmptyDirs = false
1604                 }
1605                 // Have to rename the swt jar because it is some platform specific name but
1606                 // for the sake of the IDEs we need to have a single stable name that works
1607                 // on every platform
1608                 copy {
1609                     into libsDir
1610                     from f.getParentFile()
1611                     include "**/*swt*.jar"
1612                     includeEmptyDirs = false
1613                     rename ".*swt.*jar", "swt-debug\\.jar"
1614                 }
1615             }
1616         }
1617     }
1618 }
1619 
1620 project(":controls") {
1621     dependencies {
1622         compile BUILD_SRC, project(":base"), project(":graphics")
1623         // TODO not sure how to specify this? processResources project(":base"), project(":graphics")
1624         testCompile project(":graphics").sourceSets.test.output
1625         testCompile project(":base").sourceSets.test.output
1626     }
1627 
1628     test {
1629         def cssDir = file("$buildDir/classes/java/main/javafx")
1630         jvmArgs "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit",
1631             "-DCSS_META_DATA_TEST_DIR=$cssDir"
1632     }
1633 
1634     // TODO Css2Bin really should be moved out and put into buildSrc if it can be
1635     // TODO could change script to dynamically locate all .css files and create bss for them, probably better
1636     // TODO also not sure there is any benefit to having css files in the jfxrt.jar at all
1637     processResources {
1638         doLast {
1639             ["$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian.css",
1640             "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css",
1641             "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded-qvga.css",
1642             "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded.css",
1643             "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/fxvk.css",
1644             "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/highcontrast.css",
1645             "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena.css",
1646             "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css",
1647             "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/touch.css"].each { css ->
1648                 javaexec {
1649                     executable = JAVA
1650                     workingDir = "modules/controls"
1651                     classpath files("$buildDir/classes/java/main",
1652                             project(":graphics").sourceSets.main.output,
1653                             project(":base").sourceSets.main.output)
1654                     main = "com.sun.javafx.css.parser.Css2Bin"
1655                     args css
1656                     jvmArgs "-Djava.ext.dirs="
1657                 }
1658             }
1659         }
1660     }
1661 }
1662 
1663 project(":extensions") {
1664     dependencies {
1665         compile BUILD_SRC, project(":base"), project(":graphics")
1666     }
1667 }
1668 
1669 project(":swing") {
1670     /* should not be built, but needed in builders and JMX
1671     tasks.all {
1672         if (!COMPILE_SWING) it.enabled = false
1673     }
1674     */
1675     dependencies {
1676         compile BUILD_SRC, project(":base"), project(":graphics")
1677     }
1678     test {
1679         enabled = IS_FULL_TEST && IS_AWT_TEST
1680     }


1819         if (IS_MAC) exclude "**/ja_JP.UTF-8/**"
1820     }
1821     processResources.dependsOn man
1822 
1823     // Compile the native launchers. These are included in ant-javafx.jar.
1824     if (IS_WINDOWS && COMPILE_FXPACKAGER) {
1825         task buildWinLauncher(type: CCTask, group: "Build") {
1826             description = "Compiles native sources for the application co-bundle launcher";
1827             matches = "WinLauncher\\.cpp";
1828             params.addAll(WIN.launcher.ccFlags);
1829             output(file("$buildDir/native/WinLauncher"));
1830             source(file("src/main/native/launcher/win"));
1831             compiler = WIN.launcher.compiler
1832             exe = true;
1833             linkerOptions.addAll(WIN.launcher.linkFlags);
1834             doLast {
1835                 copy {
1836                     from "$buildDir/native/WinLauncher/WinLauncher.exe"
1837                     from "$MSVCR"
1838                     from "$MSVCP"
1839                     into "$buildDir/classes/java/main/com/oracle/tools/packager/windows"
1840                 }
1841             }
1842         }
1843         task compileWinLibrary(type: CCTask, group: "Build") {
1844             description = "Compiles native sources for the application co-bundle launcher library";
1845             matches = ".*\\.cpp"
1846             source(file("src/main/native/library/common"));
1847             params.addAll(WIN.launcherlibrary.ccFlags)
1848             output(file("$buildDir/native/WinLauncher/obj"));
1849             compiler = WIN.launcherlibrary.compiler
1850         }
1851         task linkWinLibrary(type: LinkTask, group: "Build", dependsOn: compileWinLibrary) {
1852             description = "Links native sources for the application co-bundle launcher library";
1853             objectDir = file("$buildDir/native/WinLauncher/obj")
1854             linkParams.addAll(WIN.launcherlibrary.linkFlags);
1855             lib = file("$buildDir/native/WinLauncher/packager.dll")
1856             linker = WIN.launcherlibrary.linker
1857             doLast {
1858                 copy {
1859                     from "$buildDir/native/WinLauncher/packager.dll"
1860                     into "$buildDir/classes/java/main/com/oracle/tools/packager/windows"
1861                 }
1862             }
1863         }
1864         task buildWinLauncherSvc(type: CCTask, group: "Build") {
1865             description = "Compiles native sources for the application co-bundle launcher";
1866             matches = "WinLauncherSvc\\.cpp";
1867             params.addAll(WIN.launcher.ccFlags);
1868             output(file("$buildDir/native/WinLauncherSvc"));
1869             source(file("src/main/native/service/win"));
1870             compiler = WIN.launcher.compiler
1871             exe = true;
1872             linkerOptions.addAll(WIN.launcher.linkFlags);
1873             doLast {
1874                 copy {
1875                     from "$buildDir/native/WinLauncherSvc/WinLauncherSvc.exe"
1876                     into "$buildDir/classes/java/main/com/oracle/tools/packager/windows"
1877                 }
1878             }
1879         }
1880         task buildIconSwap(type: CCTask, group: "Build") {
1881             description = "Compiles native sources for the application co-bundle launcher"
1882             matches = "IconSwap\\.cpp"
1883             params.addAll(WIN.iconLauncher.ccFlags)
1884             output(file("$buildDir/native/IconSwap"))
1885             source file("src/main/native/tools/win")
1886             compiler = WIN.launcher.compiler
1887             exe = true
1888             linkerOptions.addAll(WIN.iconLauncher.linkFlags)
1889             doLast {
1890                 copy {
1891                     from "$buildDir/native/IconSwap/IconSwap.exe"
1892                     into "$buildDir/classes/java/main/com/oracle/tools/packager/windows"
1893                 }
1894             }
1895         }
1896         task compileLauncher(dependsOn: [buildWinLauncher, linkWinLibrary, buildWinLauncherSvc, buildIconSwap])
1897         jar.dependsOn compileLauncher;
1898     } else if (IS_MAC && COMPILE_FXPACKAGER) {
1899         task buildMacLauncher(type: CCTask, group: "Build") {
1900             description = "Compiles native sources for the application co-bundle launcher"
1901             matches = ".*\\.m"
1902             source file("src/main/native/launcher/mac")
1903             params.addAll(MAC.launcher.ccFlags)
1904             compiler = MAC.launcher.compiler
1905             output(file("$buildDir/classes/java/main/com/oracle/tools/packager/mac"))
1906             eachOutputFile = { f ->
1907                 return new File(f.getParent(), "JavaAppLauncher")
1908             }
1909         }
1910         task compileMacLibrary(type: CCTask, group: "Build") {
1911             description = "Compiles native sources for the application co-bundle launcher library"
1912             matches = ".*\\.cpp|.*\\.mm"
1913             source file("src/main/native/library/common");
1914             params.addAll(MAC.launcherlibrary.ccFlags)
1915             compiler = MAC.launcherlibrary.compiler
1916             output(file("$buildDir/native/maclauncher/obj"))
1917         }
1918         task linkMacLibrary(type: LinkTask, group: "Build", dependsOn: compileMacLibrary) {
1919             description = "Links native sources for the application co-bundle launcher library"
1920             objectDir = file("$buildDir/native/maclauncher/obj")
1921             linkParams.addAll(MAC.launcherlibrary.linkFlags)
1922             linker = MAC.launcherlibrary.linker
1923             lib = file("$buildDir/classes/java/main/com/oracle/tools/packager/mac/libpackager.dylib")
1924         }
1925         task compileLauncher(dependsOn: [buildMacLauncher, linkMacLibrary])
1926         jar.dependsOn compileLauncher;
1927     } else if (IS_LINUX && COMPILE_FXPACKAGER) {
1928         task compileLinuxLauncher(type: CCTask, group: "Build") {
1929             description = "Compiles native sources for the application co-bundle launcher"
1930             matches = ".*\\.cpp"
1931             source file("src/main/native/launcher/linux")
1932             params.addAll(LINUX.launcher.ccFlags)
1933             compiler = LINUX.launcher.compiler
1934             output(file("$buildDir/native/linuxlauncher/launcherobj"))
1935         }
1936         task linkLinuxLauncher(type: LinkTask, dependsOn: compileLinuxLauncher, group: "Build") {
1937             description = "Links native dynamic library for the application co-bundle launcher"
1938             objectDir = file("$buildDir/native/linuxlauncher/launcherobj")
1939             linkParams.addAll(LINUX.launcher.linkFlags)
1940             linker = LINUX.launcher.linker
1941             lib = file("$buildDir/classes/java/main/com/oracle/tools/packager/linux/JavaAppLauncher")
1942         }
1943         task compileLinuxLibrary(type: CCTask, group: "Build") {
1944             description = "Compiles native sources for the application co-bundle launcher library"
1945             matches = ".*\\.cpp"
1946             source file("src/main/native/library/common")
1947             params.addAll(LINUX.launcherlibrary.ccFlags)
1948             compiler = LINUX.launcherlibrary.compiler
1949             output(file("$buildDir/native/linuxlauncher/obj"))
1950         }
1951         task linkLinuxLibrary(type: LinkTask, dependsOn: compileLinuxLibrary, group: "Build") {
1952             description = "Links native dynamic library for the application co-bundle launcher library"
1953             objectDir = file("$buildDir/native/linuxlauncher/obj")
1954             linkParams.addAll(LINUX.launcherlibrary.linkFlags)
1955             linker = LINUX.launcherlibrary.linker
1956             lib = file("$buildDir/classes/java/main/com/oracle/tools/packager/linux/libpackager.so")
1957         }
1958         task compileLauncher(dependsOn: [linkLinuxLauncher, linkLinuxLibrary])
1959         jar.dependsOn compileLauncher;
1960     }
1961 
1962     // Builds the javapackager executable. For everything other than windows,
1963     // this is simply moving the existing shell script and ensuring it has proper
1964     // permissions. For Windows, this includes compiling the native executable
1965     if (IS_WINDOWS && COMPILE_FXPACKAGER){
1966         task buildJavaPackager(type: CCTask, group: "Build") {
1967             description = "Compiles native sources for javapackager.exe"
1968             matches = "javapackager\\.cpp"
1969             params.addAll(WIN.fxpackager.ccFlags)
1970             compiler = WIN.fxpackager.compiler
1971             output(file("$buildDir/native/javapackager"))
1972             source WIN.fxpackager.nativeSource
1973             doFirst {
1974                 copy {
1975                     mkdir "$buildDir/native"
1976                     mkdir "$buildDir/native/javapackager"


2026                 copy {
2027                     from "src/main/native/javapackager/shell"
2028                     into "$buildDir/javapackager"
2029                     fileMode = 0755
2030                 }
2031                 copy {
2032                     from "src/main/native/javapackager/shell"
2033                     into "$buildDir/javapackager"
2034                     rename ('javapackager', 'javafxpackager')
2035                     fileMode = 0755
2036                 }
2037             }
2038         }
2039     }
2040 
2041     task packagerJar(type: Jar) {
2042         group = "Basic"
2043         description = "Creates the packager.jar"
2044         archiveName = "packager.jar";
2045         includeEmptyDirs = false
2046         from("$buildDir/classes/java/main");
2047         from("$buildDir/resources/main");
2048         include('jdk/packager/**')
2049 
2050         dependsOn(buildJavaPackager);
2051     }
2052 
2053     jar.dependsOn buildJavaPackager
2054     jar.dependsOn packagerJar
2055 
2056     classes {
2057         doLast {
2058             // Copy all of the download libraries to libs directory for the sake of the IDEs
2059             File libsDir = rootProject.file("build/libs");
2060             File antLib = new File(libsDir, "ant-1.8.2.jar")
2061             libsDir.mkdirs();
2062             for (File f : configurations.compile.files) {
2063                 copy {
2064                     into libsDir
2065                     from f.getParentFile()
2066                     include "**/ant-1.8.2.jar"
2067                     includeEmptyDirs = false
2068                 }
2069             }
2070         }
2071     }
2072 
2073     task packagerFakeJar(type: Jar) {
2074         dependsOn compileTestJava
2075         from compileTestJava.destinationDir
2076         include "hello/**"
2077 
2078         destinationDir project.file("build/tmp/tests/appResources")
2079         archiveName "mainApp.jar"
2080 
2081         manifest {
2082             attributes(
2083                     "Main-Class": "hello.HelloRectangle",
2084                     "Custom-Attribute": " Is it stripped?"
2085             )
2086         }
2087 
2088         doFirst {
2089             copy {
2090                 from "$projectDir/src/main/resources/com/oracle/tools/packager/linux/javalogo_white_48.png"
2091                 from "$projectDir/src/main/resources/com/oracle/tools/packager/mac/GenericAppHiDPI.icns"


2365                                              "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
2366                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
2367                                              "SUFFIX=-ffmpeg", IS_64 ? "ARCH=x64" : "ARCH=x32")
2368                                     }
2369                                 }
2370                             }
2371                         } else {
2372                             // Building fxavcodec plugin (libav plugin)
2373                             exec {
2374                                 commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
2375                                 args("CC=${mediaProperties.compiler}", "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
2376                                      "BASE_NAME=avplugin", IS_64 ? "ARCH=x64" : "ARCH=x32")
2377                             }
2378                         }
2379                     }
2380                 }
2381                 buildNative.dependsOn buildAVPlugin
2382             }
2383 
2384             if (t.name == "win") {
2385                 def buildResources = task("buildResources") {
2386                     doLast {
2387                         def rcOutputDir = "${nativeOutputDir}/${buildType}"
2388                         mkdir rcOutputDir
2389                         exec {
2390                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2391                             commandLine (WIN.media.rcCompiler)
2392                             args(WIN.media.glibRcFlags)
2393                             args("/Fo${rcOutputDir}/${WIN.media.glibRcFile}", WIN.media.rcSource)
2394                         }
2395 
2396                         exec {
2397                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2398                             commandLine (WIN.media.rcCompiler)
2399                             args(WIN.media.gstreamerRcFlags)
2400                             args("/Fo${rcOutputDir}/${WIN.media.gstreamerRcFile}", WIN.media.rcSource)
2401                         }
2402 
2403                         exec {
2404                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2405                             commandLine (WIN.media.rcCompiler)
2406                             args(WIN.media.fxpluginsRcFlags)
2407                             args("/Fo${rcOutputDir}/${WIN.media.fxpluginsRcFile}", WIN.media.rcSource)
2408                         }
2409 
2410                         exec {
2411                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2412                             commandLine (WIN.media.rcCompiler)
2413                             args(WIN.media.jfxmediaRcFlags)
2414                             args("/Fo${rcOutputDir}/${WIN.media.jfxmediaRcFile}", WIN.media.rcSource)
2415                         }
2416                     }
2417                 }
2418 
2419                 def buildGlib = task("build${t.capital}Glib", dependsOn: [buildResources]) {
2420                     enabled = IS_COMPILE_MEDIA
2421                     doLast {
2422                         exec {
2423                             environment(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2424                             commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/glib-lite")
2425                             args("OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}", "BASE_NAME=glib-lite",
2426                                  IS_64 ? "ARCH=x64" : "ARCH=x32", "RESOURCE=${nativeOutputDir}/${buildType}/${WIN.media.glibRcFile}")
2427                         }
2428                     }
2429                 }
2430                 buildGStreamer.dependsOn buildGlib
2431 
2432             } else if (t.name == "mac") {
2433                 def buildGlib = task("build${t.capital}Glib") {
2434                     enabled = IS_COMPILE_MEDIA
2435                     doLast {
2436                         exec {
2437                             commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/${projectDir}/libffi")


2496             include "**/archive-*.*"
2497         }
2498         archiveName = "webArchiveJar.jar"
2499         destinationDir = file("$buildDir/testing/resources")
2500     }
2501 
2502     test {
2503         // Run web tests in headless mode
2504         systemProperty 'glass.platform', 'Monocle'
2505         systemProperty 'monocle.platform', 'Headless'
2506         systemProperty 'prism.order', 'sw'
2507         dependsOn webArchiveJar
2508         def testResourceDir = file("$buildDir/testing/resources")
2509         jvmArgs "-DWEB_ARCHIVE_JAR_TEST_DIR=$testResourceDir"
2510     }
2511 
2512     sourceSets.main.java.srcDirs += "src/main/native/Source/WebCore/bindings/java/dom3/java"
2513 
2514     task generateHeaders(dependsOn: compileJava) {
2515         doLast {
2516             def classpath = files("$buildDir/classes/java/main",
2517                                   project(":graphics").sourceSets.main.java.outputDir)
2518             def dest = file("$buildDir/generated-src/headers");
2519             mkdir dest;
2520             exec {
2521                 commandLine("$JAVAH", "-J-Djava.ext.dirs=", "-d", "$dest",
2522                             "-classpath", "${classpath.asPath}");
2523                 args("com.sun.webkit.ContextMenu",
2524                      "com.sun.webkit.ContextMenuItem",
2525                      "com.sun.webkit.CursorManager",
2526                      "com.sun.webkit.PageCache",
2527                      "com.sun.webkit.PopupMenu",
2528                      "com.sun.webkit.SharedBuffer",
2529                      "com.sun.webkit.WebPage",
2530                      "com.sun.webkit.LoadListenerClient",
2531                      "com.sun.webkit.event.WCFocusEvent",
2532                      "com.sun.webkit.event.WCKeyEvent",
2533                      "com.sun.webkit.event.WCMouseEvent",
2534                      "com.sun.webkit.event.WCMouseWheelEvent",
2535                      "com.sun.webkit.graphics.GraphicsDecoder",
2536                      "com.sun.webkit.graphics.RenderMediaControls",
2537                      "com.sun.webkit.graphics.RenderTheme",


2552                      "com.sun.webkit.text.TextBreakIterator",
2553                      "com.sun.webkit.text.TextNormalizer");
2554             }
2555         }
2556     }
2557 
2558     task compileNative()
2559 
2560     compileTargets { t ->
2561         def targetProperties = project.rootProject.ext[t.upper]
2562         def webkitProperties = targetProperties.webkit
2563         def classifier = (t.name != "linux" && t.name != "win") ? t.name :
2564                           IS_64 ? "${t.name}-amd64" : "${t.name}-i586"
2565 
2566         def webkitOutputDir = cygpath("$buildDir/${t.name}")
2567         def webkitConfig = IS_DEBUG_NATIVE ? "Debug" : "Release"
2568 
2569         File nativeBuildDir = new File("${webkitOutputDir}")
2570         nativeBuildDir.mkdirs()
2571 
2572         def compileNativeTask = task("compileNative${t.capital}", dependsOn: generateHeaders) {
2573             doLast {
2574                 println "Building Webkit configuration /$webkitConfig/ into $webkitOutputDir"
2575 
2576                 exec {
2577                     workingDir("$webkitOutputDir")
2578                     commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/set-webkit-configuration", "--$webkitConfig")
2579                     environment(["WEBKIT_OUTPUTDIR" : webkitOutputDir])
2580                 }
2581 
2582                 exec {
2583                     workingDir("$projectDir/src/main/native")
2584                     def cmakeArgs = "-DENABLE_TOOLS=1"
2585                     if (t.name == "win") {
2586                         String parfaitPath = IS_COMPILE_PARFAIT ? System.getenv().get("PARFAIT_PATH") + ";" : "";
2587                         Map environmentSettings = new HashMap(WINDOWS_NATIVE_COMPILE_ENVIRONMENT)
2588                         environmentSettings["PATH"] = parfaitPath + "$WINDOWS_VS_PATH"
2589                         /* To build with ICU:
2590                         1. Download http://javaweb.us.oracle.com/jcg/fx-webrevs/RT-17164/WebKitLibrariesICU.zip
2591                         and unzip it to WebKitLibraries folder.
2592                         2. Copy DLLs from
2593                         WebKitLibrariesICU.zip\WebKitLibraries\import\runtime


2636                     }
2637 
2638                     cmakeArgs += " -DJAVAFX_RELEASE_VERSION=8.0"
2639                     commandLine("perl", "$projectDir/src/main/native/Tools/Scripts/build-webkit",
2640                         "--java", "--icu-unicode", targetCpuBitDepthSwitch,
2641                         "--cmakeargs=${cmakeArgs}")
2642                 }
2643 
2644                 // Cmake places Windows DLL in bin directory
2645                 def dllDir = IS_WINDOWS ? "bin" : "lib"
2646                 def library = rootProject.ext[t.upper].library
2647                 copy {
2648                     from "$webkitOutputDir/$webkitConfig/$dllDir/${library('jfxwebkit')}"
2649                     into "$buildDir/libs/${t.name}"
2650                 }
2651                 copy {
2652                     from "$webkitOutputDir/$webkitConfig/$dllDir/${library('DumpRenderTreeJava')}"
2653                     into "$buildDir/test/${t.name}"
2654                 }
2655             }
2656         }
2657 
2658         compileNative.dependsOn compileNativeTask
2659 
2660         if (IS_WINDOWS && t.name == "win") {
2661             def rcTask = project.task("rc${t.capital}", type: CompileResourceTask) {
2662                 compiler = webkitProperties.rcCompiler
2663                 source(webkitProperties.rcSource)
2664                 if (webkitProperties.rcFlags) {
2665                     rcParams.addAll(webkitProperties.rcFlags)
2666                 }
2667                 output(file("$webkitOutputDir/$webkitConfig/WebCore/obj"))
2668             }
2669             compileNativeTask.dependsOn rcTask
2670         }
2671 
2672         if (!targetProperties.compileWebnodeNative) {
2673             println("Not compiling native Webkit for ${t.name} per configuration request");
2674             compileNativeTask.enabled = false
2675         }
2676     }
2677 
2678     def drtClasses = "com/sun/javafx/webkit/drt/**"
2679     jar.exclude(drtClasses)
2680     task drtJar(type: Jar, dependsOn: compileJava) {
2681         archiveName = "drt.jar"
2682         destinationDir = file("$buildDir/test")
2683         from "$buildDir/classes/java/main"
2684         include drtClasses
2685     }
2686     if (IS_COMPILE_WEBKIT) {
2687         jar.dependsOn compileNative, drtJar
2688     }
2689 }
2690 
2691 allprojects {
2692     // The following block is a workaround for the fact that presently Gradle
2693     // can't set the -XDignore.symbol.file flag, because it appears that the
2694     // javac API is lacking support for it. So what we'll do is find any Compile
2695     // task and manually provide the options necessary to fire up the
2696     // compiler with the right settings.
2697     //
2698     // Also, we need to remove jfxrt.jar from the ext classpath (if it is there)
2699     tasks.withType(JavaCompile) { compile ->
2700         if (compile.options.hasProperty("useAnt")) {
2701             compile.options.useAnt = true
2702             compile.options.useDepend = IS_USE_DEPEND
2703         } else if (compile.options.hasProperty("incremental")) {


2915 
2916 compileTargets { t ->
2917     def targetProperties = project.ext[t.upper]
2918     def sdkDirName = targetProperties.sdkDirName
2919     def library = targetProperties.library
2920     // The jfxrt task is responsible for creating the jfxrt.jar. A developer may
2921     // have multiple SDK's on their system at any one time, depending on which
2922     // cross compiles they have done. For example, I might have:
2923     //      build/ios-sdk/rt/lib/ext/jfxrt.jar
2924     //      build/armhf-sdk/rt/lib/ext/jfxrt.jar
2925     // and so forth. The default host build will always install into 'sdk'
2926     // allowing for uses where a known sdk path is needed (like IDEs)
2927     //      build/sdk/rt/lib/ext/jfxrt.jar
2928     // This arrangement allows for multiple independent SDKs to
2929     // exist on a developer's system.
2930     def jfxrtTask = task("jfxrt$t.capital", type: Jar) {
2931         group = "Basic"
2932         description = "Creates the jfxrt.jar for the $t.name target"
2933         archiveName = "build/${sdkDirName}/rt/lib/ext/jfxrt.jar";
2934         includeEmptyDirs = false
2935         from("modules/base/build/classes/java/main",
2936              "modules/base/build/resources/main",
2937              "modules/builders/build/classes/java/main",
2938              "modules/graphics/build/classes/java/main",
2939              "modules/graphics/build/resources/main",
2940              "modules/controls/build/classes/java/main",
2941              "modules/controls/build/resources/main",
2942              "modules/fxml/build/classes/java/main",
2943              "modules/fxml/build/resources/main",
2944              "modules/graphics/build/classes/jsl-decora",
2945              "modules/graphics/build/resources/jsl-decora",
2946              "modules/graphics/build/classes/jsl-prism",
2947              "modules/graphics/build/resources/jsl-prism",
2948              "modules/media/build/classes/java/main",
2949              "modules/media/build/resources/main")
2950         if (COMPILE_SWING) from ("modules/swing/build/classes/java/main", "modules/swing/build/resources/main")
2951 
2952         if (!IS_MAC) {
2953             exclude ("modules/media/build/classes/java/main/com/sun/media/jfxmediaimpl/platform/osx/**",
2954                      "com/sun/prism/es2/MacGL*",
2955                      "com/sun/glass/events/mac",
2956                      "com/sun/glass/ui/mac",
2957                      "com/sun/prism/es2/gl/mac"
2958                      )
2959         }
2960         if (!IS_WINDOWS) {
2961             exclude ("**/*.hlsl",
2962                      "com/sun/glass/ui/win",
2963                      "com/sun/prism/d3d",
2964                      "com/sun/prism/es2/gl/win",
2965                      "com/sun/prism/es2/WinGL*",
2966                      "com/sun/scenario/effect/impl/hw/d3d"
2967                      )
2968         }
2969         if (!targetProperties.includeGTK) { //usually IS_LINUX
2970             exclude (
2971                      "com/sun/glass/ui/gtk",
2972                      "com/sun/prism/es2/EGL*",
2973                      "com/sun/prism/es2/gl/eglfb",


2976                      "com/sun/prism/es2/X11GL*"
2977                      )
2978         }
2979         if (!targetProperties.includeEGL) {
2980             exclude ("com/sun/prism/es2/EGL*")
2981         }
2982         if (!targetProperties.includeLens) {
2983             exclude ("com/sun/glass/ui/lens")
2984         }
2985         /* Note: Monocle is used in the test harness, and so should
2986          * not be excluded until the deploy phase
2987         if (!targetProperties.includeMonocle) {
2988             exclude ("com/sun/glass/ui/monocle")
2989         }
2990         */
2991         if (!targetProperties.includeNull3d) {
2992             // "com/sun/prism/null3d", // TODO This is used in dev builds but not the final sdk
2993             exclude ("com/sun/prism/null3d")
2994         }
2995         if (t.name != 'ios') {
2996             exclude ("modules/media/build/classes/java/main/com/sun/media/jfxmediaimpl/platform/ios/**",
2997                      "com/sun/glass/ui/ios",
2998                      "com/sun/prism/es2/IOS*"
2999                      )
3000         }
3001         if (t.name != 'android' && t.name != 'dalvik') {
3002             exclude ("com/sun/glass/ui/android/*")
3003         }
3004 
3005         if (t.name == 'android') {
3006             from ("modules/web/build/classes/android",
3007                   "modules/web/build/resources/android",
3008                   "modules/controls/build/classes/android",
3009                   "modules/controls/build/resources/android")
3010         } else if (t.name == 'ios') {
3011             from ("modules/web/build/classes/ios",
3012                   "modules/web/build/resources/ios",
3013                   "modules/extensions/build/classes/ios")
3014         } else {
3015             from ("modules/web/build/classes/java/main", "modules/web/build/resources/main")
3016         }
3017 
3018         exclude("**/javafx/embed/swt/**")
3019 
3020         if (!targetProperties.includeSWT) {
3021             exclude("com/sun/glass/ui/swt")
3022         }
3023 
3024         if (!targetProperties.includeSwing) {
3025             exclude("javafx/embed/swing")
3026         }
3027         exclude("js/**/*", // er...
3028                 "PrismLoaderBackend*", // More decora stuff
3029                 "**/*.stg",    // any glue files for decora must be excluded
3030                 "**/*.java",   // Builder java files are in build/classes and should be excluded
3031                 "com/sun/javafx/webkit/drt"); // Drt class
3032 
3033         // Filter out platform specific Java sources (glass) when compiling for other targets
3034         if (targetProperties.containsKey('jfxrtJarExcludes')) {
3035             exclude(targetProperties.jfxrtJarExcludes)
3036         }
3037 
3038         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
3039     }
3040     def jfxrtIndexTask = task("jfxrtIndex$t.capital") {
3041         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
3042         dependsOn(jfxrtTask)
3043 
3044         doLast() {
3045             ant.jar (update: true, index: true, destfile: jfxrtTask.archiveName)
3046         }
3047     }
3048     jfxrt.dependsOn(jfxrtIndexTask)
3049 
3050     def jfxswtTask = task("jfxswt$t.capital", type: Jar) {
3051         enabled = COMPILE_SWT
3052         group = "Basic"
3053         description = "Creates the jfxswt.jar for the $t.name target"
3054         archiveName = "build/${sdkDirName}/rt/lib/jfxswt.jar";
3055         includeEmptyDirs = false
3056         from("modules/swt/build/classes/java/main");
3057         from("modules/builders/build/classes/java/main");
3058         include("**/javafx/embed/swt/**")
3059         exclude("**/*.java");  // Builder java files are in build/classes and should be excluded
3060 
3061         dependsOn(subprojects.collect { project -> project.getTasksByName("assemble", true)});
3062     }
3063     def jfxswtIndexTask = task("jfxswtIndex$t.capital") {
3064         //the following is a workaround for the lack of indexing in gradle 1.4 through 1.7
3065         dependsOn(jfxswtTask)
3066 
3067         doLast() {
3068             ant.jar (update: true, index: true, destfile: jfxswtTask.archiveName)
3069         }
3070     }
3071     jfxrt.dependsOn(jfxswtIndexTask)
3072 
3073     def jmxTask = task ("jmx${t.capital}", type: Jar) {
3074         group = "Basic"
3075         description = "Creates the javafx-mx.jar"
3076         archiveName = "build/${sdkDirName}/lib/javafx-mx.jar";
3077         includeEmptyDirs = false
3078         from "modules/jmx/build/classes/java/main"
3079         from "modules/jmx/build/resources/main"
3080         dependsOn project(":jmx").assemble
3081     }
3082 
3083     // The 'sdk' task will build the rest of the SDK, and depends on the 'jfxrtTask' task. After
3084     // executing this task the sdk bundle for the current COMPILE_TARGETS will be fully created.
3085     def sdkTask = task("sdk$t.capital") {
3086         group = "Basic"
3087         description = "Creates the SDK for $t.name"
3088         doLast {
3089             // TODO instead of using copy everywhere, I probably want to use "sync" instead?
3090             // Copy all of the .dll / .so / .dylib native libraries into build/sdk/rt/lib/
3091             copy {
3092                 def useLipo = targetProperties.containsKey('useLipo') ? targetProperties.useLipo : false
3093                 from("modules/graphics/build/libs/jsl-decora/${t.name}/${library(targetProperties.decora.lib)}")
3094                 def libs = ['font', 'prism', 'prismSW', 'prismES2', 'glass', 'iio']
3095                 if (IS_COMPILE_PANGO) {
3096                     libs += ['fontFreetype', 'fontPango'];
3097                 }
3098                 libs.each { lib ->


3235 }
3236 
3237     //task integrationCheck {
3238     //    group = "Basic"
3239     //    description = "Performs all the tasks necessary to ensure that the current build is ready for integration."
3240     //    dependsOn sdk
3241     //    dependsOn subprojects.collect { project -> project.getTasksByName("check", true)}
3242     //}
3243 
3244 /*
3245  * This clause changes the way we handle a build.gradle within ./apps
3246  * It does a few things:
3247  *   modifies the classpath used to include the built runttime classes
3248  *   provides for copying the build applications to the artifacts tree
3249  *
3250  * The applications to be built will be under ./apps, but also must
3251  * be listed in the applications listed in the setting variable: JFXApplications
3252  */
3253 ext.JFXRT_CP =
3254     files(
3255         project(":base").sourceSets.main.java.outputDir,
3256         project(":graphics").sourceSets.main.java.outputDir,
3257         project(":controls").sourceSets.main.java.outputDir,
3258         project(":fxml").sourceSets.main.java.outputDir,
3259         project(":swing").sourceSets.main.java.outputDir, //NOTE - used by 3Dviewer
3260         project(":builders").sourceSets.main.java.outputDir,
3261             "modules/media/build/classes/java/main",
3262             "modules/web/build/classes/java/main",
3263     )
3264 
3265 project(":apps") {
3266     // The apps build is Ant based, and gradle lets us "import" ant build.xml
3267     // into our configuration.
3268 
3269     ant.importBuild 'build.xml'
3270 
3271     // Download the Lucene libraries needed for the Ensemble8 app
3272     def luceneVersion = "7.4.0"
3273     getConfigurations().create("lucene");
3274     dependencies {
3275         lucene group: "org.apache.lucene", name: "lucene-core", version: luceneVersion
3276         lucene group: "org.apache.lucene", name: "lucene-grouping", version: luceneVersion
3277         lucene group: "org.apache.lucene", name: "lucene-queryparser", version: luceneVersion
3278     }
3279 
3280     // Copy Lucene libraries into the Ensemble8/lib directory
3281     File ensembleLibDir = rootProject.file("apps/samples/Ensemble8/lib");
3282     def libNames = [ "lucene-core-${luceneVersion}.jar",


< prev index next >