Files
sheepit-shadow-nabber/build.gradle
2024-10-25 11:26:22 +02:00

72 lines
1.7 KiB
Groovy

plugins {
id 'java-library'
id 'application'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'pmd'
}
java {
sourceCompatibility = 11
targetCompatibility = 11
}
tasks.register('generateVersionFile') {
def stdout = new ByteArrayOutputStream()
def result = exec {
ignoreExitValue true
commandLine "git", "describe", "--tags", "--always"
standardOutput = stdout
}
if (result.getExitValue() == 0) {
new File(projectDir, "src/main/resources/VERSION").text = stdout.toString() - "v"
} else {
logger.warn("Warning: automatic version detection failed")
}
}
shadowJar {
exclude 'OSGI-OPT/' // args4j garbage
}
tasks.shadowJar.dependsOn(generateVersionFile)
repositories {
mavenCentral()
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
implementation 'args4j:args4j:2.33'
implementation 'net.lingala.zip4j:zip4j:2.11.+'
implementation 'net.java.dev.jna:jna-platform:5.12.+'
implementation 'com.github.oshi:oshi-core:6.2.+'
implementation 'org.simpleframework:simple-xml:2.7.+'
implementation 'com.formdev:flatlaf:2.2' // 2.3+ causes illegal reflective access warning on win + adoptium java 11.0.16
implementation 'com.squareup.okhttp3:okhttp:4.12.+'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.12.+'
implementation 'org.slf4j:slf4j-nop:1.7.36'
}
application {
mainClass = "com.sheepit.client.standalone.Worker"
}
jar {
manifest {
attributes "Main-Class": "com.sheepit.client.standalone.Worker"
}
from {
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
duplicatesStrategy "exclude"
}
}
pmd {
toolVersion = "7.2.0"
ignoreFailures = false
ruleSetFiles = files("rulesets/java-sheepit.xml")
ruleSets = []
}