When trying to run cljsbuild once in the advanced example project I get the following exception:
c:\lein-cljsbuild\example-projects\advanced>lein2 cljsbuild once
Exception in thread "main" java.io.FileNotFoundException: Could not locate C:/le
ass or C:/lein-cljsbuild/example-projects/advanced/src-clj/example/crossover/mac
ros.clj on classpath:
I can compile the simple project just fine, so it's something with the crossover part. I've verified that the file does exist in the place it's looking. The only thing that immediately comes to mind, is that the path separators are the wrong kind.
I know from previous issues you don't have an easily available windows machine to test with, so if there is anything you want me to try, let me know.
The crossover macro reloading feature tries to build a list of clj files to watch, and then when they change calls load on them. In this case, it looks like load is being called on the full path, including the C:/, which is bad because load will look for the file on the classpath, not on the filesystem.
It looks like the cljsbuild package (the project in the support/ subdirectory) is doing something weird, most likely in cljsbuild.crossover/crossover-macro-paths. It seems that the :classpath component of one of the maps it builds is ending up with the full C:/ qualification, when it should just start with / and be relative to the classpath. I think that the call to string/replace-first is not doing what it's supposed to: removing the parent part of the path.
To debug this, I think you'd need to build custom lein-cljsbuild and cljsbuild JARs, and add some println calls to cljsbuild.crossover/crossover-macro-paths, to see what file-path and parent are set to, which should indicate why it's not working as expected.
Or, maybe this can be debugged by playing around in a REPL with some combination of resource, .getPath, and .getProtocol.
I threw a println in crossover-macro-paths as you suggested the output shows why it's not working
Filepath: C:/lein-cljsbuild/example-projects/advanced/src-clj/example/crossover/macros.clj Classpath: C:/lein-ljsbuild/example-projects/advanced/src-clj/example/crossover/macros.clj Parent: /C:/lein-cljsbuild/example-projects/advanced/src-clj/
On windows it's sticking a "/" in front of the drive name. If I remove that, it compiles correctly and runs. I'm not 100% sure where to make the fix to the parent path string, it looks like it's coming from resource.
Thanks a bunch for getting this information. I think that I'll be able to make a proper fix based on that.
Handle Windows crossover paths correctly.
Hopefully this helps with Issue #129.
Hey, sorry it took so long, but I implemented a tentative fix for this.
Could you try checking out the 0.2.8 branch, and installing that version of the plugin, to see if my changes fix things for you? If you confirm that things work, I'll cut a release. Thanks!
Just tested it again with the 0.2.8 and it works like a charm! I was able to run the unit tests and everything.
Thanks for testing it! I'll get the release out soon.