clojure - define project specific tasks in leiningen -


is there way define rake tasks within project leiningen.

i want define custom task in leiningen project.clj invoke function in project namespace

you can define project-specific aliases, e.g.:

  :aliases {"launch" ["run" "-m" "myproject.main"]             ;; values project map can spliced arguments             ;; using :project/key keywords.             "launch-version" ["run" "-m" "myproject.main" :project/version]             "dumbrepl" ["trampoline" "run" "-m" "clojure.main/main"]             ;; :pass-through-help ensures `lein my-alias help` not converted             ;; `lein my-alias`.             "go" ^:pass-through-help ["run" "-m"]             ;; complex aliases, docstring may attached. docstring             ;; printed instead of expansion when running `lein help`.             "deploy!" ^{:doc "recompile sources, deploy if tests succeed."}             ;; nested vectors supported "do" task             ["do" "clean" ["test" ":integration"] ["deploy" "clojars"]]} 

you should able combine feature lein-exec plugin define alias run arbitrary clojure code within project:

  :aliases {"dosmth" ["exec" "-ep" "(use 'myproject.main) (foo 42)"]} 

now can use dosmth task lein:

lein dosmth 

which alias to

lein exec -ep "(use 'myproject.main) (foo 42)" 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -