@@ -7,6 +7,7 @@ buildscript {
77 }
88
99 dependencies {
10+ classpath group : ' de.dynamicfiles.projects.gradle.plugins' , name : ' javafx-gradle-plugin' , version : ' 8.5.2'
1011 classpath ' com.netflix.nebula:gradle-aggregate-javadocs-plugin:2.2.+'
1112 classpath ' net.ltgt.gradle:gradle-errorprone-plugin:0.0.8'
1213 }
@@ -84,12 +85,13 @@ def getVersionSimple = { ->
8485 }
8586}
8687
87- allprojects {
88+ configure( allprojects - project( ' :ui:linuxLauncher ' )) {
8889 apply plugin : ' java'
8990 apply plugin : ' application'
9091 apply plugin : ' jacoco'
9192 apply plugin : ' net.ltgt.errorprone'
9293 apply plugin : ' checkstyle'
94+ apply plugin : ' pmd'
9395 apply plugin : ' findbugs'
9496
9597 configurations. errorprone {
@@ -99,6 +101,9 @@ allprojects {
99101 checkstyle {
100102 configFile = new File (rootDir, " checkstyle.xml" )
101103 toolVersion = ' 6.19'
104+ if (project. hasProperty(" ignoreCheckstyle" )) {
105+ ignoreFailures = true
106+ }
102107 }
103108
104109 tasks. withType(Checkstyle ) {
@@ -107,6 +112,14 @@ allprojects {
107112 it. dependsOn = []
108113 }
109114
115+ pmd {
116+ consoleOutput = true
117+ sourceSets = [sourceSets. main]
118+ reportsDir = file(" $project . buildDir /reports/pmd" )
119+ ruleSetFiles = files(new File (rootDir, " pmd-ruleset.xml" ))
120+ ruleSets = []
121+ }
122+
110123 findbugs {
111124 sourceSets = [sourceSets. main]
112125 excludeFilter = new File (rootDir, " findBugsSuppressions.xml" )
@@ -311,21 +324,59 @@ project(":core") {
311324 }
312325}
313326
327+ project (" :ui:linuxLauncher" ) {
328+ apply plugin : ' cpp'
329+
330+ model {
331+ binaries {
332+ all {
333+ cppCompiler. args ' -pthread' , ' -ldl'
334+ linker. args ' -pthread' , ' -ldl'
335+ }
336+ }
337+ components {
338+ linuxLauncher(NativeExecutableSpec ) {
339+ sources {
340+ cpp {
341+ source {
342+ srcDir " src/cpp"
343+ }
344+ }
345+ }
346+ }
347+ }
348+ }
349+ }
350+
351+ project (" :ui:preloader" ) {
352+ apply plugin : ' java'
353+ apply plugin : ' idea'
354+ apply plugin : ' jacoco'
355+ apply plugin : ' application'
356+
357+ task run(overwrite : true , type : JavaExec ) {
358+ classpath = sourceSets. main. runtimeClasspath
359+ main = ' edu.wpi.grip.preloader.GripPreloader'
360+ args ' windowed'
361+ }
362+ }
363+
314364project(" :ui" ) {
315365 apply plugin : ' java'
316366 apply plugin : ' idea'
317367 apply plugin : ' jacoco'
318368 apply plugin : ' application'
319- apply from : ' http://dl.bintray.com/shemnon/ javafx-gradle/8.1.1/javafx. plugin'
369+ apply plugin : ' javafx-gradle- plugin'
320370
321371 configurations {
322372 ideProvider
323373 }
324374
325375 dependencies {
326376 compile project(path : ' :core' , configuration : ' shadow' )
377+ compile project(path : ' :ui:preloader' )
327378 ideProvider project(path : ' :core' , configuration : ' compile' )
328- compile group : ' org.controlsfx' , name : ' controlsfx' , version : ' 8.40.10 '
379+ compile group : ' org.controlsfx' , name : ' controlsfx' , version : ' 8.40.11 '
329380 compile group : ' com.hierynomus' , name : ' sshj' , version : ' 0.16.0'
330381 testCompile files(project(' :core' ). sourceSets. test. output. classesDir)
331382 testCompile files(project(' :core' ). sourceSets. test. output. resourcesDir)
@@ -335,6 +386,10 @@ project(":ui") {
335386 }
336387
337388 evaluationDependsOn(' :core' )
389+ evaluationDependsOn(' :ui:preloader' )
390+ if (System . getProperty(" os.name" ). toLowerCase(). contains(" linux" )) {
391+ jfxNative. dependsOn tasks. getByPath(' :ui:linuxLauncher:linuxLauncherExecutable' )
392+ }
338393 compileTestJava. dependsOn tasks. getByPath(' :core:testClasses' )
339394
340395 idea. module {
@@ -352,39 +407,29 @@ project(":ui") {
352407 }
353408
354409
355- javafx {
356- profiles {
357- linux {
358- category = ' Development'
359- bundleArguments = [
360- // for DEB bundles
361- ' email' :
' [email protected] ' ,
// This is the email used for the deb maintainer field. 362- ]
363- }
364- }
365- appID = ' GRIP'
366- appName = ' GRIP'
410+ jfx {
367411 mainClass = " edu.wpi.grip.ui.Main"
368- version = getVersionSimple()
412+ preLoader = " edu.wpi.grip.preloader.GripPreloader"
413+
414+ identifier = " GRIP"
415+ appName = " GRIP"
416+ vendor = " Worcester Polytechnic Institute"
417+ nativeReleaseVersion = " ${ getVersionSimple()} -${ arch} "
418+
419+ jfxMainAppJarName = " ${ jfx.appName} -${ jfx.nativeReleaseVersion} .jar"
369420
370421 // This prevents the JIT from eating stack traces that get thrown a lot
371422 // This is slower but means we actually get the stack traces instead of
372423 // having them become one line like `java.lang.ArrayIndexOutOfBoundsException`
373424 // and as such, would be useless.
374425 // See: https://plumbr.eu/blog/java/on-a-quest-for-missing-stacktraces
375426 jvmArgs = [" -XX:-OmitStackTraceInFastThrow" ]
376- }
377- mainClassName = javafx. mainClass
378427
379- // The JavaFX plugin does not provide a way to change the installer artifact's name without changing the appName or appID,
380- // so instead, we simply rename the artifact to append the architecture (x86 or x64)
381- jfxDeploy. doLast {
382- def filet = fileTree(dir : ' build/distributions' , include : " ${ javafx.appName} -${ getVersionSimple()} .*" )
383- filet. each { File f ->
384- def f2 = new File (f. getParentFile(), " ${ f.getName().replace("${getVersionSimple()}", "${getVersionSimple()}-${arch}")} " )
385- f. renameTo(f2)
386- }
428+ bundleArguments = [
429+ " linux.launcher.url" : file(' linuxLauncher/build/exe/linuxLauncher/linuxLauncher' ). toURI(). toURL()
430+ ]
387431 }
432+ mainClassName = jfx. mainClass
388433}
389434
390435/*
@@ -393,23 +438,25 @@ project(":ui") {
393438 */
394439task jacocoRootReport (type : JacocoReport , group : ' Coverage reports' ) {
395440 description = ' Generates an aggregate report from all subprojects'
396- dependsOn(subprojects. test)
441+ configure(subprojects - project(' :ui:linuxLauncher' )) {
442+ dependsOn(test)
397443
398- additionalSourceDirs = files(subprojects . sourceSets. main. allSource. srcDirs)
399- sourceDirectories = files(subprojects . sourceSets. main. allSource. srcDirs)
400- classDirectories = files(subprojects . sourceSets. main. output)
401- executionData = files(subprojects . jacocoTestReport. executionData)
444+ additionalSourceDirs = files(sourceSets. main. allSource. srcDirs)
445+ sourceDirectories = files(sourceSets. main. allSource. srcDirs)
446+ classDirectories = files(sourceSets. main. output)
447+ executionData = files(jacocoTestReport. executionData)
402448
403- reports {
404- html. enabled = true
405- xml. enabled = true
406- }
449+ reports {
450+ html. enabled = true
451+ xml. enabled = true
452+ }
407453
408- doFirst {
409- executionData = files(executionData. findAll { it. exists() })
454+ doFirst {
455+ executionData = files(executionData. findAll { it. exists() })
456+ }
410457 }
411458}
412459
413460task wrapper (type : Wrapper ) {
414- gradleVersion = ' 2.13 '
461+ gradleVersion = ' 2.14.1 '
415462}
0 commit comments