This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-15
Channels
- # babashka (4)
- # beginners (136)
- # calva (63)
- # clerk (7)
- # clj-kondo (8)
- # clojure (43)
- # clojure-boston (1)
- # clojure-europe (37)
- # clojure-nl (1)
- # clojure-norway (11)
- # clojure-uk (3)
- # clojurescript (6)
- # clr (1)
- # code-reviews (16)
- # cursive (45)
- # datomic (2)
- # docker (32)
- # emacs (10)
- # events (2)
- # exercism (1)
- # fulcro (3)
- # hugsql (1)
- # hyperfiddle (47)
- # leiningen (3)
- # lsp (30)
- # malli (39)
- # missionary (1)
- # off-topic (24)
- # pathom (2)
- # portal (14)
- # practicalli (5)
- # rdf (13)
- # reagent (18)
- # reitit (18)
- # releases (7)
- # remote-jobs (1)
- # sci (2)
- # shadow-cljs (45)
- # sql (7)
- # tools-build (11)
- # xtdb (13)
When developing code for a build.clj
build script, how should I include that in the REPL
1. Would adding :extra-paths ["."]
in an alias also include all the sub-directories in the project, or is it limited to only the files in the root of the project ?
Background:
When developing the code for a build script I'll need to add the build.clj
file to the path when starting the REPL.
It seems the build.clj
file lives in the root of the project so it can be used by the -T
execution flag.
So I would need to add :extra-paths ["."]
to an alias in order to evaluate the code in build.clj
If the :extra-paths ["."]
is not limited to the root director files, would this also bring in the source code tree twice, with different paths?
ā¢ correctly via the top level :paths
ā¢ incorrectly via the alias :extra-paths ["."]
with src
prefix to it path?
I'll do some experiments
Thanks.
create an alias just for build dev with {:replace-paths ["."]}
and then use both your build alias and that together
clj -A:build:build-dev
> Would adding :extra-paths ["."]
in an alias also include all the sub-directories in the project
technically yes, but they are not in the correct lookup location to be found in a way that matches their namespace (so this is not an issue)
Are there any issues if I add the :replace-paths ["."]
to the :build
alias directly?
That approach doesn't seem to interfere with using :build
via the -T
execution option (at least not so far š )
that's fine too
Including .
path does make cider test runner find the same test twice...
Although using the Kaocha test runner from CIDER only runs the test once.
It seems to be clean I should have two REPL startup commands, one for project development and one specifically for build.clj
development.
I'm not expecting to have to touch the build.clj
very often, so I guess thats okay
I think tdeps will dedupe paths for the classpath, might depend how the cider test runner gets things
Cider should just consult the REPL state for tests, maybe when I evaluate a test its getting two vars in the REPL state... but I am just guessing based on the output. I mostly use kaocha either within CIDER or on the command line (where the build alias wouldnt be used anyway) Its not a significant issue, just wondering how to design template code and examples for the books. Thanks
I think it's more likely it's searching a list of paths and the same path is included twice somehow