Home

Alexander Yakushev edited this page Jul 1, 2015 · 15 revisions
Clone this wiki locally

Using lein-skummet

Lein-skummet is a Leiningen plugin for using Project Skummet. In order to use it add the following to your project.clj:

:dependencies [[org.skummet/clojure "x.y.z"]]
:exclusions [[org.clojure/clojure]]
:profiles {:default []}
:plugins [[org.skummet/lein-skummet "x.y.z"]]

Latest versions:

https://clojars.org/org.skummet/clojure/latest-version.svg

http://clojars.org/org.skummet/lein-skummet/latest-version.svg

In the first line you change your Clojure dependency to the latest Skummet build. Second line excludes original Clojure dependency from all other dependencies that might bring it. Third line ensures you have no extra dependencies inherited from :user profile. Fourth line is required for project to use lein-skummet plugin.

There is one more option you can use: :skummet-skip-vars, which is followed by a list of Var names that shouldn’t be lean-compiled. For example:

:skummet-skip-vars ["#'leantest.core/wont-be-lean"]

Lein-skummet exposes three commands:

  • lein skummet compile — lean-compiles the project.
  • lein skummet run — runs the compiled project with Leiningen.
  • lein skummet jar — builds an Uberjar which has everything needed for program to run with java -jar program-STANDALONE.jar.

Example

You can find a sample project here. Just clone it together with lein-skummet, navigate to sample/ directory and execute:

lein do skummet compile, skummet run

You can also uncomment the commented code in core.clj to check how Skummet compiles core.async. Mind that it is a lengthy process and may take 1-2 minutes.