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-02-13 11:26:19 +01:00
|
|
|
implementation("com.lmax:disruptor:3.4.2")
|
2020-07-26 08:40:46 +02:00
|
|
|
implementation("org.java-websocket:Java-WebSocket:1.5.1")
|
|
|
|
implementation("org.jsoup:jsoup:1.8.1")
|
|
|
|
implementation("org.json:json:20190722")
|
|
|
|
implementation("commons-configuration:commons-configuration:1.7")
|
|
|
|
implementation("commons-cli:commons-cli:1.2")
|
|
|
|
implementation("commons-io:commons-io:1.3.2")
|
|
|
|
implementation("org.apache.httpcomponents:httpclient:4.3.6")
|
|
|
|
implementation("org.apache.httpcomponents:httpmime:4.3.3")
|
2021-02-13 11:26:19 +01:00
|
|
|
implementation("org.apache.logging.log4j:log4j-api:2.14.1")
|
|
|
|
implementation("org.apache.logging.log4j:log4j-core:2.14.1")
|
2020-07-26 08:40:46 +02:00
|
|
|
implementation("org.graalvm.js:js:20.1.0")
|
|
|
|
testImplementation(enforcedPlatform("org.junit:junit-bom:5.6.2"))
|
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
|
|
testImplementation("junit:junit:4.13")
|
|
|
|
}
|
|
|
|
|
|
|
|
group = "com.rarchives.ripme"
|
|
|
|
version = "1.7.94"
|
|
|
|
description = "ripme"
|
|
|
|
|
2021-02-22 02:41:39 +01:00
|
|
|
jgitver {
|
|
|
|
gitCommitIDLength = 8
|
|
|
|
nonQualifierBranches = "main,master"
|
|
|
|
useGitCommitID = true
|
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
2020-07-26 08:40:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<Jar> {
|
|
|
|
manifest {
|
|
|
|
attributes["Main-Class"] = "com.rarchives.ripme.App"
|
2021-02-28 15:26:27 +01:00
|
|
|
attributes["Implementation-Version"] = archiveVersion
|
|
|
|
|
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 {
|
|
|
|
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 {
|
|
|
|
xml.isEnabled = false
|
|
|
|
csv.isEnabled = false
|
|
|
|
html.destination = file("${buildDir}/jacocoHtml")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|