Repository navigation
build: restore <scope>provided</scope> on Clojure + CLJS deps (rf2-6i657) - #6
Merged
Merged
Conversation
… deps (rf2-6i657)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After the lein → tools.build swap (rf2-ucbuz), the emitted
pom.xmllistedorg.clojure/clojureandorg.clojure/clojurescriptas ordinary (non-provided) dependencies. The legacyproject.cljhad:scope \"provided\"on these so consumers wouldn't transitively pull a specific Clojure/CLJS version.Root cause:
clojure.tools.build.tasks.write-pom/to-dep(as of v0.10.13) only honors:exclusionsand:optional— it silently drops:mvn/scope. So adding:mvn/scope \"provided\"todeps.ednwouldn't help.Fix
Post-process the emitted
pom.xmlinbuild.clj'sjarfn betweenwrite-pomandcopy-dir. A small regex finds the<dependency>blocks fororg.clojure/clojureandorg.clojure/clojurescriptand injects<scope>provided</scope>before the closing</dependency>tag. Throws if the format unexpectedly changes (so we notice on the next tools.build bump rather than silently regressing).No version bump — 0.3.0 is already tagged and the deploy hadn't yet completed (awaiting Clojars secrets). The next release (0.3.1 or whatever) picks this up.
Test plan
clojure -T:build jarsucceeds locally.unzip -p target/de-dupe-0.3.0.jar META-INF/maven/day8/de-dupe/pom.xml | grep -B 1 -A 1 scopeshows<scope>provided</scope>on both Clojure entries: