aboutsummaryrefslogtreecommitdiff
path: root/agent/build.gradle.kts
blob: 3be50bcef6d031275f40dbe3c1708cc0f745b856 (plain)
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
plugins {
    java
    id("com.github.johnrengelman.shadow") version "7.1.2"
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(11))
}


val shadowOnly: Configuration by configurations.creating {
}

dependencies {
    implementation("org.ow2.asm:asm:9.7")
    implementation("org.ow2.asm:asm-commons:9.7")
    shadowOnly("dev.architectury:architectury-pack200:0.1.3")
    shadowOnly("org.apache.commons:commons-lang3:3.13.0")
}
tasks.withType(Jar::class) {
    manifest {
        attributes.apply {
            this["Premain-Class"] = "moe.nea.modernjava.agent.Pack200Retransformer"
        }
    }
}

tasks.shadowJar {
    archiveClassifier.set("")
    configurations = listOf(shadowOnly)
}
tasks.jar {
    archiveClassifier.set("thin")
}
tasks.assemble.get().dependsOn(tasks.shadowJar)

configurations.create("agentShadow")
artifacts {
    add("agentShadow", tasks.shadowJar)
}