Created
October 30, 2010 04:31
-
-
Save harto/654948 to your computer and use it in GitHub Desktop.
LESS compilation task for Cake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns myproject.tasks | |
(:use [cake.core :only (deftask defile)]) | |
(:import [java.io File] | |
[com.asual.lesscss LessEngine])) | |
(defn less->css | |
"Compiles the Less file at the given path into its CSS equivalent." | |
[less-path css-path] | |
(.compile (LessEngine.) (File. less-path) (File. css-path))) | |
(defile "resources/public/css/main.css" #{"resources/less/main.less"} | |
(less->css "resources/less/main.less" "resources/public/css/main.css")) | |
(defile "resources/public/css/bookmarklet.css" #{"resources/less/bookmarklet.less"} | |
(less->css "resources/less/bookmarklet.less" "resources/public/css/bookmarklet.css")) | |
(deftask css #{"resources/public/css/main.css" | |
"resources/public/css/bookmarklet.css"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment