xpipe-mirror/app/build.gradle

192 lines
7.1 KiB
Groovy
Raw Normal View History

2023-01-27 02:34:46 +00:00
plugins {
id 'application'
id "org.moditect.gradleplugin" version "1.0.0-rc3"
}
repositories {
mavenCentral()
}
2023-02-01 10:05:26 +00:00
def appVersion = rootProject.versionString
2023-01-27 02:34:46 +00:00
configurations {
dep
}
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
apply from: "$rootDir/gradle/gradle_scripts/javafx.gradle"
apply from: "$projectDir/gradle_scripts/richtextfx.gradle"
apply from: "$rootDir/gradle/gradle_scripts/commons.gradle"
apply from: "$rootDir/gradle/gradle_scripts/prettytime.gradle"
apply from: "$projectDir/gradle_scripts/sentry.gradle"
apply from: "$projectDir/gradle_scripts/fxtrayicon.gradle"
apply from: "$rootDir/gradle/gradle_scripts/lombok.gradle"
apply from: "$projectDir/gradle_scripts/github-api.gradle"
apply from: "$projectDir/gradle_scripts/flexmark.gradle"
apply from: "$rootDir/gradle/gradle_scripts/picocli.gradle"
configurations {
implementation.extendsFrom(dep)
}
dependencies {
2023-02-19 17:44:47 +00:00
compileOnly project(':api')
2023-01-27 02:34:46 +00:00
implementation project(':core')
implementation project(':beacon')
2023-02-19 17:44:47 +00:00
compileOnly 'org.hamcrest:hamcrest:2.2'
compileOnly 'org.junit.jupiter:junit-jupiter-api:5.9.0'
compileOnly 'org.junit.jupiter:junit-jupiter-params:5.9.0'
2023-01-27 02:34:46 +00:00
implementation 'net.java.dev.jna:jna-jpms:5.12.1'
implementation 'net.java.dev.jna:jna-platform-jpms:5.12.1'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "2.13.0"
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-parameter-names', version: "2.13.0"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: "2.13.0"
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: "2.13.0"
implementation group: 'org.kordamp.ikonli', name: 'ikonli-material2-pack', version: "12.2.0"
implementation group: 'org.kordamp.ikonli', name: 'ikonli-materialdesign2-pack', version: "12.2.0"
implementation group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: "12.2.0"
implementation group: 'org.kordamp.ikonli', name: 'ikonli-material-pack', version: "12.2.0"
2023-02-19 17:44:47 +00:00
implementation group: 'org.kordamp.ikonli', name: 'ikonli-feather-pack', version: "12.2.0"
implementation name: 'preferencesfx-core-11.15.0'
2023-01-29 09:49:58 +00:00
implementation group: 'com.dlsc.formsfx', name: 'formsfx-core', version: '11.6.0'
2023-01-27 02:34:46 +00:00
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.0'
implementation 'io.xpipe:modulefs:0.1.4'
implementation 'com.jfoenix:jfoenix:9.0.10'
implementation 'org.controlsfx:controlsfx:11.1.1'
implementation 'net.synedra:validatorfx:0.3.1'
2023-02-14 18:37:13 +00:00
implementation 'io.github.mkpaz:atlantafx-base:1.2.0'
2023-01-27 02:34:46 +00:00
}
apply from: "$rootDir/gradle/gradle_scripts/junit.gradle"
sourceSets {
main {
output.resourcesDir("$buildDir/classes/java/main")
}
}
dependencies {
testImplementation project(':api')
testImplementation project(':core')
}
2023-04-04 16:11:31 +00:00
project.allExtensions.forEach(p -> {
2023-01-27 02:34:46 +00:00
dependencies {
testCompileOnly p
}
})
List<String> jvmRunArgs = [
"--add-exports", "javafx.graphics/com.sun.javafx.scene=com.jfoenix",
"--add-exports", "javafx.graphics/com.sun.javafx.stage=com.jfoenix",
"--add-exports", "javafx.base/com.sun.javafx.binding=com.jfoenix",
"--add-exports", "javafx.base/com.sun.javafx.event=com.jfoenix",
"--add-exports", "javafx.controls/com.sun.javafx.scene.control=com.jfoenix",
"--add-exports", "javafx.controls/com.sun.javafx.scene.control.behavior=com.jfoenix",
"--add-exports", "javafx.graphics/com.sun.javafx.scene.traversal=org.controlsfx.controls",
"--add-exports", "javafx.graphics/com.sun.javafx.scene=org.controlsfx.controls",
2023-02-19 17:44:47 +00:00
"--add-exports", "org.apache.commons.lang3/org.apache.commons.lang3.math=io.xpipe.app",
2023-01-27 02:34:46 +00:00
"--add-opens", "java.base/java.lang.reflect=com.jfoenix",
"--add-opens", "java.base/java.lang.reflect=com.jfoenix",
2023-02-08 21:34:19 +00:00
"--add-opens", "java.base/java.lang=io.xpipe.core",
2023-01-27 02:34:46 +00:00
"--add-opens", "com.dustinredmond.fxtrayicon/com.dustinredmond.fxtrayicon=io.xpipe.app",
2023-02-19 17:44:47 +00:00
"--add-opens", "net.synedra.validatorfx/net.synedra.validatorfx=io.xpipe.app",
"--add-opens", 'com.dlsc.preferencesfx/com.dlsc.preferencesfx.view=io.xpipe.app',
2023-01-27 02:34:46 +00:00
"-Xmx8g",
"--enable-preview",
// "-XX:+ExitOnOutOfMemoryError",
"-Dfile.encoding=UTF-8",
"-Dvisualvm.display.name=X-Pipe"
]
test {
jvmArgs += jvmRunArgs
systemProperty 'io.xpipe.app.mode', 'background'
systemProperty 'io.xpipe.app.dataDir', "$projectDir/local_test/"
systemProperty 'io.xpipe.app.writeLogs', "false"
systemProperty 'io.xpipe.app.writeSysOut', "true"
systemProperty 'io.xpipe.app.developerMode', "true"
systemProperty 'io.xpipe.app.logLevel', "trace"
2023-02-19 17:44:47 +00:00
systemProperty 'io.xpipe.app.fullVersion', rootProject.fullVersion
2023-01-27 02:34:46 +00:00
//systemProperty "io.xpipe.beacon.port", "21722"
}
2023-04-04 16:11:31 +00:00
def extensionJarDepList = project.allExtensions.stream().map(p -> p.getTasksByName('jar', true)).toList();
2023-01-27 02:34:46 +00:00
jar {
finalizedBy(extensionJarDepList)
}
application {
mainModule = 'io.xpipe.app'
mainClass = 'io.xpipe.app.Main'
applicationDefaultJvmArgs = jvmRunArgs
}
run {
systemProperty 'io.xpipe.app.mode', 'gui'
systemProperty 'io.xpipe.app.dataDir', "$projectDir/local7/"
2023-01-27 02:34:46 +00:00
systemProperty 'io.xpipe.app.writeLogs', "true"
systemProperty 'io.xpipe.app.writeSysOut', "true"
systemProperty 'io.xpipe.app.developerMode', "true"
2023-03-19 19:38:29 +00:00
systemProperty 'io.xpipe.app.logLevel', "trace"
2023-02-19 17:44:47 +00:00
systemProperty 'io.xpipe.app.fullVersion', rootProject.fullVersion
// systemProperty "io.xpipe.beacon.port", "21724"
2023-01-27 02:34:46 +00:00
// systemProperty "io.xpipe.beacon.printMessages", "true"
// systemProperty 'io.xpipe.app.debugPlatform', "true"
// systemProperty "io.xpipe.beacon.localProxy", "true"
systemProperties System.getProperties()
systemProperty 'java.library.path', "./lib"
}
task runAttachedDebugger(type: JavaExec) {
classpath = run.classpath
mainModule = 'io.xpipe.app'
mainClass = 'io.xpipe.app.Main'
modularity.inferModulePath = true
jvmArgs += jvmRunArgs
jvmArgs += List.of(
"-javaagent:${System.getProperty("user.home")}/.attachme/attachme-agent-1.2.1.jar=port:7857,host:localhost",
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:0"
)
systemProperties run.systemProperties
}
task writeBuildProperties(type: DefaultTask) {
doLast {
def resourcesDir = new File(sourceSets.main.output.resourcesDir, "io/xpipe/app/resources")
resourcesDir.mkdirs()
def contents = "version=$appVersion\n" +
2023-02-01 10:05:26 +00:00
"build=$appVersion-${new Date().format('yyyyMMddHHmm')}\n"
2023-01-27 02:34:46 +00:00
new File(resourcesDir, "app.properties").text = contents
}
}
processResources.finalizedBy(writeBuildProperties)
task writeLicenses(type: DefaultTask) {
doLast {
def resourcesDir = new File(sourceSets.main.output.resourcesDir, "io/xpipe/app/resources/third-party")
resourcesDir.mkdirs()
copy {
from "$rootDir/dist/licenses"
into resourcesDir
}
}
}
processResources.finalizedBy(writeLicenses)
distTar {
enabled = false;
}
distZip {
enabled = false;
}