leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
vemv 2020-02-24T04:12:33.000900Z

might be a long shot, but anyone has a lein deps wrapper that turns it into a no-op if project.clj's contents haven't changed?

vemv 2020-02-24T09:02:59.002600Z

Got it! It looks approximately like this:

deps(){
  if git diff master --exit-code -- project.clj > /dev/null;
  then
    echo "Nothing changed"
  else
    lein with-profile +test deps
  fi
}

2020-02-24T18:42:38.002800Z

you don't need to use the deps command explicitly - any other command that evaluates in project context implicitly invokes it. If you use trampoline with FAST_TRAMPOLINE lein will keep a hash of project.clj and not recalculate the deps

2020-02-24T18:43:30.003Z

so eg. as soon as you invoke lein repl or lein run it will invoke lein deps implicitly - maybe that's good for you (no need to run lein deps by hand) or maybe it's bad (recalculating deps even though you didn't ask for it)

vemv 2020-02-24T19:23:50.003300Z

Relatively often I use lein deps isolatedly, for reasons. Particularly when I set :pedantic? only in deps and never in repl Additionally, whenever my CIDER launches a JVM process via lein, it does not perform a deps. Don't know if that has changed (I version-froze cider) or can be configured.

vemv 2020-02-24T04:13:02.001Z

i.e. 0 JVMs spawned this would speed up my odd :emacs: setup

2020-02-24T08:50:27.002300Z

Would it be better to define a custom selector that achieves the same thing? Your selector section in project.clj is just an expression anyway, so the actual selector name does not need to match the selector tag that you applied on a test/ns level.

vemv 2020-02-24T09:02:59.002600Z

Got it! It looks approximately like this:

deps(){
  if git diff master --exit-code -- project.clj > /dev/null;
  then
    echo "Nothing changed"
  else
    lein with-profile +test deps
  fi
}

2020-02-24T18:42:38.002800Z

you don't need to use the deps command explicitly - any other command that evaluates in project context implicitly invokes it. If you use trampoline with FAST_TRAMPOLINE lein will keep a hash of project.clj and not recalculate the deps

2020-02-24T18:43:30.003Z

so eg. as soon as you invoke lein repl or lein run it will invoke lein deps implicitly - maybe that's good for you (no need to run lein deps by hand) or maybe it's bad (recalculating deps even though you didn't ask for it)

vemv 2020-02-24T19:23:50.003300Z

Relatively often I use lein deps isolatedly, for reasons. Particularly when I set :pedantic? only in deps and never in repl Additionally, whenever my CIDER launches a JVM process via lein, it does not perform a deps. Don't know if that has changed (I version-froze cider) or can be configured.