tools-build

practicalli-johnny 2023-03-15T14:27:38.162389Z

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) 2023-03-15T14:48:46.793879Z

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

Alex Miller (Clojure team) 2023-03-15T14:49:03.025039Z

clj -A:build:build-dev

Alex Miller (Clojure team) 2023-03-15T14:50:03.014059Z

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

👍 1
practicalli-johnny 2023-03-15T15:22:19.552179Z

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

Alex Miller (Clojure team) 2023-03-15T15:35:07.169069Z

that's fine too

practicalli-johnny 2023-03-15T15:35:07.365629Z

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) 2023-03-15T15:36:21.282819Z

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

practicalli-johnny 2023-03-15T15:42:04.853039Z

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) 2023-03-15T16:03:13.024119Z

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

👍 1
borkdude 2023-03-15T16:16:27.850589Z

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