Skip to content

Commit

Permalink
Fix publishing in shadowing (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers authored Mar 10, 2025
1 parent 4017fb0 commit bc956a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,16 @@ tasks.test { maxParallelForks = Runtime.getRuntime().availableProcessors() * 2 }

wire { kotlin { javaInterop = false } }

val isPublishing = providers.environmentVariable("PUBLISHING").isPresent

val shadowJar =
tasks.shadowJar.apply {
configure {
if (isPublishing) {
// Since we change the classifier of the shadowJar we need to disable the default jar task
// or we'll get two artifacts that have the same classifier
archiveClassifier.set("ignored")
}
relocate("com.squareup.wire", "dev.zacsweers.metro.compiler.shaded.com.squareup.wire")
}
}
Expand Down
1 change: 1 addition & 0 deletions metrow
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ case "$1" in
esac
done

export PUBLISHING=true
if [[ "$local" = true ]]; then
if [[ -z "$version" ]]; then
echo "Version required for local publish"
Expand Down

0 comments on commit bc956a8

Please sign in to comment.