This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (4)
- # beginners (111)
- # calva (12)
- # cider (10)
- # cljdoc (1)
- # cljs-dev (7)
- # cljsrn (4)
- # clojure (38)
- # clojure-houston (1)
- # clojure-serbia (3)
- # clojure-spec (22)
- # clojure-uk (26)
- # clojurescript (4)
- # cursive (1)
- # data-science (1)
- # datomic (12)
- # klipse (1)
- # off-topic (28)
- # pathom (9)
- # protorepl (3)
- # quil (4)
- # shadow-cljs (43)
- # tools-deps (24)
I should probably see if I can synthesize a generic version of our
build script and release it as open source...
That would be super awesome 🙂 I just realized mine doesn't support aliases very nicely...
We have a whole bunch of WS-specific alias expansions in it right now.
build run thing will expand into whatever
thing means in our project. So
build run database-setup expands to
build [ migrate migration photos dev ] which runs the
:migrate alias in the
migration subproject and then runs the
:photos alias in the
We also have an
expand-deps.sh script that looks for
:local/root deps in a subproject's
deps.edn file and recursively expands the list of subprojects to include all transitive subprojects that are depended on -- so we can say
build test-all api and it will expand to
build tests environment datamapper worldsingles ... api and that in turn expands to running
build test <subproject> for each subproject in turn 🙂
prev="" curr="[email protected]" while test "$prev" != "$curr" do deps="$curr" for d in $curr do if test -f "$clojure/$d/deps.edn" then roots=`fgrep local/root "$clojure/$d/deps.edn" | sed 's;.*local/root "../\(.*\)".*;\1;'` deps="$deps $roots" fi done prev="$curr" curr=`( for d in $deps; do echo $d; done ) | sort -u` done echo $curr
$clojureis the monorepo root.
All told, including the WS-specific task alias expansion and the 70 lines of help output, we're talking 350 lines of bash.
Hmm, that's a lot of bash haha. I just about hit my tolerance with the wee 16 lines above 😛
I've created some truly monstrous bash-based systems in my career... 1,000's of lines long. I probably wrote my first *nix shell script back in '79 tho'...
Writing a small script to do the necessary parsing in plain ol' Clojure only adds 1s overhead 🙂
True, I could rewrite all this in Clojure (and shell out to
clojure as needed for the repeated invocations). I could make all the WS-specific stuff data driven and external too. Maybe one day :thinking_face:
There’s some repository cache stuff built into Maven that we weren’t using so I’ve changed that and it makes a big difference.
There’s still something I don’t understand about why you’re getting that s3 maven download every time, but it’s now only doing it once at least.
You'd have to build
tools.deps JAR yourself and overwrite the version in the
clojure install or hack the
clojure script to point to that JAR elsewhere
That doesn’t sound that bad. Perhaps writing bash makes tasks like that sound easy haha
Then modify your clojure script to put the tools.deps.alpha/src/main/clojure dir at the front of the tools_cp var
There's one downside to not building it since the removal of the system deps.edn, you end up with templated version strings! So you need a hard clojure dependency.