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

Need to respect :source-paths and :test-paths from project.clj #66

Open
cloojure opened this issue Apr 4, 2017 · 1 comment
Open

Need to respect :source-paths and :test-paths from project.clj #66

cloojure opened this issue Apr 4, 2017 · 1 comment

Comments

@cloojure
Copy link

cloojure commented Apr 4, 2017

lein-test-refresh version 0.19.0
Lein version: Leiningen 2.7.1 on Java 1.8.0_111
Clojure 1.8.0

lein-test-refresh seems to recursively load all *.clj files instead of just those found on :source-paths and :test-paths from project.clj. This causes clashes when files that are not supposed to be in the build are attempted to be loaded/compiled.

@cloojure cloojure changed the title Need to respect :source-paths and :test-paths Need to respect :source-paths and :test-paths Apr 4, 2017
@cloojure cloojure changed the title Need to respect :source-paths and :test-paths Need to respect :source-paths and :test-paths from project.clj Apr 4, 2017
@jakemcc
Copy link
Owner

jakemcc commented Apr 5, 2017

The current behavior exists since test-refresh calls tools.namespace to refresh and by default it refreshes everything on the classpath.

A :refresh-dirs option was added a while ago to test-refresh which allows users to specify which directories should be refreshed by specifying the arguments to tools.namespace.repl/set-refresh-dirs. There is a similar :watch-dirs option for specifying what directories should be monitored for changes.

I'm having a hard time remembering why this was done instead of looking at source/test paths by default. I'm going to have to think about this and see any pros and cons of the two approaches bubble up. The thing that first popped into my head is that the current behavior of reloading the entire classpath plays nicely with Leiningen checkouts.

In the meantime, you can work around the problem you're seeing by using :refresh-dirs. Thanks for submitting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants