2022-02-12 10:36:28 +01:00
|
|
|
// permits to start the build setting the javac release parameter, no parameter means build for java8:
|
|
|
|
// gradle clean build -PjavacRelease=8
|
|
|
|
// gradle clean build -PjavacRelease=17
|
2023-07-30 04:45:14 +02:00
|
|
|
val javacRelease = (project.findProperty("javacRelease") ?: "17") as String
|
2022-02-12 10:36:28 +01:00
|
|
|
|
2020-07-26 08:40:46 +02:00
|
|
|
plugins {
|
2021-02-22 02:41:39 +01:00
|
|
|
id("fr.brouillard.oss.gradle.jgitver") version "0.9.1"
|
2020-07-26 19:41:16 +02:00
|
|
|
id("jacoco")
|
2020-07-26 08:40:46 +02:00
|
|
|
id("java")
|
|
|
|
id("maven-publish")
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenLocal()
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2021-12-20 02:11:06 +01:00
|
|
|
implementation("com.lmax:disruptor:3.4.4")
|
2023-06-11 02:30:11 +02:00
|
|
|
implementation("org.java-websocket:Java-WebSocket:1.5.3")
|
|
|
|
implementation("org.jsoup:jsoup:1.16.1")
|
2021-12-20 02:11:06 +01:00
|
|
|
implementation("org.json:json:20211205")
|
2023-06-11 02:30:11 +02:00
|
|
|
implementation("com.j2html:j2html:1.6.0")
|
2021-12-20 02:11:06 +01:00
|
|
|
implementation("commons-configuration:commons-configuration:1.10")
|
|
|
|
implementation("commons-cli:commons-cli:1.5.0")
|
2023-06-11 02:30:11 +02:00
|
|
|
implementation("commons-io:commons-io:2.13.0")
|
|
|
|
implementation("org.apache.httpcomponents:httpclient:4.5.14")
|
|
|
|
implementation("org.apache.httpcomponents:httpmime:4.5.14")
|
|
|
|
implementation("org.apache.logging.log4j:log4j-api:2.20.0")
|
|
|
|
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
|
|
|
|
implementation("org.graalvm.js:js:22.3.2")
|
|
|
|
testImplementation(enforcedPlatform("org.junit:junit-bom:5.9.3"))
|
2020-07-26 08:40:46 +02:00
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
|
|
}
|
|
|
|
|
|
|
|
group = "com.rarchives.ripme"
|
|
|
|
version = "1.7.94"
|
|
|
|
description = "ripme"
|
|
|
|
|
2023-06-11 02:30:11 +02:00
|
|
|
jacoco {
|
|
|
|
toolVersion = "0.8.10"
|
|
|
|
}
|
|
|
|
|
2021-02-22 02:41:39 +01:00
|
|
|
jgitver {
|
|
|
|
gitCommitIDLength = 8
|
|
|
|
nonQualifierBranches = "main,master"
|
|
|
|
useGitCommitID = true
|
|
|
|
}
|
|
|
|
|
2022-02-12 10:36:28 +01:00
|
|
|
tasks.compileJava {
|
2022-02-28 00:42:06 +01:00
|
|
|
options.release.set(Integer.parseInt(javacRelease))
|
2020-07-26 08:40:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<Jar> {
|
2021-05-08 16:57:52 +02:00
|
|
|
duplicatesStrategy = DuplicatesStrategy.INCLUDE
|
2020-07-26 08:40:46 +02:00
|
|
|
manifest {
|
|
|
|
attributes["Main-Class"] = "com.rarchives.ripme.App"
|
2021-02-28 15:26:27 +01:00
|
|
|
attributes["Implementation-Version"] = archiveVersion
|
2021-04-16 06:41:47 +02:00
|
|
|
attributes["Multi-Release"] = "true"
|
2020-07-26 08:40:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// To add all of the dependencies otherwise a "NoClassDefFoundError" error
|
|
|
|
from(sourceSets.main.get().output)
|
|
|
|
|
|
|
|
dependsOn(configurations.runtimeClasspath)
|
|
|
|
from({
|
|
|
|
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
create<MavenPublication>("maven") {
|
|
|
|
from(components["java"])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<JavaCompile> {
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.test {
|
2021-10-03 19:20:22 +02:00
|
|
|
testLogging {
|
|
|
|
showStackTraces = true
|
|
|
|
}
|
2020-07-26 08:40:46 +02:00
|
|
|
useJUnitPlatform {
|
2020-07-30 07:21:13 +02:00
|
|
|
// gradle-6.5.1 not yet allows passing this as parameter, so exclude it
|
2020-11-21 11:08:59 +01:00
|
|
|
excludeTags("flaky","slow")
|
2020-07-26 08:40:46 +02:00
|
|
|
includeEngines("junit-jupiter")
|
|
|
|
includeEngines("junit-vintage")
|
|
|
|
}
|
2020-07-26 19:41:16 +02:00
|
|
|
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
|
2020-07-26 08:40:46 +02:00
|
|
|
}
|
2020-07-26 19:09:15 +02:00
|
|
|
|
2021-02-28 10:59:09 +01:00
|
|
|
tasks.register<Test>("testAll") {
|
2020-07-30 07:21:13 +02:00
|
|
|
useJUnitPlatform {
|
2021-02-28 10:59:09 +01:00
|
|
|
includeTags("any()", "none()")
|
2020-07-30 07:21:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-28 10:36:30 +02:00
|
|
|
tasks.register<Test>("testFlaky") {
|
|
|
|
useJUnitPlatform {
|
|
|
|
includeTags("flaky")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register<Test>("testSlow") {
|
|
|
|
useJUnitPlatform {
|
|
|
|
includeTags("slow")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register<Test>("testTagged") {
|
|
|
|
useJUnitPlatform {
|
|
|
|
includeTags("any()")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-26 19:09:15 +02:00
|
|
|
// make all archive tasks in the build reproducible
|
|
|
|
tasks.withType<AbstractArchiveTask>().configureEach {
|
|
|
|
isPreserveFileTimestamps = false
|
|
|
|
isReproducibleFileOrder = true
|
|
|
|
}
|
|
|
|
|
2020-07-26 19:41:16 +02:00
|
|
|
tasks.jacocoTestReport {
|
|
|
|
dependsOn(tasks.test) // tests are required to run before generating the report
|
|
|
|
reports {
|
2021-12-30 01:57:47 +01:00
|
|
|
xml.required.set(false)
|
|
|
|
csv.required.set(false)
|
|
|
|
html.outputLocation.set(file("${buildDir}/jacocoHtml"))
|
2020-07-26 19:41:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|