Skip to content

Commit

Permalink
improved build script
Browse files Browse the repository at this point in the history
  • Loading branch information
phinner committed Nov 21, 2022
1 parent 1d6126d commit afd916d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions distributor-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies {

val slf4j = "2.0.3"
api("org.slf4j:slf4j-api:$slf4j")
testRuntimeOnly("org.slf4j:slf4j-simple:$slf4j")

val geantyref = "1.3.13"
api("io.leangen.geantyref:geantyref:$geantyref")
Expand Down
16 changes: 15 additions & 1 deletion distributor-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ dependencies {
implementation(project(":distributor-api"))
implementation("org.spongepowered:configurate-yaml:4.1.2")
implementation("org.aeonbits.owner:owner-java8:1.0.12")

annotationProcessor("cloud.commandframework:cloud-annotations:${Versions.cloud}")
}

Expand All @@ -20,11 +19,26 @@ metadata.displayName = "Distributor"
metadata.main = "fr.xpdustry.distributor.core.DistributorPlugin"

tasks.shadowJar {
archiveClassifier.set("plugin")

doFirst {
val temp = temporaryDir.resolve("plugin.json")
temp.writeText(metadata.toJson(true))
from(temp)
}

minimize {
exclude(dependency("fr.xpdustry:distributor-.*:.*"))
exclude(dependency("cloud.commandframework:cloud-.*:.*"))
exclude(dependency("org.slf4j:slf4j-api:.*"))
exclude(dependency("io.leangen.geantyref:geantyref:.*"))
}

val shadowPackage = "fr.xpdustry.distributor.core.internal.shadow"
relocate("org.spongepowered.configurate", "$shadowPackage.configurate")
relocate("org.aeonbits.owner", "$shadowPackage.owner")
relocate("org.yaml.snakeyaml", "$shadowPackage.snakeyaml")

from(rootProject.file("LICENSE.md")) {
into("META-INF")
}
Expand Down

0 comments on commit afd916d

Please sign in to comment.