This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-08
Channels
- # beginners (92)
- # boot (2)
- # cljsrn (6)
- # clojure (33)
- # clojure-austin (1)
- # clojure-dev (18)
- # clojure-spec (7)
- # clojure-uk (2)
- # clojurescript (35)
- # cursive (13)
- # data-science (3)
- # datomic (1)
- # defnpodcast (1)
- # figwheel (1)
- # fulcro (27)
- # instaparse (1)
- # java (2)
- # leiningen (8)
- # off-topic (5)
- # onyx (1)
- # portkey (2)
- # re-frame (9)
- # reagent (2)
- # ring-swagger (1)
- # shadow-cljs (136)
- # test-check (3)
- # tools-deps (29)
FYI [seancorfield/boot-tools-deps "0.4.4"]
just went to Clojars: it bumps the tools.deps.alpha
dependency to 0.5.417
to address the slf4j logger warning.
I have a plk
script that composes clojure
(for the purposes of classpath construction) with planck
. This is working out fairly nicely, but there is a hack I needed to do in order to support :main-opts
, by parsing the output of -Sverbose
😱
It makes me wonder if, akin to -Spath
, a -Smain-opts
would be generally useful.
(The fragile hack is at the bottom of https://gist.github.com/mfikes/bbf8a9a5b9ed6ecac15a3bb75d2dc8b4 if curious.)
Happy to consider additions to -Sdescribe - file a ticket if so
At the very bottom of /usr/local/bin/clojure
, does it make sense to have the script do
exec "$JAVA_CMD" ...
in order to have the shell script launching the Clojure process terminate (or be replaced). I'm asking because TBH I don't fully appreciate the consequences and wondering if anyone familiar with this aspect of Unix might know.is it possible to get the paths
in program when using tools.deps
. I try to write a figwheel.clj
build script, but don't want hardcode the paths.
@doglooksgood could you explain more about what paths you mean?
@mfikes et al - I have deprecated the INST jira project, please use TDEPS for anything installer / clj related. Since I work on both of these in tandem, it’s just easier for me to manage and prioritize one bucket instead of two. And if you find a link to the INST one, let me know so I can update it.
@alexmiller I want the :paths
in deps.edn
.
generally speaking, I would say yes. but the answer is somewhat subtle.
there are really three different levels at work here: 1) clj command line script (bash) - fully environment aware with knowledge of multiple sources for deps.edn and caching concerns. The script knows how to find all deps.edn sources and invoke make-classpath 2) make-classpath program (Clojure) - a small program that knows how to read and combine things it is told by #1 to use tools.deps to build a classpath 3) tools.deps resolve-deps / make-classpath - know how to do dependency resolution etc
to find the same :paths that clj will use, you need at least the top two levels (and possibly the third, if you want to consider the modifications from :extra-paths in aliases)
but you might be able to take shorter paths to do things that are usually enough - it depends what other constraints/assumptions you can rely on and how close to clj you need to be.
for example, if you know your local project.clj always has the paths in it and that’s all you want, then you could just literally read the file as edn and extract the :paths key.
and you don’t even need tools.deps to do that
I my case, I write a .clj file which is a script file to launch figwheel build, and this require a source-path
that contains .cljs files. I want to specify source-path
with aliases
in tools.deps
there’s no way to self refer to the paths via a magic variable or anything like that
if it is, provide apis or variables can make something easier, like finding the paths or deps. so some general purpose scripts can be write and reuse. I think this can help people use their own project to customize their workflow.
as described above, there are a lot of nuances to how clj and tools.deps works
this tool is designed to launch programs prepared with certain dependencies on the classpath
perhaps a better way to ask the question is - can you write a program that can be launched by this tool that will output the desired information?
like
clj -e '(System/getProperty "java.class.path")'
not a bad question, just trying to rephrase to alignment with the goal of the tool
is the output of the command above the answer you seek? or at least the input? that could easily be filtered to sub paths of the current directory