-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support managed dependencies in projects #143
Conversation
I opened #145 today, which unintentionally duplicates this. I checked out (defn make-subproject [project]
(with-meta
(assoc project :local-repo-classpath true)
(meta project))) Your test passes with this version, as well. But it's a more drastic change and it would warrant more extensive testing. |
@bbbates Actually, the way you've written this test, it will fail on a system which doesn't have a pre-existing copy of Clojure 1.8.0. You can reproduce it by doing these steps: $ rm -rf ~/.m2/repository/org/clojure/clojure/1.8.0/
$ cd plugin
$ lein test You'll get an error like this: lein test test.lein-doo.config
Could not find artifact org.clojure:clojure:jar:1.8.0
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
lein test :only test.lein-doo.config/run-local-project
ERROR in (run-local-project) (core.clj:4617)
Uncaught exception, not in assertion.
expected: nil
actual: clojure.lang.ExceptionInfo: Could not resolve dependencies
... more stack trace ... Using Clojure 1.7.0 in the test project works, since |
Hmm..ta - I'll take a look. |
@MatthewDarling - Yep, you're right about the missing dependency issue. 🤔 RE your proposal for a fix - I'm happy to use your solution - have you had a chance to test it out in more depth? I've been side-tracked a bit, so haven't gotten time yet, myself. |
…s local maven repo
"my solution" as in using the I like that having the Thinking about that a little more... There's a significantly hackier approach that would remove that synchronization: detecting some existing dependency and then using the version of that. For instance: user> (-> (System/getProperty "java.class.path")
(clojure.string/split #":")
(->> (filter #(re-find #"org.clojure/clojure" %))
first
(re-find #"(?:clojure-)(.+)(?:.jar)")
second))
;; => "1.8.0" Then you'd just stick that version in the map used by the test. But, well, this is kind of a personal preference thing. I'd say leave the test as-is (since it passes currently) and wait for an official maintainer judgement. |
@MatthewDarling, do you know if For the record: I'm inclined to merge this PR as it is. |
Right, you've reached the same conclusion as me regarding |
Yeah, I couldn't find any evidence of I think removing |
Using doo in a project that makes use of managed-dependencies (introduced in leiningen ~2.7) results in a failure when running any doo command:
Sample project:
Running (for example):
Easiest way to replicate is to remove the fix in
plugin/src/leiningen/doo.clj
and run the provided test.