Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow "lein run" option to run a REPL #1036

Closed
rauhs opened this issue Aug 25, 2015 · 3 comments
Closed

Allow "lein run" option to run a REPL #1036

rauhs opened this issue Aug 25, 2015 · 3 comments
Labels
new Marks issues describing new features released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@rauhs
Copy link

rauhs commented Aug 25, 2015

The motivation behind this is the following:

With projects having both, clojure+cljs in their project structure, there is no single classpath that is appropriate. I then, do not set a :source-paths at all in my profile.clj but only ever set them in my leiningen profiles. The composite profiles makes this very nice and modular and composable.
I also use the profiles to obtain different compilation for cljs projects (debug/production).
The problem is when I want to have a figwheel REPL in Cursive (with the scripts/figwheel-cljs-repl.clj method) then the classpaths are not set properly.

I'd like to see a lein run method in Cursive to start a REPL (Or even more general: Allow any process to start). There I can apply my options and start my figwheel REPL properly:

lein with-profile +dev-cljs run -m clojure.main scripts/figwheel-cljs-repl.clj

Or is there a better way to do this? Am I over complicating things?
Thanks for reading.

@danielcompton
Copy link
Collaborator

Have you tried the steps for setting up a Figwheel REPL in Cursive https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL?

@rauhs
Copy link
Author

rauhs commented Aug 25, 2015

I don't actually have any trouble running figwheel from Cursive. It's been working well. However, the problem is that I have Clojure and Clojurescript in my project and they (other than CLJC) should not share anything.

So I manage it with profiles but the problem is that I have to apply the profiles before running anything. Though Cursive only reads the default :source-paths as far as I can tell which means I have to put my CLJS paths in there. I have no chance.
Now my clojure code (with dev-clj profile) will merge its source paths when activated and end up with both, cljs and clj source paths. That could be a possible headache down the road so I'd like to keep them separate.
Currently I work around this issue by putting my CLJS source paths into :source-paths and then removing them in all my clojure profiles with ^:replace meta info:

      :profiles {
         ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
         ;; Main clojure dev environment
         :dev-clj
         [{:source-paths ^:replace ["env/dev/clj" "src/clj" "src/cljc" "test/clj"]
           ....  

@conan
Copy link

conan commented Jul 23, 2018

I have exactly the same scenario; clj + cljs in the same project, but wanting to keep their deps separate. Can't run figwheel because I can't find a way to merge profiles when using a clojure.main process.

@cursive-ide cursive-ide added this to the 1.8.0-eap7 milestone Sep 17, 2018
@cursive-ide cursive-ide added new Marks issues describing new features changed Marks issues describing changes to existing features and removed changed Marks issues describing changes to existing features labels Sep 22, 2020
@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Marks issues describing new features released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

4 participants