Skip to content
Browse files

switch back to 1.2.1 and remove cljs into its own project

Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information...
1 parent bfd047d commit d9b73060d6cc01adf048f2da84240e3df06307ea @ibdknox ibdknox committed
Showing with 1 addition and 50 deletions.
  1. +1 −3 project.clj
  2. +0 −47 src/noir/util/cljs.clj
View
4 project.clj
@@ -1,12 +1,10 @@
(defproject noir "1.1.1-SNAPSHOT"
:description "Noir - a clojure web framework"
- :dependencies [[org.clojure/clojure "1.3.0-beta1"]
+ :dependencies [[org.clojure/clojure "1.2.1"]
[compojure "0.6.5"]
[org.clojure/tools.namespace "0.1.0"]
[clj-json "0.3.2"]
[ring "0.3.11"]
- [cljs-compiler-jar "0.1.0-SNAPSHOT"]
- [goog-jar "1.0.0"]
[cssgen "0.2.4"]
[hiccup "0.3.6"]
[clj-stacktrace "0.2.2"]
View
47 src/noir/util/cljs.clj
@@ -1,47 +0,0 @@
-(ns noir.util.cljs
- (:use clojure.java.io)
- (:require [noir.options :as options]
- [cljs.closure :as cljsc]))
-
-(def default-opts {:optimizations :simple
- :output-dir "resources/public/cljs/"
- :output-to "resources/public/cljs/bootstrap.js"})
-
-(def last-compiled (atom 0))
-
-
-(defn ext-filter [coll ext]
- (filter (fn [f]
- (let [fname (.getName f)
- fext (subs fname (inc (.lastIndexOf fname ".")))]
- (and (.isFile f) (= fext ext))))
- coll))
-
-(defn find-cljs [dir]
- (let [dir-files (-> dir file file-seq)]
- (ext-filter dir-files "cljs")))
-
-(defn compile-cljs [src-dir]
- (let [files (find-cljs src-dir)
- opts (merge default-opts (options/get :cljsc))]
- (cljsc/build src-dir opts)
- (reset! last-compiled (System/currentTimeMillis))))
-
-
-(defn newer? [f]
- (let [last-modified (.lastModified f)]
- (> last-modified @last-compiled)))
-
-(defn files-updated? [dir]
- (some newer? (find-cljs dir)))
-
-(defn wrap-cljs [handler]
- (let [src-dir "src/"]
- (compile-cljs src-dir)
- (if (options/dev-mode?)
- (fn [req]
- (when (files-updated? src-dir)
- (compile-cljs src-dir))
- (handler req))
- handler)))
-

0 comments on commit d9b7306

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