Skip to content
Browse files

First commit

  • Loading branch information...
0 parents commit 5ea8cd5f3af67b65bcf27c8ea375fe77968a413c Nicholas C. Zakas committed Dec 17, 2011
20 LICENSE
@@ -0,0 +1,20 @@
+Buildr
+Copyright (c) 2011 Nicholas C. Zakas. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
5 README.md
@@ -0,0 +1,5 @@
+# Buildr
+
+Buildr is an open-source project that aims to create Ant macros for all of the common web development tools you may want to use in your build system. It does nothing more than provide an Ant interface for useful tools.
+
+Currently under development and incomplete, so use at your own risk.
11 build.xml
@@ -0,0 +1,11 @@
+<project name="buildr">
+
+ <!-- import all properties -->
+ <loadproperties srcFile="buildr.properties" />
+
+ <!-- import all macros -->
+ <import>
+ <fileset dir="${buildr.macros.dir}" includes="*.xml" />
+ </import>
+
+</project>
21 buildr.properties
@@ -0,0 +1,21 @@
+buildr.lib.dir = ./lib
+buildr.macros.dir = ./macros
+
+# Utilities
+buildr.rhino = js.jar
+buildr.closure = compiler.jar
+buildr.yuicompressor = yuicompressor-2.4.7.jar
+buildr.cssembed = cssembed-0.4.5.jar
+buildr.props2js = props2js-0.1.0.jar
+buildr.yuitest = yuitest-rhino-cli.js
+buildr.jshint = jshint.js
+buildr.csslint = csslint-rhino.js
+
+# CSS Lint Default Configuration
+buildr.csslint.opts = --errors=errors
+
+# JSHint Default Configuration
+buildr.jshint.opts = curly=true,forin=true,latedef=true,noempty=true,undef=true,rhino=false
+
+# YUI Compressor Default Configuration
+buildr.yuicompressor.opts =
BIN lib/compiler.jar
Binary file not shown.
BIN lib/cssembed-0.4.5.jar
Binary file not shown.
8,454 lib/csslint-rhino.js
8,454 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
BIN lib/js.jar
Binary file not shown.
3,963 lib/jshint.js
3,963 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
BIN lib/props2js-0.1.0.jar
Binary file not shown.
BIN lib/yuicompressor-2.4.7.jar
Binary file not shown.
3,955 lib/yuitest-rhino-cli.js
3,955 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
57 macros/csslint.xml
@@ -0,0 +1,57 @@
+<project name="csslint">
+
+ <property name="buildr.csslint.errors" value="" />
+ <property name="buildr.csslint.warnings" value="" />
+ <property name="buildr.csslint.format" value="text" />
+ <property name="buildr.csslint.quiet" value="false" />
+
+ <macrodef name="csslint">
+
+ <attribute name="errors" default="${buildr.csslint.errors}" />
+ <attribute name="warnings" default="${buildr.csslint.warnings}" />
+ <attribute name="format" default="${buildr.csslint.format}" />
+ <attribute name="quiet" default="${buildr.csslint.quiet}" />
+ <attribute name="failonerror" default="true" />
+ <element name="cssfiles"/>
+
+ <sequential>
+ <echo>Validating with CSS Lint</echo>
+ <script language="javascript"><![CDATA[
+ var errors = "@{errors}",
+ warnings = "@{warnings}",
+ format = "@{format}",
+ quiet = "@{quiet}",
+ options = "";
+
+ if (errors) {
+ options += " --errors=" + errors;
+ }
+
+ if (warnings) {
+ options += " --warnings=" + warnings;
+ }
+
+ if (format) {
+ options += " --format=" + format;
+ }
+
+ if (quiet == "true") {
+ options += " --quiet";
+ }
+
+ project.setProperty("buildr.csslint.options", options);
+ ]]></script>
+ <echo>Using: ${buildr.csslint.options}</echo>
+ <pathconvert pathsep=" " property="csslint.cssfiles">
+ <cssfiles/>
+ </pathconvert>
+ <exec executable="java" failonerror="@{failonerror}">
+ <arg line="-jar"/>
+ <arg path="${buildr.lib.dir}/${buildr.rhino}"/>
+ <arg path="${buildr.lib.dir}/${buildr.csslint}" />
+ <arg line="${csslint.cssfiles} ${buildr.csslint.options} " />
+ </exec>
+ </sequential>
+ </macrodef>
+
+</project>
25 macros/jshint.xml
@@ -0,0 +1,25 @@
+<project name="JSHint">
+
+ <property name="buildr.jshint.options" value="curly=true,forin=true,latedef=true,noempty=true,undef=true,rhino=false" />
+
+ <macrodef name="jshint">
+
+ <attribute name="options" default="${buildr.jshint.options}" />
+ <attribute name="failonerror" default="true" />
+ <element name="jsfiles"/>
+
+ <sequential>
+ <echo>Validating with JSHint</echo>
+ <pathconvert pathsep=" " property="jshint.jsfiles">
+ <jsfiles/>
+ </pathconvert>
+ <exec executable="java" failonerror="@{failonerror}">
+ <arg line="-jar"/>
+ <arg path="${buildr.lib.dir}/${buildr.rhino}"/>
+ <arg path="${buildr.lib.dir}/${buildr.jshint}" />
+ <arg line="${jshint.jsfiles} @{options} " />
+ </exec>
+ </sequential>
+ </macrodef>
+
+</project>
23 macros/yuicompressor.xml
@@ -0,0 +1,23 @@
+<project name="yuicompressor">
+
+ <!-- macro to minify files -->
+ <macrodef name="yuicompressor">
+
+ <attribute name="output" />
+ <attribute name="options" default=""/>
+ <attribute name="failonerror" default="true" />
+ <element name="files"/>
+
+ <sequential>
+ <echo>Minifying with YUI Compressor</echo>
+ <apply executable="java" parallel="false" failonerror="@{failonerror}">
+ <files/>
+ <arg line="-jar"/>
+ <arg path="${buildr.yuicompressor}"/>
+ <arg line="@{options} -o @{output}"/>
+ <srcfile/>
+ </apply>
+ </sequential>
+ </macrodef>
+
+</project>

0 comments on commit 5ea8cd5

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