Migrate build from Leiningen to tools.deps#980
Draft
bbatsov wants to merge 3 commits into
Draft
Conversation
791b30a to
1c23267
Compare
237fde7 to
f35d5fa
Compare
Move the build off Leiningen onto tools.deps, following the same recipe as nrepl and orchard, with the extra step of source-shading via mranderson. - deps.edn keeps only the non-inlined runtime deps in :deps, so the published pom declares exactly those (with the same scopes as the old Lein-built pom: nREPL compile, Clojure/ClojureScript provided). The shaded libs (cljfmt, tools.namespace, tools.reader) live in the :inlined-deps alias: out of the pom, but on the classpath for non-inlined dev/test runs. Clojure/nREPL version matrices and the test/lint/maint tooling are aliases; an :inlined alias runs the suite against the shaded sources. - build/main.clj provides the tools.build tasks (clean/javac/jar/deploy/ install) plus inline-deps, which drives mranderson.core/inline-deps (new in mranderson 0.6). jar builds from target/srcdeps and stamps version.edn into the artifact. ClojureScript is added to the pom basis (provided) so it shows up in the pom without being on the base classpath or in the jar. - The Makefile exposes clojure CLI entry points (quick-test, cljs-test, inlined-test, lint, jar, ...). It sets LEIN_VERSION for the lein-plugin tests, which read it from the env, and keeps the JDK-source download used by the Java parsing tests on CI. - The ClojureScript tests (test/cljs) run separately, on JDK21+ only: CLJS 1.12's Closure compiler requires a recent JDK, and the macroexpand middleware will try to load it whenever ClojureScript is on the classpath. So the base suite runs without ClojureScript, and one macroexpand error-handling assertion is relaxed to accept either error marker (it differs depending on whether the cljs stack is loaded). - CircleCI runs on the tools-deps images with a quick (non-inlined) test matrix, a full (inlined) test + smoketest job, a cljs-test job on JDK21+, lint, and tag-triggered deploy.
Replace the smoketest's lein project with a deps.edn plus a tools.build uberjar task. The just-installed cider-nrepl version is injected at build time, so the smoke test still exercises the real, freshly built artifact in a standalone uberjar.
Remove the Leiningen project file and tidy up the references to it: - slurp-test read project.clj as a sample .clj file; point it at build/main.clj instead (and rename the test accordingly). - Update the hacking guide, PR template, docs generator and version.edn comment to describe the tools.deps build (make docs / make targets) instead of the old Leiningen commands.
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.
Migrates the build off Leiningen onto tools.deps, following the same recipe we used for nrepl and orchard, with one extra wrinkle: cider-nrepl source-shades a few deps (cljfmt, tools.namespace, tools.reader) via mranderson. That's driven by
mranderson.core/inline-deps, the Leiningen-free entry point added in mranderson 0.6.Highlights:
:inlined-depsalias, not:deps, so they stay out of the published pom but are still on the classpath for non-inlined dev/test runs. The pom ends up declaring exactly the non-inlined deps.build/main.cljhas the tools.build tasks plus aninline-depstask that calls mranderson;jarbuilds fromtarget/srcdepsand stampsversion.ednin.project.cljis gone; the smoketest is a tools.deps/tools.build project; contributor docs updated.Requires mranderson >= 0.6 (already on Clojars). CI is green across the full JDK/Clojure/nREPL matrix.