Skip to content

Commit

Permalink
Generate sources jars
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Aug 5, 2024
1 parent 49ff57e commit 452575d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ subprojects {
apply(plugin = "maven-publish")

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

java.withSourcesJar()

fun createVersionString(): String {
val builder = StringBuilder()
Expand Down
7 changes: 7 additions & 0 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ tasks {
}
}

// Merge common sources into platform sources jar
tasks.named<Jar>("sourcesJar") {
val commonSourcesJar = project(":common").tasks.getByName<Jar>("sourcesJar")
dependsOn(commonSourcesJar)
from(commonSourcesJar.archiveFile.map { zipTree(it) })
}

publishing {
publications {
register("mavenJava", MavenPublication::class) {
Expand Down
7 changes: 7 additions & 0 deletions neoforge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ tasks.named("compileTestJava").configure {
enabled = false
}

// Merge common sources into platform sources jar
tasks.named<Jar>("sourcesJar") {
val commonSourcesJar = project(":common").tasks.getByName<Jar>("sourcesJar")
dependsOn(commonSourcesJar)
from(commonSourcesJar.archiveFile.map { zipTree(it) })
}

publishing {
publications {
register("mavenJava", MavenPublication::class) {
Expand Down

0 comments on commit 452575d

Please sign in to comment.