- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 178
Run time requires (within task definitions)
        Murphy McMahon edited this page Jul 20, 2015 
        ·
        1 revision
      
    You may want your task itself to require namespaces, e.g. so that these namespaces don't need to be required globally in build.boot and affect startup time unnecessarily.
However a simple (require '[my-ns.tasks :refer [some-task]]) within deftask will not work, because when Clojure evaluates the file, all symbols in the code will be resolved and this isn't possible if you're doing the require at runtime.
One fix would be to resolve the symbols manually:
(deftask supertask []
  (require 'my-ns.tasks)
  (let [some-task (resolve 'my-ns.tasks/some-task)]
    (comp
     (some-task)
     ;; ... other tasks in your supertask pipeline ...
     )))You can find other developers and users in the #hoplon channel on freenode IRC or the boot slack channel.
If you have questions or need help, please visit the Discourse site.
- Environments
- Boot environment
- Java environment
- Tasks
- Built-ins
- Third-party
- Tasks Options
- Filesets
- Target Directory
- Pods
- Boot Exceptions
- Configuring Boot
- Updating Boot
- Setting Clojure version
- JVM Options
- S3 Repositories
- Scripts
- Task Writer's Guide
- Require inside Tasks
- Boot for Leiningen Users
- Boot in Leiningen Projects
- Repl reloading
- Repository Credentials and Deploying
- Snippets
- Troubleshooting
- FAQ
- API docs
- Core
- Pod
- Util
