Skip to content

Commit

Permalink
fix gradle and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Feb 7, 2024
1 parent a081137 commit 34d87eb
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,29 @@ subprojects {
isCanBeConsumed = false
isCanBeResolved = true
}
val versionWithMCVersion = "${project.properties["mod_version"]!!}+${project.properties["minecraft_version"]!!}"

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release = 17
}

tasks {
"shadowJar"(ShadowJar::class) {
archiveClassifier.set("dev-shadow")
val shadowJarTask = named("shadowJar", ShadowJar::class)
shadowJarTask {
archiveVersion = versionWithMCVersion
archiveClassifier.set("shadow")
configurations = listOf(shadowCommon)
exclude(
"org/intellij/**", "org/objectweb/**", "org/jetbrains/**", "com/google/**",
"net/fabricmc/**", "client-fabric-**", "CREDITS.txt",
"fabric-installer**", "fabric-lifecycle-events**", "fabric-networking**", "fabric-rendering**",
"LICENSE-**", "LICENSE_**", "assets/fabric-api-base/**", "assets/fabricloader/**",
"META-INF/jars/**", "META-INF/maven/**", "META-INF/services/net.f"
)
}

"remapJar"(RemapJarTask::class) {
dependsOn("shadowJar")
inputFile.set(named<ShadowJar>("shadowJar").flatMap { it.archiveFile })
dependsOn(shadowJarTask)
inputFile = shadowJarTask.flatMap { it.archiveFile }
archiveVersion = versionWithMCVersion
archiveClassifier = ""
}
jar {
enabled = false
}
}
}
Expand Down Expand Up @@ -81,8 +82,4 @@ allprojects {
options.encoding = "UTF-8"
options.release = 17
}

java {
withSourcesJar()
}
}

0 comments on commit 34d87eb

Please sign in to comment.