-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
78 lines (66 loc) · 3.03 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
plugins {
java
}
repositories {
mavenLocal()
maven {
url = uri("https://repo.runelite.net")
}
mavenCentral()
}
dependencies {
val lombokVersion = "1.18.30" // supports JDK 21 and is verified by runelite
// old annotation processor approach due to runelite plugin hub verification restrictions
compileOnly(group = "org.projectlombok", name = "lombok", version = lombokVersion)
annotationProcessor(group = "org.projectlombok", name = "lombok", version = lombokVersion)
testCompileOnly(group = "org.projectlombok", name = "lombok", version = lombokVersion)
testAnnotationProcessor(group = "org.projectlombok", name = "lombok", version = lombokVersion)
// this version of annotations is verified by runelite
compileOnly(group = "org.jetbrains", name = "annotations", version = "23.0.0")
val runeLiteVersion = "latest.release"
compileOnly(group = "net.runelite", name = "client", version = runeLiteVersion)
testImplementation(group = "net.runelite", name = "client", version = runeLiteVersion)
testImplementation(group = "net.runelite", name = "jshell", version = runeLiteVersion)
val junitVersion = "5.5.2" // max version before junit-bom was added to pom files, due to runelite restrictions
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter-api", version = junitVersion)
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter-params", version = junitVersion)
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter-engine", version = junitVersion)
// mocking and test injection used by runelite client
testImplementation(group = "org.mockito", name = "mockito-core", version = "4.11.0") // runelite uses 3.1.0
testImplementation(group = "com.google.inject.extensions", name = "guice-testlib", version = "4.1.0") {
exclude(group = "com.google.inject", module = "guice") // already provided by runelite client
}
}
group = "io.cbitler.stealingartefacts"
version = "1.3"
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
val version = JavaVersion.VERSION_11.toString()
sourceCompatibility = version
targetCompatibility = version
}
tasks.test {
useJUnitPlatform()
}
tasks.register(name = "shadowJar", type = Jar::class) {
dependsOn(configurations.testRuntimeClasspath)
manifest {
attributes(mapOf("Main-Class" to "io.cbitler.stealingartefacts.StealingArtefactsPluginTest"))
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(sourceSets.main.get().output)
from(sourceSets.test.get().output)
from({
configurations.testRuntimeClasspath.get().map {
if (it.isDirectory) it else zipTree(it)
}
})
exclude("META-INF/INDEX.LIST")
exclude("META-INF/*.SF")
exclude("META-INF/*.DSA")
exclude("META-INF/*.RSA")
exclude("**/module-info.class")
group = BasePlugin.BUILD_GROUP
archiveClassifier.set("shadow")
archiveFileName.set(rootProject.name.replace(" ", "-").toLowerCase() + "-" + project.version + "-all.jar")
}