This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-05
Channels
- # aws (1)
- # beginners (57)
- # boot (3)
- # cider (6)
- # clara (49)
- # cljs-dev (47)
- # cljsjs (23)
- # clojure (144)
- # clojure-dev (2)
- # clojure-finland (1)
- # clojure-germany (1)
- # clojure-sg (1)
- # clojure-spec (25)
- # clojure-uk (245)
- # clojurescript (39)
- # core-async (3)
- # cursive (6)
- # datomic (117)
- # emacs (3)
- # fulcro (6)
- # hoplon (10)
- # jobs (7)
- # juxt (5)
- # leiningen (11)
- # om (27)
- # pedestal (4)
- # perun (2)
- # re-frame (22)
- # reagent (35)
- # ring-swagger (11)
- # shadow-cljs (333)
- # spacemacs (10)
- # specter (10)
- # sql (20)
- # vim (8)
Is there way to get the lein
config from project.clj
in an arbitrary clojure process started from lein run
?
For example, So I could do something like (get-in config :source-paths)
I guess “is there a way” wasn’t the right question, but rather is there a simple user friendly way.
Not sure if I understand your question, but lein pprint
will print stuff out to the console (pprint is a plugin)
Don't know if you can get the project map from within another process, but you can look for the project.clj, it's a resource
Something like META-INF/leiningen/your-group/your-artifact/project.clj
although there is a distinction between built JARs/Uberjars, and a running project, not sure if all that info is available for running projects
Take a look at https://github.com/trptcolin/versioneer for some ideas
the fun thing is that if you look for (io/resource "project.clj")
you get the project.clj of a random dep
but not likely to be your own project.clj
oh wow this is fun
user=> (pprint (enumeration-seq (.getResources (.getContextClassLoader (Thread/currentThread)) "project.clj")))
(#object[java.net.URL 0x5935f386 "jar:file:/Users/justin/.m2/repository/clj-kafka/clj-kafka/0.3.4/clj-kafka-0.3.4.jar!/project.clj"]
#object[java.net.URL 0x2f92208b "jar:file:/Users/justin/.m2/repository/com/taoensso/timbre/4.10.0/timbre-4.10.0.jar!/project.clj"]
#object[java.net.URL 0x1704baf2 "jar:file:/Users/justin/.m2/repository/aviary/condor/0.2.46/condor-0.2.46.jar!/project.clj"]
#object[java.net.URL 0x19800895 "jar:file:/Users/justin/.m2/repository/aleph/aleph/0.4.3/aleph-0.4.3.jar!/project.clj"]
#object[java.net.URL 0x1af08630 "jar:file:/Users/justin/.m2/repository/io/aleph/dirigiste/0.1.5/dirigiste-0.1.5.jar!/project.clj"]
#object[java.net.URL 0x24d87b9d "jar:file:/Users/justin/.m2/repository/littlebird-aviary/audubon/0.4.39/audubon-0.4.39.jar!/project.clj"]
#object[java.net.URL 0x16b986de "jar:file:/Users/justin/.m2/repository/hickory/hickory/0.7.1/hickory-0.7.1.jar!/project.clj"]
#object[java.net.URL 0xfe4f03c "jar:file:/Users/justin/.m2/repository/geo-clj/geo-clj/0.3.6/geo-clj-0.3.6.jar!/project.clj"]
#object[java.net.URL 0x113b36f6 "jar:file:/Users/justin/.m2/repository/tigris/tigris/0.1.1/tigris-0.1.1.jar!/project.clj"]
#object[java.net.URL 0x76d8a3df "jar:file:/Users/justin/.m2/repository/clj-time/clj-time/0.13.0/clj-time-0.13.0.jar!/project.clj"]
#object[java.net.URL 0x2c0d44ac "jar:file:/Users/justin/.m2/repository/bultitude/bultitude/0.2.2/bultitude-0.2.2.jar!/project.clj"]
#object[java.net.URL 0x4402401 "jar:file:/Users/justin/.m2/repository/clojurewerkz/support/1.1.0/support-1.1.0.jar!/project.clj"]
#object[java.net.URL 0x4c043ef9 "jar:file:/Users/justin/.m2/repository/trptcolin/versioneer/0.1.1/versioneer-0.1.1.jar!/project.clj"]
#object[java.net.URL 0x7ff1aafd "jar:file:/Users/justin/.m2/repository/potemkin/potemkin/0.4.3/potemkin-0.4.3.jar!/project.clj"]
#object[java.net.URL 0x391fa98b "jar:file:/Users/justin/.m2/repository/manifold/manifold/0.1.6/manifold-0.1.6.jar!/project.clj"]
#object[java.net.URL 0x3cfaf285 "jar:file:/Users/justin/.m2/repository/com/taoensso/truss/1.5.0/truss-1.5.0.jar!/project.clj"]
...
each of those can be slurped