./build.gradle

Print this page
rev 8335 : RT-39304


1532                 executable = JAVA
1533                 workingDir = "modules/graphics"
1534                 main = "CompileJSL"
1535                 classpath = configurations.compile + configurations.antlr3
1536                 classpath += files("$buildDir/classes/jsl-compilers/prism", "modules/graphics/src/main/jsl-prism") // for the .stg
1537                 args = ["-i", sourceDir, "-o", destinationDir, "-t", "-pkg", "com/sun/prism", "-d3d", "-es2", "-name", "$file"]
1538                 jvmArgs "-Djava.ext.dirs="
1539             }
1540         }
1541     }
1542 
1543     classes.dependsOn compilePrismJavaShaders;
1544     nativePrism.dependsOn compilePrismHLSLShaders;
1545 
1546     project.nativeAllTask.dependsOn nativeDecora
1547     project.cleanNativeAllTask.dependsOn cleanNativeDecora
1548     assemble.dependsOn nativeDecora
1549     processResources.dependsOn processDecoraShaders, processPrismShaders
1550 
1551     test {
1552         jvmArgs "-Djava.ext.dirs=", "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit", "-DCSS_META_DATA_TEST_DIR=${file('$buildDir/classes/main/javafx')}"


1553         enableAssertions = true
1554         testLogging.exceptionFormat = "full"
1555         scanForTestClasses = false
1556         include "**/*Test.*"
1557         if (BUILD_CLOSED && DO_JCOV) {
1558             addJCov(project, test)
1559         }
1560     }
1561 
1562     // To enable the IDEs to all be happy (no red squiggles) we need to have the libraries
1563     // available in some known location. Maybe in the future the Gradle plugins to each
1564     // of the IDEs will be good enough that we won't need this hack anymore.
1565     classes << {
1566         // Copy all of the download libraries to the libs directory for the sake of the IDEs
1567         File libsDir = rootProject.file("build/libs");
1568         
1569         // In some IDEs (Eclipse for example), touching these libraries cauese a full build
1570         // within the IDE.  When gradle is used outside of the IDE, for example to build the
1571         // native code, a full rebuild is caused within the IDE.  The fix is to check for the 
1572         // lib directory and not copy the files


1591             copy {
1592                 into libsDir
1593                 from f.getParentFile()
1594                 include "**/*swt*.jar"
1595                 includeEmptyDirs = false
1596                 rename ".*swt.*jar", "swt-debug\\.jar"
1597             }
1598         }
1599     }
1600 }
1601 
1602 project(":controls") {
1603     dependencies {
1604         compile BUILD_SRC, project(":base"), project(":graphics"), project(":designTime")
1605         // TODO not sure how to specify this? processResources project(":base"), project(":graphics")
1606         testCompile project(":graphics").sourceSets.test.output
1607         testCompile project(":base").sourceSets.test.output
1608     }
1609 
1610     test {
1611         jvmArgs "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit"


1612     }
1613 
1614     // TODO Css2Bin really should be moved out and put into buildSrc if it can be
1615     // TODO could change script to dynamically locate all .css files and create bss for them, probably better
1616     // TODO also not sure there is any benefit to having css files in the jfxrt.jar at all
1617     processResources << {
1618         ["$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian.css",
1619         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css",
1620         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded-qvga.css",
1621         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded.css",
1622         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/fxvk.css",
1623         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/highcontrast.css",
1624         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena.css",
1625         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css",
1626         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/touch.css"].each { css ->
1627             javaexec {
1628                 executable = JAVA
1629                 workingDir = "modules/controls"
1630                 classpath files("$buildDir/classes/main",
1631                         project(":graphics").sourceSets.main.output,




1532                 executable = JAVA
1533                 workingDir = "modules/graphics"
1534                 main = "CompileJSL"
1535                 classpath = configurations.compile + configurations.antlr3
1536                 classpath += files("$buildDir/classes/jsl-compilers/prism", "modules/graphics/src/main/jsl-prism") // for the .stg
1537                 args = ["-i", sourceDir, "-o", destinationDir, "-t", "-pkg", "com/sun/prism", "-d3d", "-es2", "-name", "$file"]
1538                 jvmArgs "-Djava.ext.dirs="
1539             }
1540         }
1541     }
1542 
1543     classes.dependsOn compilePrismJavaShaders;
1544     nativePrism.dependsOn compilePrismHLSLShaders;
1545 
1546     project.nativeAllTask.dependsOn nativeDecora
1547     project.cleanNativeAllTask.dependsOn cleanNativeDecora
1548     assemble.dependsOn nativeDecora
1549     processResources.dependsOn processDecoraShaders, processPrismShaders
1550 
1551     test {
1552         def cssDir = file("$buildDir/classes/main/javafx")
1553         jvmArgs "-Djava.ext.dirs=", "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit",
1554             "-DCSS_META_DATA_TEST_DIR=$cssDir"
1555         enableAssertions = true
1556         testLogging.exceptionFormat = "full"
1557         scanForTestClasses = false
1558         include "**/*Test.*"
1559         if (BUILD_CLOSED && DO_JCOV) {
1560             addJCov(project, test)
1561         }
1562     }
1563 
1564     // To enable the IDEs to all be happy (no red squiggles) we need to have the libraries
1565     // available in some known location. Maybe in the future the Gradle plugins to each
1566     // of the IDEs will be good enough that we won't need this hack anymore.
1567     classes << {
1568         // Copy all of the download libraries to the libs directory for the sake of the IDEs
1569         File libsDir = rootProject.file("build/libs");
1570         
1571         // In some IDEs (Eclipse for example), touching these libraries cauese a full build
1572         // within the IDE.  When gradle is used outside of the IDE, for example to build the
1573         // native code, a full rebuild is caused within the IDE.  The fix is to check for the 
1574         // lib directory and not copy the files


1593             copy {
1594                 into libsDir
1595                 from f.getParentFile()
1596                 include "**/*swt*.jar"
1597                 includeEmptyDirs = false
1598                 rename ".*swt.*jar", "swt-debug\\.jar"
1599             }
1600         }
1601     }
1602 }
1603 
1604 project(":controls") {
1605     dependencies {
1606         compile BUILD_SRC, project(":base"), project(":graphics"), project(":designTime")
1607         // TODO not sure how to specify this? processResources project(":base"), project(":graphics")
1608         testCompile project(":graphics").sourceSets.test.output
1609         testCompile project(":base").sourceSets.test.output
1610     }
1611 
1612     test {
1613         def cssDir = file("$buildDir/classes/main/javafx")
1614         jvmArgs "-Djavafx.toolkit=com.sun.javafx.pgstub.StubToolkit",
1615             "-DCSS_META_DATA_TEST_DIR=$cssDir"        
1616     }
1617 
1618     // TODO Css2Bin really should be moved out and put into buildSrc if it can be
1619     // TODO could change script to dynamically locate all .css files and create bss for them, probably better
1620     // TODO also not sure there is any benefit to having css files in the jfxrt.jar at all
1621     processResources << {
1622         ["$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian.css",
1623         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css",
1624         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded-qvga.css",
1625         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded.css",
1626         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/fxvk.css",
1627         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/highcontrast.css",
1628         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena.css",
1629         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css",
1630         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/touch.css"].each { css ->
1631             javaexec {
1632                 executable = JAVA
1633                 workingDir = "modules/controls"
1634                 classpath files("$buildDir/classes/main",
1635                         project(":graphics").sourceSets.main.output,