plugins { id 'application' id 'org.openjfx.javafxplugin' version '0.0.8' } javafx { version = "11.0.2" modules = [ 'javafx.controls', 'javafx.fxml'] } mainClassName = "$moduleName/org.subshare.gui.SubShareGui" //sourceCompatibility = JavaVersion.VERSION_11 //targetCompatibility = JavaVersion.VERSION_11 import org.apache.tools.ant.filters.* //sourceSets { // main { // java { // srcDir 'src/main/java' // } // resources { // srcDir 'src/main/java' // srcDir 'src/main/resources' // } // } // // test { // java { // srcDir 'src/test/java' // } // resources { // srcDir 'src/test/java' // srcDir 'src/test/resources' // } // } //} dependencies { compile project(':org.subshare.ls.client') // compile project(':org.subshare.ls.server') // is a transitive dependency of o.s.l.server.cproc compile project(':org.subshare.ls.server.cproc') // the following is needed only to configure the SSL certificate check callback - maybe not needed in the future, anymore compile project(':org.subshare.rest.client') // Just like every other app, we need an auto-update. compile project(':org.subshare.updater.gui') // We cannot use the nio stuff on Android, AFAIK. Hence, we either must move the assembly of this gui stuff for ordinary // desktop PCs into a separate project or override this somehow for Android (exclude the dependency). Need to deal with // this later. compile "co.codewizards.cloudstore:co.codewizards.cloudstore.core.oio.nio:$cloudstoreVersion" compile "org.slf4j:log4j-over-slf4j:$slf4jVersion" compile ("ch.qos.logback:logback-classic:$logbackVersion") { exclude group: 'edu.washington.cs.types.checker', module: 'checker-framework' exclude group: 'javax.activation', module: 'activation' } // runtime-dependencies (needed when starting the app - not for compilation) runtime project(':org.subshare.local') // runtime project(':org.subshare.rest.client') } jar { manifest { attributes( 'Main-Class': 'org.subshare.gui.SubShareGui', 'Class-Path': configurations.runtime.collect { it.getName() }.join(' ')) } } task copyDependencies(type: Copy) { into "$buildDir/assembly/subshare/lib" from configurations.runtime } task copyJar(type: Copy) { into "$buildDir/assembly/subshare/lib" from "$buildDir/libs" } def filterTokenMap = [ 'project.artifactId' : project.name, 'project.version' : project.version ] task copyUnfilteredFilesFromAssembly(type: Copy) { into "$buildDir/assembly/subshare" from 'src/assembly' exclude '*.properties' } task copyFilteredFilesFromAssembly(type: Copy, dependsOn: [ copyUnfilteredFilesFromAssembly ] ) { into "$buildDir/assembly/subshare" from 'src/assembly' include '*.properties' // Use ANT filter ReplaceTokens. filter(ReplaceTokens, tokens: filterTokenMap) } task copyFilesFromBin(type: Copy) { into "$buildDir/assembly/subshare/bin" from 'src/bin' // Use ANT filter ReplaceTokens. filter(ReplaceTokens, tokens: filterTokenMap) } task chmodMainExecutable(type: Exec, dependsOn: [ copyFilesFromBin, copyFilteredFilesFromAssembly ]) { commandLine = ['chmod', 'a+x', 'subshare'] workingDir = file("$buildDir/assembly/subshare/bin") } task tarGzAssembly(type: Tar, dependsOn: [ chmodMainExecutable, copyJar, copyDependencies ]) { compression = Compression.GZIP classifier = 'bin' extension = 'tar.gz' // default is 'tgz' includeEmptyDirs true from "$buildDir/assembly" } task zipAssembly(type: Zip, dependsOn: tarGzAssembly) { classifier = 'bin' includeEmptyDirs true from "$buildDir/assembly" } artifacts{ archives tarGzAssembly, zipAssembly } build.dependsOn(zipAssembly) // TODO this should be in the root build.gradle in subprojects {...} or allprojects {...}, but it does not work :-( // I get errors like this: // >> Could not get unknown property 'modularity' for project ':org.subshare.test' of type org.gradle.api.Project. << // But it works fine, if I put it into the sub-projects individually. This sucks :-( but at least it works. // ...maybe this is because there are still some sub-projects not containing a module-info.java... //modularity.mixedJavaRelease 8 // sets "--release 8" for main code, and "--release 9" for "module-info.java"