Skip to content

Commit

Permalink
Add sources JAR
Browse files Browse the repository at this point in the history
  • Loading branch information
xpple committed Oct 9, 2024
1 parent 90e249c commit dd7c140
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ tasks.withType(JavaCompile).configureEach {
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

withSourcesJar()
}

jar {
Expand Down
13 changes: 10 additions & 3 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ processResources {
filesMatching("fabric.mod.json") {
expand props
}

from("LICENSE") {
rename {"${it}_${project.base.archivesName.get()}"}
}
}

tasks.withType(JavaCompile).configureEach {
Expand All @@ -96,12 +100,11 @@ tasks.withType(JavaCompile).configureEach {
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21

withSourcesJar()
}

jar {
from("LICENSE") {
rename {"${it}_${project.base.archivesName.get()}"}
}
dependsOn ':common:remapJar'
from {
configurations.includeInJar.collect {
Expand All @@ -110,6 +113,10 @@ jar {
}
}

sourcesJar {
from(project(':common').sourceSets.main.allSource)
}

// configure the maven publication
publishing {
publications {
Expand Down
10 changes: 10 additions & 0 deletions paper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ processResources {
filesMatching('plugin.yml') {
expand props
}

from("LICENSE") {
rename {"${it}_${project.base.archivesName.get()}"}
}
}

def targetJavaVersion = 21
Expand All @@ -54,6 +58,8 @@ java {
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}

withSourcesJar()
}

tasks.withType(JavaCompile).configureEach {
Expand Down Expand Up @@ -113,6 +119,10 @@ jar {
}
}

sourcesJar {
from(project(':common').sourceSets.main.allSource)
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down

0 comments on commit dd7c140

Please sign in to comment.