Fork me on GitHub
#tools-build
<
2023-03-15
>
practicalli-johnny14:03:38

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.

Alex Miller (Clojure team)14:03:46

create an alias just for build dev with {:replace-paths ["."]} and then use both your build alias and that together

Alex Miller (Clojure team)14:03:03

> 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)

šŸ‘ 2
practicalli-johnny15:03:19

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 šŸ™‚ )

practicalli-johnny15:03:07

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

Alex Miller (Clojure team)15:03:21

I think tdeps will dedupe paths for the classpath, might depend how the cider test runner gets things

practicalli-johnny15:03:04

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

Alex Miller (Clojure team)16:03:13

I think it's more likely it's searching a list of paths and the same path is included twice somehow

šŸ‘ 2
borkdude16:03:27

both . and test may be included in the classpath which may give that issue?