xpipe/gradle/gradle_scripts/extension.gradle
crschnick 3e7fbe89ac Merge branch prefs into master
The changes have been squashed as the commit history and messages were not very carefully crafted. There isn't that much value in preserving random commit messages.

Also due to diverging branches, rebasing or merging it was difficult.
2024-02-28 07:36:31 +00:00

84 lines
2.7 KiB
Groovy

//task copyRuntimeLibs(type: Copy) {
// into project.jar.destinationDirectory
// from configurations.runtimeClasspath
// exclude "${project.name}.jar"
// duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
//}
// Do we need this?
// jar.dependsOn(copyRuntimeLibs)
def dev = tasks.register('createDevOutput', Copy) {
mustRunAfter jar
if (project.allExtensions.contains(project)) {
var source = "${project.jar.destinationDirectory.get()}"
from source
into "${project.rootDir}/app/build/ext_dev/$project.name"
}
}
jar.finalizedBy(dev)
tasks.register('createExtOutput', Copy) {
mustRunAfter jar
if (!file("${project.jar.destinationDirectory.get()}_prod").exists()) {
copy {
from "${project.jar.destinationDirectory.get()}"
into "${project.jar.destinationDirectory.get()}_prod"
}
}
def shouldObfuscate = rootProject.obfuscate && rootProject.privateExtensions.contains(project.name)
var source = shouldObfuscate ? "${project.jar.destinationDirectory.get()}_prod" : "${project.jar.destinationDirectory.get()}"
from source
into "${project.jar.destinationDirectory.get()}_ext"
}
project.tasks.withType(org.gradle.jvm.tasks.Jar).configureEach {
if (it.name != 'jar') {
it.destinationDirectory = project.layout.buildDirectory.dir('libs_test')
}
}
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
apply from: "$rootDir/gradle/gradle_scripts/javafx.gradle"
apply from: "$rootDir/gradle/gradle_scripts/lombok.gradle"
apply from: "$rootDir/gradle/gradle_scripts/local_junit_suite.gradle"
localTest {
dependencies {
if (project.name != 'base') {
implementation project(':base')
}
testImplementation project(":$project.name")
}
}
configurations {
compileOnly.extendsFrom(javafx)
}
dependencies {
compileOnly group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "2.16.1"
compileOnly project(':core')
compileOnly project(':beacon')
compileOnly project(':app')
compileOnly 'net.synedra:validatorfx:0.4.2'
compileOnly ('io.github.mkpaz:atlantafx-base:2.0.1') {
exclude group: 'org.openjfx', module: 'javafx-base'
exclude group: 'org.openjfx', module: 'javafx-controls'
}
compileOnly 'commons-io:commons-io:2.15.1'
compileOnly group: 'org.kordamp.ikonli', name: 'ikonli-javafx', version: "12.2.0"
if (project != project(':base')) {
compileOnly project(':base')
}
}
// To fix https://github.com/gradlex-org/extra-java-module-info/issues/101#issuecomment-1934761334
configurations.javaModulesMergeJars.shouldResolveConsistentlyWith(configurations.compileClasspath)