diff --git a/buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarTaskSet.kt b/buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarTaskSet.kt index da7fa4e1b..69cf75170 100644 --- a/buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarTaskSet.kt +++ b/buildSrc/src/main/kotlin/dev/engine_room/gradle/jarset/JarTaskSet.kt @@ -30,11 +30,19 @@ class JarTaskSet( val remapSources: TaskProvider ) { - fun publish(artifactId: String) { + fun publishWithRawSources(artifactId: String) { + publish(artifactId, sources) + } + + fun publishWithRemappedSources(artifactId: String) { + publish(artifactId, remapSources) + } + + private fun publish(artifactId: String, sourceJar: TaskProvider) { project.the().publications { register("${name}RemapMaven") { artifact(remapJar) - artifact(remapSources) + artifact(sourceJar) artifact(javadocJar) this.artifactId = artifactId } diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 4efe08229..f90803543 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -58,7 +58,7 @@ jarSets { // For publishing. create("api", api, lib).apply { addToAssemble() - publish("flywheel-common-intermediary-api-${property("artifact_minecraft_version")}") + publishWithRemappedSources("flywheel-common-intermediary-api-${property("artifact_minecraft_version")}") configureJar { manifest { @@ -75,7 +75,7 @@ jarSets { targetNamespace = "named" } - publish("flywheel-common-mojmap-api-${property("artifact_minecraft_version")}") + publishWithRawSources("flywheel-common-mojmap-api-${property("artifact_minecraft_version")}") } } } diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index e9edf9108..20fd36821 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -67,12 +67,12 @@ platform { } jarSets { - mainSet.publish("flywheel-fabric-${project.property("artifact_minecraft_version")}") + mainSet.publishWithRemappedSources("flywheel-fabric-${project.property("artifact_minecraft_version")}") mainSet.outgoing("flywheel") create("api", api, lib).apply { addToAssemble() - publish("flywheel-fabric-api-${project.property("artifact_minecraft_version")}") + publishWithRemappedSources("flywheel-fabric-api-${project.property("artifact_minecraft_version")}") configureJar { manifest { diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index fdd825e1e..fe113bfa3 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -65,12 +65,12 @@ platform { } jarSets { - mainSet.publish("flywheel-forge-${project.property("artifact_minecraft_version")}") + mainSet.publishWithRawSources("flywheel-forge-${project.property("artifact_minecraft_version")}") mainSet.outgoing("flywheel") create("api", api, lib).apply { addToAssemble() - publish("flywheel-forge-api-${project.property("artifact_minecraft_version")}") + publishWithRawSources("flywheel-forge-api-${project.property("artifact_minecraft_version")}") configureJar { manifest { diff --git a/vanillinFabric/build.gradle.kts b/vanillinFabric/build.gradle.kts index 455da11d1..2e036033b 100644 --- a/vanillinFabric/build.gradle.kts +++ b/vanillinFabric/build.gradle.kts @@ -27,7 +27,7 @@ transitiveSourceSets { } jarSets { - mainSet.publish("vanillin-fabric-${project.property("artifact_minecraft_version")}") + mainSet.publishWithRemappedSources("vanillin-fabric-${project.property("artifact_minecraft_version")}") } defaultPackageInfos { diff --git a/vanillinForge/build.gradle.kts b/vanillinForge/build.gradle.kts index b7f1a8170..4941a5106 100644 --- a/vanillinForge/build.gradle.kts +++ b/vanillinForge/build.gradle.kts @@ -27,7 +27,7 @@ transitiveSourceSets { } jarSets { - mainSet.publish("vanillin-forge-${project.property("artifact_minecraft_version")}") + mainSet.publishWithRawSources("vanillin-forge-${project.property("artifact_minecraft_version")}") } defaultPackageInfos {