Comments (13)
@atroche @mfikes You shouldn't need to do lein install
each time. Simply add a .lein-classpath
file in to your project and point it to the src
directory for `lein-tools-deps. See the example project for a concrete example of this working:
Also the leiningen writing a plugin docs.
I should also say my preferred workflow has been to just run lein repl
within the lein-tools-deps
project root, and just link directly to deps.edn
files, that way you can just evaluate forms like:
(resolve-deps (canonicalise-dep-locs [:system :home "example/deps.edn" "foo"]))
Hope that helps.
from lein-tools-deps.
... is there a way we could use leiningen's knowledge of the location of the project.clj file?
Sadly not. We're doing this already in PR #21 for other reasons; but the reason we need to shell out is to capture the location of the :system
level deps.edn
(we also get :home
this way though we could easily infer that ourselves if we needed to).
The :system
level deps.edn
can be installed in different locations depending on the version of tools.deps, your O/S and the package manager. e.g. on macOS my system deps.edn is in:
/usr/local/Cellar/clojure/1.9.0.375/deps.edn
Personally I think on mac with homebrew this should probably be symlinked from /usr/local/etc/deps.edn
, in the same way that the latest clj
/ clojure
scripts are by default symlinked into /usr/local/bin
but I don't really know enough about brew as to whether this is the done thing or not.
Assuming tools.deps
choose to do this, we'd still want to allow some overrides for these aliases for situations where people install these into non-standard locations.
from lein-tools-deps.
Oh, couldn't you shell out for :system
and :home
but get the location of the :project
deps file through lein? I guess that'd be a bit of a hack and probably only useful for Cursive users.
If #21 lands then I'll be able to do [:system :home "deps.edn"]
and that will achieve the same thing, so I'm happy :)
from lein-tools-deps.
Oh, whoops, after reading more carefully I can see that #21 also handles the :project
case for Cursive. Awesome!
from lein-tools-deps.
With Homebrew on a mac, we end up with /usr/local/bin/clojure
.
So a hack on macOS would be to see if this file exists and then run
/usr/local/bin/clojure -Sdescribe
and read the edn in :out
{:version "1.9.0.375"
:config-files ["/usr/local/Cellar/clojure/1.9.0.375/deps.edn" "/Users/mfikes/.clojure/deps.edn" "deps.edn" ]
:install-dir "/usr/local/Cellar/clojure/1.9.0.375"
:config-dir "/Users/mfikes/.clojure"
:cache-dir ".cpcache"
:force false
:repro false
:resolve-aliases ""
:classpath-aliases ""
:jvm-aliases ""
:main-aliases ""
:all-aliases ""}
getting the :config-files
value.
from lein-tools-deps.
How about using with-sh-env to add /usr/local/bin/
to the path when we make the call to clojure-env
?
from lein-tools-deps.
I can try that @atroche . I suspect it won't work because the environment is passed to the launched process (it is not used in the current process to launch the launched process).
from lein-tools-deps.
I've been messing around with this, and I'm wondering if there's a better workflow than what I'm doing at the moment:
- make a change to the source of the plugin.
- run
lein install
- Run “Refresh Leiningen Projects” in Cursive (on a project that uses
lein-deps-tools
) - Occasionally restart Cursive when I start getting cryptic errors about ZLib or “code lengths”
And the thing that's probably slowing me down the most is not being able to read the println
s I do in the plugin, from within Cursive. The only error messages I can reliably get look like this:
5:50 PM Error reading /Users/alistair/clj/blah/project.clj
Cannot run program "clojure": error=2, No such file or directory
error=2, No such file or directory
5:51 PM Error reading /Users/alistair/clj/blah/project.clj
Are you faring better, @mfikes ?
from lein-tools-deps.
@atroche If there is some details I want to know, I've resorted to having the plugin throw a RuntimeException
with the text containing what I'd like to see.
from lein-tools-deps.
Ah, thanks! And is there a better way of running updated plugin code than doing lein install
? Checkouts don't seem to work for plugins.
from lein-tools-deps.
I don't know. I've been doing lein install
as well.
from lein-tools-deps.
Awesome, the .lein-classpath
solution works great.
from lein-tools-deps.
The patch in #31 would have lein-tools-deps
fall back to trying /usr/local/bin/clojure
if it exists and clojure
fails.
from lein-tools-deps.
Related Issues (20)
- Docs question: to what do the keywords :install :user and :project refer? HOT 3
- configuring lein-tools-deps as a plugin breaks the lein-zprint plugin
- uberjar question HOT 3
- Unnecessary dependencies when deploying to clojars HOT 3
- Special profiles like :provided don't set scope properly on dependencies included via lein-tools-deps
- Two local/root jars produces incorrect classpath
- Heroku does not accept lein-tools-deps HOT 6
- Dependencies with a classifier resolved incorrectly HOT 1
- example fails to run HOT 4
- Cannot use 0.4.3 - error due to missing dependency? HOT 4
- Cannot run program "clojure" with Cursive HOT 1
- Cannot run program "clojure" with Cursive
- (Windows 10 Pro) read-string fails when reading the environment map returned by calling the clojure executable with -Sdescribe HOT 3
- dep on org.clojure/tools.deps.alpha causes com.google.inject:guice$no_aop:jar:4.0 not found HOT 4
- Failure handling version ranges HOT 2
- Optionally use tools.deps default-deps HOT 1
- Preserve transitive dependency tree by using :managed-dependencies HOT 1
- Dependencies not fetched when using http proxy server
- UnsolvableVersionConflictException when using `io.opencensus/opencensus-exporter-trace-stackdriver` HOT 2
- Update instructions for using leinigen profiles
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lein-tools-deps.