-
Notifications
You must be signed in to change notification settings - Fork 151
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
Java Source Path #434
Comments
Could you please post your build configuration? Also, I assume you are trying to use lein-cljsbuild to build ClojureScript and not the java/clj part of your project? |
For some reason, I can no longer reproduce this problem. It must've been a version bug (I'm still scaffolding out the basics of cljs on this project), or some sequencing of timing bug I can't reproduce anymore. I guess close this bug, I'll report back here if I start seeing it again. Ashton Sent from my iPhone
|
Figured out how to recreate it, it had to do with running lein cljsbuild on its own, not via figwheel-sidecar as I'd switched to. I've created a sample repo that demonstrates the problem. |
Thank you for the repo. You are trying to use |
I don't think I was very clear, or my proposed solutions were just wrong. The issue appears to be that lein-cljsbuild is attempting to process .clj files in a src directory that contains a mix of cljc, cljs, and clj files. This causes errors that are completely unrelated to the successful compilation of my cljs sources, but are still really annoying to the user. As far as I could tell, this could be fixed by:
The former seems better to me, as there is no real reason for cljs to touch clj files in my opinion. The latter I can implement myself, but strikes me as cumbersome. |
@AshtonKem Yes, the convention is to put your ClojureScript and Clojure files in separate directories. The ClojureScript compiler actually also needs to process some .clj or .cljc files, since ClojureScript macros are written in Clojure 😉 |
I understand that it needs to process .cljc files, but I'm a bit Ashton "Maria Geller (Neise)" notifications@github.com writes:
Ashton |
Yes, as I said, ClojureScript macros are written in Clojure and therefore have to be in a .clj file. |
Well, that's unfortunate then. Guess there's nothing to be done. Ashton |
I'm also running into this issue. I've written a java Class that I would like to be able to access as part of ClojureScript compilation. |
You only can use Java in your ClojureScript project when writing a macro, since macros in ClojureScript are written in Clojure. |
Thanks -- I'm aware of that, and that is the case I would like to support. Specifically, I would like to use a Java class in the Clojure implementation of Schema, but currently this breaks the abilities to use schemas in macros that generate ClojureScript. |
@AshtonKem I just had a look again at your example repo, and one way to make it work it to add I though that @w01fe Maybe this workaround also helps in your case? |
@mneise Thanks -- I also just realized that this probably wouldn't have been an issue for users of schema (just the tests within the project), since the compiled Java class would be in the published jar and thus on the classpath for downstream users. In any case, I ended up going a different route that didn't require a custom Java class. |
I also have this issue. A cljs file depends on a macro that depends on a java file in The workaround of adding
It would be awesome if we could figure this out. |
The reason for the mentioned |
Has been fixed with 0d085f9. |
I have a mixed java/clj project that I'm trying to add lein-cljsbuild to. Unfortunately when trying to run
lein cljsbuild once
I get ClassNotFoundExceptions due to the java sources included on java-source-path. I believe this is made worse by #362.The text was updated successfully, but these errors were encountered: