diff --git a/common/build.gradle b/common/build.gradle index 8ae0d73..41a48d6 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -31,6 +31,8 @@ tasks.withType(JavaCompile).configureEach { java { sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 + + withSourcesJar() } jar { diff --git a/fabric/build.gradle b/fabric/build.gradle index 2cc75ca..d2136e5 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -87,6 +87,10 @@ processResources { filesMatching("fabric.mod.json") { expand props } + + from("LICENSE") { + rename {"${it}_${project.base.archivesName.get()}"} + } } tasks.withType(JavaCompile).configureEach { @@ -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 { @@ -110,6 +113,10 @@ jar { } } +sourcesJar { + from(project(':common').sourceSets.main.allSource) +} + // configure the maven publication publishing { publications { diff --git a/paper/build.gradle b/paper/build.gradle index aea6c83..ef6e1c4 100644 --- a/paper/build.gradle +++ b/paper/build.gradle @@ -44,6 +44,10 @@ processResources { filesMatching('plugin.yml') { expand props } + + from("LICENSE") { + rename {"${it}_${project.base.archivesName.get()}"} + } } def targetJavaVersion = 21 @@ -54,6 +58,8 @@ java { if (JavaVersion.current() < javaVersion) { toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) } + + withSourcesJar() } tasks.withType(JavaCompile).configureEach { @@ -113,6 +119,10 @@ jar { } } +sourcesJar { + from(project(':common').sourceSets.main.allSource) +} + publishing { publications { mavenJava(MavenPublication) {