This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-10
Channels
- # announcements (6)
- # architecture (2)
- # babashka (30)
- # beginners (90)
- # calva (21)
- # cider (22)
- # clj-kondo (27)
- # cljs-dev (7)
- # clojure (132)
- # clojure-europe (51)
- # clojure-nl (12)
- # clojure-norway (3)
- # clojure-spec (3)
- # clojure-uk (5)
- # clojurescript (69)
- # cloverage (9)
- # conjure (5)
- # core-async (54)
- # cursive (14)
- # datomic (34)
- # emacs (7)
- # fulcro (10)
- # graalvm (40)
- # graalvm-mobile (2)
- # gratitude (2)
- # improve-getting-started (1)
- # introduce-yourself (1)
- # jobs-discuss (61)
- # leiningen (5)
- # malli (6)
- # off-topic (59)
- # pathom (11)
- # polylith (38)
- # reagent (3)
- # reitit (3)
- # rewrite-clj (3)
- # shadow-cljs (53)
- # tools-build (35)
- # transit (8)
- # vim (62)
- # web-security (26)
- # xtdb (4)
What’s a good way to setup project in Cursive to be able to develop the build.clj file? Usually it’s outside the normal source tree it has separate dependencies.
@roklenarcic you can maybe open a REPL with the :build alias and then evaluate the build.clj in the REPL?
Maybe a second alias that adds these paths and dependencies
You can choose a tools alias. Open the clojure deps panel:
yeah I selected that and it didn’t help really
Weird. Did you click refresh, and is your build file in your deps.edn file?
I’ve got the standard setup:
when I start REPL I cannot load build.clj and if I try to just evaluate single expressions I get:
(defn test "Run the tests." [opts]
(bb/run-tests opts))
Syntax error compiling at (build.clj:12:1).
Unable to resolve symbol: defn in this context
I’ll ask the cursive chan
Ok. Presumably you are including that alias in your REPL set-up?
Do I need to use Run with Deps?
if you pick the IntelliJ project classpath, then it uses the aliases from clojure deps tab
How would you start REPL into this tool build from command line btw?
My build files are so simple I actually haven’t loaded in my REPL, but I guess you could add an :extra-paths in your alias? Did you try something like :
(I’ve always used ‘run with deps’ so I know my REPL is in the exact state as I expect, but I don’t know whether that is what others do)
because clj -T adds :paths ["."]
(and Cursive won't when using an alias), I would recommend adding it explicitly as in Mark's example and then starting with the alias
and in particular, use :paths
, not :extra-paths
to replace the project paths
Tried with that and it doesn’t work, I still get the same messages
well, it should :) what does (System/getProperty "java.class.path")
report ?
does it work outside Cursive?
if so, then I'd move this to #cursive
outside, try clj -Spath -A:build
builds work, if I say clj -T:build
they work, CP is:
"/Users/roklenarcic/Library/Application Support/JetBrains/IntelliJIdea2021.3/plugins/clojure-plugin/lib/nrepl-0.8.3.jar:/Users/roklenarcic/clojure-projects/memento/test:/Users/roklenarcic/clojure-projects/memento:/Users/roklenarcic/clojure-projects/memento/src:/Users/roklenarcic/.m2/repository/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.jar:/Users/roklenarcic/.gitlibs/libs/io.github.cognitect-labs/test-runner/48c3c67f98362ba1e20526db4eeb6996209c050a/src:/Users/roklenarcic/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar:/Users/roklenarcic/.m2/repository/org/clojure/core.memoize/1.0.236/core.memoize-1.0.236.jar:/Users/roklenarcic/.m2/repository/org/clojure/test.check/1.1.1/test.check-1.1.1.jar:/Users/roklenarcic/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/roklenarcic/.m2/repository/com/google/errorprone/error_prone_annotations/2.5.1/error_prone_annotations-2.5.1.jar:/Users/roklenarcic/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/Users/roklenarcic/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/Users/roklenarcic/.m2/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar:/Users/roklenarcic/.m2/repository/org/checkerframework/checker-qual/3.8.0/checker-qual-3.8.0.jar:/Users/roklenarcic/.m2/repository/org/clojure/tools.cli/1.0.206/tools.cli-1.0.206.jar:/Users/roklenarcic/.m2/repository/org/clojure/tools.namespace/1.1.0/tools.namespace-1.1.0.jar:/Users/roklenarcic/.m2/repository/org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.jar:/Users/roklenarcic/.m2/repository/org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar:/Users/roklenarcic/.m2/repository/org/clojure/core.cache/1.0.207/core.cache-1.0.207.jar:/Users/roklenarcic/.m2/repository/org/clojure/java.classpath/1.0.0/java.classpath-1.0.0.jar:/Users/roklenarcic/.m2/repository/org/clojure/tools.reader/1.3.4/tools.reader-1.3.4.jar:/Users/roklenarcic/.m2/repository/org/clojure/data.priority-map/1.0.0/data.priority-map-1.0.0.jar"
So it does contain /Users/roklenarcic/clojure-projects/memento
where build.clj is
and does that cp match what you see in a repl in cursive?
or that is the cursive repl I guess
so you can't (require 'build)
in the Cursive repl?
possible you may also need to mess with the project settings in Cursive to mark root as a src folder for this use
It seems that CP is wrong, I see that when going clj -Spath -A:build
I have tools.build
in my CP, but in cursive I don’t have it, even though I have build
alias selected in Tool Aliases
Even if I select Run with Deps and put in build
as alias
maybe :build
?
aliases are keywords