Skip to content
Browse files

Don't require the parent to specify a Clojure version.

Also, bump up the minimum required version to 1.4.0, which is what the
ClojureScript compiler is tested against these days.  Closes #113.
  • Loading branch information...
1 parent ccf9f9e commit 9199d2710759df56e692c98e2151705b05c79941 @emezeske committed Aug 27, 2012
Showing with 14 additions and 14 deletions.
  1. +6 −6 bin/test-install.sh
  2. +8 −8 plugin/src/leiningen/cljsbuild/subproject.clj
View
12 bin/test-install.sh
@@ -14,19 +14,19 @@ pushd $project_root
rm -rf ~/.m2/repository/lein-cljsbuild ~/.m2/repository/cljsbuild/
for d in support plugin; do
pushd $d
- lein install #, midje
+ lein install, midje
popd
done
for d in $projects; do
pushd example-projects/$d
if [ $d = advanced ]; then
extra_command=', cljsbuild test'
fi
- #lein clean
- #rm -rf .lein-*
- #lein cljsbuild clean, cljsbuild once$extra_command
- lein2 clean
+ lein clean
rm -rf .lein-*
- lein2 do cljsbuild clean, cljsbuild once #$extra_command
+ lein cljsbuild clean, cljsbuild once$extra_command
+ lein clean
+ rm -rf .lein-*
+ lein2 do cljsbuild clean, cljsbuild once$extra_command
popd
done
View
16 plugin/src/leiningen/cljsbuild/subproject.clj
@@ -3,8 +3,11 @@
(:require
[clojure.string :as string]))
-(def cljsbuild-dependencies '[[cljsbuild "0.2.7"]])
-(def required-clojure-version "1.3.0")
+(def required-clojure-version "1.4.0")
+
+(def cljsbuild-dependencies
+ '[[cljsbuild "0.2.7"]
+ [org.clojure/clojure required-clojure-version]])
(defn- numeric-version [v]
(map #(Integer. %) (re-seq #"\d+" (first (string/split v #"-" 2)))))
@@ -20,15 +23,12 @@
(< seg1 seg2) false))))
(defn check-clojure-version [project-dependencies]
- (let [clojure-dependency ('org.clojure/clojure project-dependencies)]
- (when (nil? clojure-dependency)
- (throw
- (Exception. "lein-cljsbuild requires your project to specify which Clojure version it uses ")))
+ (if-let [clojure-dependency ('org.clojure/clojure project-dependencies)]
(let [version (first clojure-dependency)]
(when (not (version-satisfies? version required-clojure-version))
(throw
(Exception.
- (str "lein-cljsbuild requires your project to use Clojure version >= " required-clojure-version)))))))
+ (str "The ClojureScript compiler requires Clojure version >= " required-clojure-version)))))))
(defn dependency-map [dependency-vec]
(into {} (map (juxt first rest) dependency-vec)))
@@ -38,7 +38,7 @@
cljsbuild (dependency-map cljsbuild-dependencies)]
(check-clojure-version project)
(map (fn [[k v]] (vec (cons k v)))
- (merge project cljsbuild))))
+ (merge cljsbuild project))))
(defn make-subproject [project crossover-path builds]
{:local-repo-classpath true

0 comments on commit 9199d27

Please sign in to comment.
Something went wrong with that request. Please try again.