Skip to content

Commit

Permalink
Add api jar
Browse files Browse the repository at this point in the history
  • Loading branch information
LLytho authored and rlnt committed Aug 22, 2024
1 parent ed61d56 commit 1a3cd06
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ val modId: String by project
val modName: String by project
val modDescription: String by project
val modAuthor: String by project
val modPackage: String by project
val autoServiceVersion: String by project
val parchmentVersion: String by project
val fabricApiVersion: String by project
Expand Down Expand Up @@ -103,6 +104,18 @@ subprojects {
}

tasks {
val apiJar = register<Jar>("apiJar") {
val remapJar = named<RemapJarTask>("remapJar")
archiveClassifier.set("api")
dependsOn(remapJar)
from(zipTree(remapJar.get().archiveFile))
include(modPackage.replace('.', '/') + "/api/**")
}

build {
dependsOn(apiJar)
}

/**
* resource processing for defined targets
* will replace `${key}` with the specified values from the map below
Expand Down Expand Up @@ -150,6 +163,11 @@ subprojects {
register(mpm, MavenPublication::class) {
artifactId = base.archivesName.get()
from(components["java"])

val apiJarTask = tasks.named<Jar>("apiJar")
artifact(apiJarTask) {
classifier = "api"
}
}
}

Expand Down

0 comments on commit 1a3cd06

Please sign in to comment.