1115 def reportFile = p.file("build/reports/jcov/report.xml")
1116 if (reportFile.exists()) {
1117 p.javaexec {
1118 workingDir = p.file("build/reports/jcov")
1119 classpath = p.files(p.configurations.testCompile.files.find { it.name.startsWith('jcov') })
1120 main = "com.sun.tdk.jcov.Helper"
1121 args = [
1122 "RepGen",
1123 "-exclude", "\"**.test\"",
1124 "-exclude", "\"**.*Test\"",
1125 "-output", ".",
1126 "-source", p.sourceSets.main.java.srcDirs.collect{p.file(it)}.join(":"),
1127 "report.xml"
1128 ]
1129 }
1130 }
1131 }
1132 }
1133
1134 allprojects {
1135 // We want to configure all projects as java projects and use the same compile settings
1136 // etc, except for the root project which we just want to ignore (and for now media)
1137 if (project == rootProject) {
1138 return
1139 }
1140 if (project.path.startsWith(":apps")) {
1141 // Lets handle the apps tree differently, as it is a collection of ant builds,
1142 // and the ant importer collides with the 'apply plugin:java'
1143 return
1144 }
1145 // All of our projects are java projects
1146 apply plugin: "java"
1147 sourceCompatibility = 1.8
1148
1149 // Setup the repositories that we'll download libraries from. Maven Central is
1150 // just easy for most things. The custom "ivy" repo is for downloading SWT. The way it
1151 // works is to setup the download URL such that it will resolve to the actual jar file
1152 // to download. See SWT_FILE_NAME for the name of the jar that will be used as the
1153 // "artifact" in the pattern below. Note that the closed builds use different repositories
1154 // so if you are debugging a closed-build artifact related build issue, check out the
1155 // closed gradle file instead.
1156 if (!BUILD_CLOSED) {
1157 repositories {
1158 mavenCentral()
1159 ivy {
1160 url "http://download.eclipse.org/eclipse/updates/3.7/R-3.7.2-201202080800/plugins/"
1161 layout "pattern", {
1162 artifact "[artifact].[ext]"
1163 }
1164 }
1165 }
1166 }
1167
1168 // By default all of our projects require junit for testing so we can just
1169 // setup this dependency here.
1170 dependencies {
1171 testCompile group: "junit", name: "junit", version: "4.8.2"
1172 if (BUILD_CLOSED && DO_JCOV) {
1173 testCompile name: "jcov"
1174 }
1175 }
1176
1177 // Compile and run tests against the jfxrt.jar in the built sdk of the host machine
1178 def sdkDir = "${rootProject.buildDir}/sdk"
1179 def jfxrtJar = "$sdkDir/rt/lib/ext/jfxrt.jar"
1180 def testJfxrtJar = DO_BUILD_SDK_FOR_TEST ? jfxrtJar : jfxrtJarFromSdk
1181
1182 // At the moment the ASM library shipped with Gradle that is used to
1183 // discover the different test classes fails on Java 8, so in order
1184 // to have sourceCompatibility set to 1.8 I have to also turn scanForClasses off
1185 // and manually specify the includes / excludes. At the moment we use
1186 // Java 7 but when we switch to 8 this will be needed, and probably again when
1187 // we start building with Java 9.
3206 * be listed in the applications listed in the setting variable: JFXApplications
3207 */
3208 ext.JFXRT_CP =
3209 files(
3210 project(":base").sourceSets.main.output.classesDir,
3211 project(":graphics").sourceSets.main.output.classesDir,
3212 project(":controls").sourceSets.main.output.classesDir,
3213 project(":fxml").sourceSets.main.output.classesDir,
3214 project(":swing").sourceSets.main.output.classesDir, //NOTE - used by 3Dviewer
3215 project(":builders").sourceSets.main.output.classesDir,
3216 "modules/media/build/classes/main",
3217 "modules/web/build/classes/main",
3218 )
3219
3220 project(":apps") {
3221 // The apps build is Ant based, and gradle lets us "import" ant build.xml
3222 // into our configuration.
3223
3224 ant.importBuild 'build.xml'
3225
3226 compileTargets { t ->
3227 // The apps build is Ant based, and gradle lets us "import" ant apps/build.xml
3228 // into our configuration.
3229
3230 // override the apps build.xml with an explicit pointer to our jar.
3231 def sdkDirName = rootProject.ext[t.upper].sdkDirName
3232 def jfxrtJar = "${rootProject.buildDir}/${sdkDirName}/rt/lib/ext/jfxrt.jar"
3233
3234 def appsJar = project.task("appsJar${t.capital}") {
3235 doLast() {
3236 ant.properties['targetBld'] = "$t.name"
3237 if (!rootProject.ext[t.upper].compileSwing) {
3238 ant.properties['JFX_CORE_ONLY'] = 'true'
3239 }
3240 ant.properties['jfxbuild.jfxrt.jar'] = jfxrtJar
3241 ant.properties['platforms.JDK_1.8.home'] = "${rootProject.ext.JDK_HOME}"
3242 ant.project.executeTarget("sampleAppsJar")
3243 ant.project.executeTarget("scenebuilderSampleAppsJar")
3244 if (!t.name.startsWith("arm")) {
3245 ant.project.executeTarget("scenebuilderAppJar")
3246 }
3247 }
3248 }
3249 rootProject.appsjar.dependsOn(appsJar)
3250
3251 def appsClean = project.task("appsClean${t.capital}") {
3252 doLast() {
3253 ant.properties['targetBld'] = "$t.name"
3254 ant.properties['platforms.JDK_1.8.home'] = "${rootProject.ext.JDK_HOME}"
3255 ant.project.executeTarget("sampleAppsClean")
3256 ant.project.executeTarget("scenebuilderSampleAppsClean")
3257 if (!t.name.startsWith("arm")) {
3258 ant.project.executeTarget("scenebuilderAppClean")
3259 }
3260 }
3261 }
3262 rootProject.clean.dependsOn(appsClean)
3263 }
3264 }
3265
3266 /******************************************************************************
3267 * *
3268 * OpenExport *
3269 * *
3270 *****************************************************************************/
3271
3272 task openExport() {
3273 if (!BUILD_CLOSED) {
3274 publicExports.dependsOn(openExport)
3275 }
3276 }
3277
3278 task openZip() {
3279 if (!BUILD_CLOSED) {
|
1115 def reportFile = p.file("build/reports/jcov/report.xml")
1116 if (reportFile.exists()) {
1117 p.javaexec {
1118 workingDir = p.file("build/reports/jcov")
1119 classpath = p.files(p.configurations.testCompile.files.find { it.name.startsWith('jcov') })
1120 main = "com.sun.tdk.jcov.Helper"
1121 args = [
1122 "RepGen",
1123 "-exclude", "\"**.test\"",
1124 "-exclude", "\"**.*Test\"",
1125 "-output", ".",
1126 "-source", p.sourceSets.main.java.srcDirs.collect{p.file(it)}.join(":"),
1127 "report.xml"
1128 ]
1129 }
1130 }
1131 }
1132 }
1133
1134 allprojects {
1135 // Setup the repositories that we'll download libraries from. Maven Central is
1136 // just easy for most things. The custom "ivy" repo is for downloading SWT. The way it
1137 // works is to setup the download URL such that it will resolve to the actual jar file
1138 // to download. See SWT_FILE_NAME for the name of the jar that will be used as the
1139 // "artifact" in the pattern below. Note that the closed builds use different repositories
1140 // so if you are debugging a closed-build artifact related build issue, check out the
1141 // closed gradle file instead.
1142 if (!BUILD_CLOSED) {
1143 repositories {
1144 mavenCentral()
1145 ivy {
1146 url "http://download.eclipse.org/eclipse/updates/3.7/R-3.7.2-201202080800/plugins/"
1147 layout "pattern", {
1148 artifact "[artifact].[ext]"
1149 }
1150 }
1151 }
1152 }
1153
1154 // We want to configure all projects as java projects and use the same compile settings
1155 // etc, except for the root project which we just want to ignore (and for now media)
1156 if (project == rootProject) {
1157 return
1158 }
1159 if (project.path.startsWith(":apps")) {
1160 // Lets handle the apps tree differently, as it is a collection of ant builds,
1161 // and the ant importer collides with the 'apply plugin:java'
1162 return
1163 }
1164
1165 // All of our projects are java projects
1166 apply plugin: "java"
1167 sourceCompatibility = 1.8
1168
1169 // By default all of our projects require junit for testing so we can just
1170 // setup this dependency here.
1171 dependencies {
1172 testCompile group: "junit", name: "junit", version: "4.8.2"
1173 if (BUILD_CLOSED && DO_JCOV) {
1174 testCompile name: "jcov"
1175 }
1176 }
1177
1178 // Compile and run tests against the jfxrt.jar in the built sdk of the host machine
1179 def sdkDir = "${rootProject.buildDir}/sdk"
1180 def jfxrtJar = "$sdkDir/rt/lib/ext/jfxrt.jar"
1181 def testJfxrtJar = DO_BUILD_SDK_FOR_TEST ? jfxrtJar : jfxrtJarFromSdk
1182
1183 // At the moment the ASM library shipped with Gradle that is used to
1184 // discover the different test classes fails on Java 8, so in order
1185 // to have sourceCompatibility set to 1.8 I have to also turn scanForClasses off
1186 // and manually specify the includes / excludes. At the moment we use
1187 // Java 7 but when we switch to 8 this will be needed, and probably again when
1188 // we start building with Java 9.
3207 * be listed in the applications listed in the setting variable: JFXApplications
3208 */
3209 ext.JFXRT_CP =
3210 files(
3211 project(":base").sourceSets.main.output.classesDir,
3212 project(":graphics").sourceSets.main.output.classesDir,
3213 project(":controls").sourceSets.main.output.classesDir,
3214 project(":fxml").sourceSets.main.output.classesDir,
3215 project(":swing").sourceSets.main.output.classesDir, //NOTE - used by 3Dviewer
3216 project(":builders").sourceSets.main.output.classesDir,
3217 "modules/media/build/classes/main",
3218 "modules/web/build/classes/main",
3219 )
3220
3221 project(":apps") {
3222 // The apps build is Ant based, and gradle lets us "import" ant build.xml
3223 // into our configuration.
3224
3225 ant.importBuild 'build.xml'
3226
3227 // Download the Lucene libraries needed for the Ensemble8 app
3228 getConfigurations().create("lucene");
3229 dependencies {
3230 lucene group: "org.apache.lucene", name: "lucene-core", version: "7.1.0"
3231 lucene group: "org.apache.lucene", name: "lucene-grouping", version: "7.1.0"
3232 lucene group: "org.apache.lucene", name: "lucene-queryparser", version: "7.1.0"
3233 }
3234
3235 // Copy Lucene libraries into the Ensemble8/lib directory
3236 File ensembleLibDir = rootProject.file("apps/samples/Ensemble8/lib");
3237 def libNames = [ "lucene-core-7.1.0.jar",
3238 "lucene-grouping-7.1.0.jar",
3239 "lucene-queryparser-7.1.0.jar" ]
3240
3241
3242 task getLucene(type: Copy) {
3243 doFirst {
3244 ensembleLibDir.mkdirs();
3245 }
3246 into ensembleLibDir
3247 includeEmptyDirs = false
3248 configurations.lucene.files.each { f ->
3249 libNames.each { name ->
3250 if (name == f.getName()) {
3251 from f.getPath()
3252 }
3253 }
3254 }
3255 }
3256
3257 compileTargets { t ->
3258 // The apps build is Ant based, and gradle lets us "import" ant apps/build.xml
3259 // into our configuration.
3260
3261 // override the apps build.xml with an explicit pointer to our jar.
3262 def sdkDirName = rootProject.ext[t.upper].sdkDirName
3263 def jfxrtJar = "${rootProject.buildDir}/${sdkDirName}/rt/lib/ext/jfxrt.jar"
3264
3265 def appsJar = project.task("appsJar${t.capital}") {
3266 dependsOn(sdk, getLucene)
3267 doLast() {
3268 ant.properties['targetBld'] = "$t.name"
3269 if (!rootProject.ext[t.upper].compileSwing) {
3270 ant.properties['JFX_CORE_ONLY'] = 'true'
3271 }
3272 ant.properties['jfxbuild.jfxrt.jar'] = jfxrtJar
3273 ant.properties['platforms.JDK_1.8.home'] = "${rootProject.ext.JDK_HOME}"
3274 ant.project.executeTarget("sampleAppsJar")
3275 ant.project.executeTarget("scenebuilderSampleAppsJar")
3276 if (!t.name.startsWith("arm")) {
3277 ant.project.executeTarget("scenebuilderAppJar")
3278 }
3279 }
3280 }
3281 rootProject.appsjar.dependsOn(appsJar)
3282
3283 def appsClean = project.task("appsClean${t.capital}") {
3284 doLast() {
3285 ant.properties['targetBld'] = "$t.name"
3286 ant.properties['platforms.JDK_1.8.home'] = "${rootProject.ext.JDK_HOME}"
3287 ant.project.executeTarget("sampleAppsClean")
3288 ant.project.executeTarget("scenebuilderSampleAppsClean")
3289 if (!t.name.startsWith("arm")) {
3290 ant.project.executeTarget("scenebuilderAppClean")
3291 }
3292 delete(ensembleLibDir);
3293 }
3294 }
3295 rootProject.clean.dependsOn(appsClean)
3296 }
3297 }
3298
3299 /******************************************************************************
3300 * *
3301 * OpenExport *
3302 * *
3303 *****************************************************************************/
3304
3305 task openExport() {
3306 if (!BUILD_CLOSED) {
3307 publicExports.dependsOn(openExport)
3308 }
3309 }
3310
3311 task openZip() {
3312 if (!BUILD_CLOSED) {
|