2021-05-11 15:36:59 +00:00
|
|
|
plugins {
|
|
|
|
|
id 'java-library'
|
2023-11-08 12:00:44 +01:00
|
|
|
id 'application'
|
2024-06-06 00:25:23 +00:00
|
|
|
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
2024-06-03 14:02:30 +00:00
|
|
|
id 'pmd'
|
2019-08-10 22:09:32 +02:00
|
|
|
}
|
|
|
|
|
|
2024-06-06 00:25:23 +00:00
|
|
|
java {
|
|
|
|
|
sourceCompatibility = 11
|
|
|
|
|
targetCompatibility = 11
|
2020-04-09 23:39:09 +08:00
|
|
|
}
|
|
|
|
|
|
2024-06-06 00:25:23 +00:00
|
|
|
tasks.register('generateVersionFile') {
|
2022-02-19 14:20:08 +01:00
|
|
|
def stdout = new ByteArrayOutputStream()
|
|
|
|
|
def result = exec {
|
|
|
|
|
ignoreExitValue true
|
|
|
|
|
commandLine "git", "describe", "--tags", "--always"
|
|
|
|
|
standardOutput = stdout
|
|
|
|
|
}
|
2024-06-06 00:25:23 +00:00
|
|
|
if (result.getExitValue() == 0) {
|
2022-02-19 14:20:08 +01:00
|
|
|
new File(projectDir, "src/main/resources/VERSION").text = stdout.toString() - "v"
|
|
|
|
|
} else {
|
|
|
|
|
logger.warn("Warning: automatic version detection failed")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-26 21:29:48 +08:00
|
|
|
shadowJar {
|
|
|
|
|
exclude 'OSGI-OPT/' // args4j garbage
|
|
|
|
|
}
|
2022-02-19 14:20:08 +01:00
|
|
|
tasks.shadowJar.dependsOn(generateVersionFile)
|
2020-04-26 21:29:48 +08:00
|
|
|
|
2019-08-10 22:09:32 +02:00
|
|
|
repositories {
|
|
|
|
|
mavenCentral()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2022-07-29 23:27:10 +00:00
|
|
|
compileOnly 'org.projectlombok:lombok:1.18.24'
|
|
|
|
|
annotationProcessor 'org.projectlombok:lombok:1.18.24'
|
2020-04-14 23:24:28 +10:00
|
|
|
|
2021-05-11 15:36:59 +00:00
|
|
|
implementation 'args4j:args4j:2.33'
|
2024-10-25 11:26:22 +02:00
|
|
|
implementation 'net.lingala.zip4j:zip4j:2.11.+'
|
|
|
|
|
implementation 'net.java.dev.jna:jna-platform:5.12.+'
|
2025-01-11 18:12:25 +00:00
|
|
|
implementation 'com.github.oshi:oshi-core:6.6.+'
|
2024-10-25 11:26:22 +02:00
|
|
|
implementation 'org.simpleframework:simple-xml:2.7.+'
|
2022-08-29 15:58:47 +00:00
|
|
|
implementation 'com.formdev:flatlaf:2.2' // 2.3+ causes illegal reflective access warning on win + adoptium java 11.0.16
|
2024-10-25 11:26:22 +02:00
|
|
|
implementation 'com.squareup.okhttp3:okhttp:4.12.+'
|
|
|
|
|
implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.12.+'
|
2025-04-22 18:31:46 +02:00
|
|
|
implementation 'org.slf4j:slf4j-simple:2.0.12'
|
2024-12-28 13:55:44 +01:00
|
|
|
implementation 'commons-io:commons-io:2.11.0'
|
2025-03-28 09:29:04 +00:00
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.+'
|
|
|
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
2019-08-10 22:09:32 +02:00
|
|
|
}
|
|
|
|
|
|
2024-06-06 00:25:23 +00:00
|
|
|
application {
|
2024-12-14 13:54:56 +00:00
|
|
|
mainClass = "com.sheepit.client.main.Worker"
|
2024-06-06 00:25:23 +00:00
|
|
|
}
|
2023-11-08 12:00:44 +01:00
|
|
|
|
2019-08-10 22:09:32 +02:00
|
|
|
jar {
|
|
|
|
|
manifest {
|
2024-12-14 13:54:56 +00:00
|
|
|
attributes "Main-Class": "com.sheepit.client.main.Worker"
|
2019-08-10 22:09:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
from {
|
2024-06-06 00:25:23 +00:00
|
|
|
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
|
|
|
|
duplicatesStrategy "exclude"
|
2019-08-10 22:09:32 +02:00
|
|
|
}
|
|
|
|
|
}
|
2024-06-03 14:02:30 +00:00
|
|
|
|
|
|
|
|
pmd {
|
2024-06-10 16:34:12 +00:00
|
|
|
toolVersion = "7.2.0"
|
2024-06-03 14:02:30 +00:00
|
|
|
ignoreFailures = false
|
|
|
|
|
ruleSetFiles = files("rulesets/java-sheepit.xml")
|
|
|
|
|
ruleSets = []
|
|
|
|
|
}
|
2025-03-28 09:29:04 +00:00
|
|
|
|
|
|
|
|
tasks.named('test', Test) {
|
|
|
|
|
useJUnitPlatform()
|
|
|
|
|
|
|
|
|
|
maxHeapSize = '1G'
|
|
|
|
|
|
|
|
|
|
testLogging {
|
|
|
|
|
events "passed"
|
|
|
|
|
}
|
|
|
|
|
}
|