-
-
Notifications
You must be signed in to change notification settings - Fork 180
For Cursive Users
Martin Klepsch edited this page Jul 23, 2015
·
12 revisions
This is untested. If it worked for you please remove this message. — @martinklepsch
Cursive requires a project.clj
file to infer some important information. Adding a lein-generate
task as the one below can generate a project.clj
file on the fly so Cursive knows what to do.
(defn- generate-lein-project-file!
[& {:keys [keep-project] :or {:keep-project true}}]
(let [pfile (io/file "project.clj")
pname (or (get-env :project) 'boot-project)
pvers (or (get-env :version) "0.1.0-SNAPSHOT")
prop #(when-let [x (get-env %2)] [%1 x])
head (list* 'defproject pname pvers
(concat
(prop :url :url)
(prop :license :license)
(prop :description :description)
[:dependencies (get-env :dependencies)
:source-paths (vec (get-env :source-paths))]))
proj (pp-str (concat head (mapcat identity (get-env :lein))))]
(if-not keep-project (.deleteOnExit pfile))
(spit pfile proj)))
(deftask lein-generate
"Generate a leiningen `project.clj` file.
This task generates a leiningen `project.clj` file based on the boot
environment configuration, including project name and version (generated
if not present), dependencies, and source paths. Additional keys may be added
to the generated `project.clj` file by specifying a `:lein` key in the boot
environment whose value is a map of keys-value pairs to add to `project.clj`."
[] (generate-lein-project-file! :keep-project true))
(source)
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