Skip to content

Commit

Permalink
update buildscript - publish shaded jars properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchej123 committed Jan 18, 2022
1 parent a3387f0 commit 3ce7023
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1642464427
//version: 1642484596
/*
DO NOT CHANGE THIS FILE!
Expand Down Expand Up @@ -88,6 +88,7 @@ checkPropertyExists("containsMixinsAndOrCoreModOnly")
checkPropertyExists("usesShadowedDependencies")
checkPropertyExists("developmentEnvironmentUserName")

boolean noPublishedSources = project.findProperty("noPublishedSources") ? project.noPublishedSources.toBoolean() : false

String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
Expand Down Expand Up @@ -484,7 +485,9 @@ task apiJar(type: Jar) {
}

artifacts {
archives sourcesJar
if(!noPublishedSources) {
archives sourcesJar
}
archives devJar
if(apiPackage) {
archives apiJar
Expand All @@ -495,9 +498,11 @@ artifacts {
publishing {
publications {
maven(MavenPublication) {
artifact source: jar
artifact source: sourcesJar, classifier: "src"
artifact source: devJar, classifier: "dev"
artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: ""
if(!noPublishedSources) {
artifact source: sourcesJar, classifier: "src"
}
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
if (apiPackage) {
artifact source: apiJar, classifier: "api"
}
Expand Down

0 comments on commit 3ce7023

Please sign in to comment.