Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added closure task

  • Loading branch information...
commit 7f0e547c1a11a22f414bcc7db82b8225d41b41f0 1 parent b3eb99a
@nzakas authored
Showing with 28 additions and 0 deletions.
  1. +28 −0 macros/closure.xml
View
28 macros/closure.xml
@@ -0,0 +1,28 @@
+<project name="closure">
+
+ <!-- macro to minify files -->
+ <macrodef name="closure">
+
+ <attribute name="outputdir"/>
+ <attribute name="compilation-level" default="SIMPLE_OPTIMIZATIONS" />
+ <attribute name="failonerror" default="true" />
+ <element name="files" implicit="true"/>
+
+ <sequential>
+ <echo>Minifying with Closure Compiler</echo>
+ <apply executable="java" parallel="false" failonerror="@{failonerror}">
+ <files/>
+ <mapper type="regexp" from="^(.*?)\.js$$" to="@{outputdir}/\1-min.js"/>
+
+ <arg line="-jar"/>
+ <arg path="${buildr.closure.path}"/>
+ <arg line="--compilation_level @{compilation-level}"/>
+ <arg line="--js"/>
+ <srcfile/>
+
+ <arg line="--js_output_file"/>
+ <targetfile/>
+ </apply>
+ </sequential>
+ </macrodef>
+</project>

0 comments on commit 7f0e547

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