简体   繁体   中英

exclude test sources from boot-clj project for production

I'm developing a ClojureScript library, which is intended to be used in a browser environment.

So obviously there will be additional source files during development and testing. How can this be separated from the library source?

Is there a way to mark some sources as just for testing purpose which would be omitted when installing / deploying the project?

Additionally the resources folder, which contains some HTML files (etc.), should not be included when publishing as well.

In your build.boot put only those files that you want in your final build to :source-paths .

Add your test files only when defining a test-setup task like this:

(deftask test-setup []
  (merge-env! :source-path #{"dir_with_tests"})
  indentity)

And use it in your boot test task:

(deftask test []
  (comp
    (test-setup)
    (your-test-task)))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM