Skip to content

Commit

Permalink
Add support for Maven Local publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Oct 16, 2024
1 parent adad380 commit dd25399
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}

// Disable the default publish task if it exists
tasks.replace("publish").dependsOn(":fabric:publish", ":neoforge:publish")
tasks.replace("publishToMavenLocal").dependsOn(":fabric:publishToMavenLocal", ":neoforge:publishToMavenLocal")

tasks.jar {
enabled = false
}
Expand Down
12 changes: 12 additions & 0 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,16 @@ tasks {
}

remapJar.get().destinationDirectory = rootDir.resolve("build").resolve("libs")
}

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "net.caffeinemc"
artifactId = "sodium-fabric"
version = project.version.toString()

from(components["java"])
}
}
}
12 changes: 12 additions & 0 deletions neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ dependencies {
jarJar(project(":neoforge", "serviceConfig"))
}

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "net.caffeinemc"
artifactId = "sodium-neoforge"
version = project.version.toString()

from(components["java"])
}
}
}

tasks.jar {
val api = project.project(":common").sourceSets.getByName("api")
from(api.output.classesDirs)
Expand Down

0 comments on commit dd25399

Please sign in to comment.