This repository has been archived by the owner. It is now read-only.
Browse files

Explain how to use in Leiningen 2.x.

  • Loading branch information...
technomancy committed Jul 24, 2012
1 parent 68b34e5 commit 99cbd794a29d6dff230fd6e4b48b8667af3adb8a
@@ -5,3 +5,4 @@ pom.xml
@@ -4,16 +4,19 @@ Compile Scala source from Leiningen.
## Usage
-Add [lein-scalac "0.1.0"] to `:plugins` project.clj. (Or
+Add `[lein-scalac "0.1.0"]` to `:plugins` project.clj. (Or
`:dev-dependencies` on Leiningen versions earlier than 1.7.0)
Set `:scala-source-path` in project.clj, usually to "src/scala", and
place your `.scala` source files in there.
Run `lein scalac` to compile them to `.class` files.
-If you'd like `scalac` to run before every `compile` invocation you
-can add `leiningen.hooks.scalac` to `:hooks` in project.clj.
+If you want `scalac` to run automatically, add `:prep-tasks ["scalac"]`
+to `project.clj`
+For Leiningen 1.x support, need to add `leiningen.hooks.scalac` to
+`:hooks` in project.clj.
## License
@@ -2,6 +2,8 @@
(:require [robert.hooke]
+;; This is only needed in Leiningen 1.x
(robert.hooke/add-hook (resolve 'leiningen.compile/prep)
(fn [f project & args]
;; Don't load scalac at every lein launch.
@@ -1,8 +1,10 @@
(defproject test-project "0.1.0"
:description "test project with some scala"
- :dependencies [[org.clojure/clojure "1.3.0"]
+ :dependencies [[org.clojure/clojure "1.4.0"]
[org.scala-lang/scala-library "2.9.1"]]
+ :scala-source-path "scala"
:plugins [[lein-scalac "0.1.0"]]
- :hooks [leiningen.hooks.scalac]
- :source-path "src/clj"
- :scala-source-path "src/scala")
+ :prep-tasks ["scalac"]
+ ;; for Leiningen 1.x you need this instead:
+ ;; :hooks [leiningen.hooks.scalac]
+ :main test-project.core)
File renamed without changes.

0 comments on commit 99cbd79

Please sign in to comment.