boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 180 forks source link

Ability to specify watched dirs in watch #583

Closed arichiardi closed 7 years ago

arichiardi commented 7 years ago

At the moment the dirs that you set with set-env! are watched but it would be great if we could specify them to watch directly therefore kind of decoupling from build.boot.

Ok I could use another tool altogether for watching but I so like boot and all my tasks are in it (but I don't set dirs with set-env!. :boot:

:+1:

arichiardi commented 7 years ago

Mmm, I actually can use boot -s and specify whatever dir I want, but probably an option on watch would be still valuable, opinions?

Deraen commented 7 years ago

The tasks work with fileset, and fileset consists of paths in source/resource-paths. Also, many of tasks depend on files being in the classpath, which also depends on source/resource-paths. And even if watch could create fileset based on the watched paths, classpath is global state and can't be easily changed like this.

So this is not as simple as just adding parameter to watch task and using that to select watch directories.

arichiardi commented 7 years ago

Ok so the easiest solution I found is basically:

boot -B --source-paths "." watch -e "^mvn-target" sift -i "src" -i "pom.xml" mvn -Wpwd-A "-Pboot-clj clean install"

Closing this idea, rejected! 😀