This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # 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
: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
clj -Spath -A:build
builds work, if I say
clj -T:build they work, CP is:
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
aliases are keywords