Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 5e0ef9889e
Fetching contributors…

Cannot retrieve contributors at this time

executable file 183 lines (155 sloc) 7.523 kB
<project name="clovercss" default="build.all">
<!-- version number -->
<property name="clovercss.version" value="0.1.0" />
<!-- the directories containing the source files -->
<property name="src.dir" value="./src" />
<property name="src.core.dir" value="./src/core" />
<property name="src.plugins.dir" value="./src/plugins" />
<!-- the directories and files to output to -->
<property name="build.dir" value="./build" />
<property name="release.dir" value="./release" />
<!-- the directory containing library files -->
<property name="lib.dir" value="./lib" />
<!-- tools -->
<property name="yuicompressor" value="yuicompressor-2.4.7.jar" />
<!-- output filenames -->
<property name="core.build.file" value="clover-core.css"/>
<property name="plugins.build.file" value="clover-plugins.css"/>
<property name="all.build.file" value="clover.css"/>
<property name="core.debug.file" value="clover-core_debug.css"/>
<!-- external resources -->
<property name="csslint.url" value="https://raw.github.com/stubbornella/csslint/master/release/csslint-rhino.js"/>
<!-- embeddable license -->
<loadfile property="license.text" srcfile="LICENSE" />
<!-- get a timestamp -->
<tstamp>
<format property="RIGHT_NOW"
pattern="d-MMMM-yyyy hh:mm:ss"
locale="en,US"/>
</tstamp>
<tstamp>
<format property="SIMPLE_DATE"
pattern="MMMM d, yyyy"
locale="en,US"/>
</tstamp>
<!-- clean -->
<target name="clean">
<delete dir="${build.dir}" />
</target>
<!-- update the changelog automagically -->
<target name="changelog.update">
<exec executable="git" failonerror="true" outputproperty="git.tag">
<arg line="tag"/>
</exec>
<script language="javascript"><![CDATA[
//get the most recent tag to get the diff
var tags = clovercss.getProperty("git.tag").replace("\r", "").split("\n"),
lastTag = tags[tags.length-1];
clovercss.setProperty("git.log.range", lastTag + "..HEAD");
]]></script>
<!-- git log -pretty=format:'* %s (%an)' v0.4.0..v0.5.0-->
<exec executable="git" failonerror="true" outputproperty="git.changelog">
<arg line="log --pretty=format:'* %s (%an)' ${git.log.range}"/>
</exec>
<concat destfile="CHANGELOG.tmp" fixlastline="true">
<header trimleading="yes">${SIMPLE_DATE} - v${clovercss.version}
${git.changelog}
</header>
<fileset dir="." includes="CHANGELOG" />
</concat>
<delete file="CHANGELOG"/>
<move file="CHANGELOG.tmp" tofile="CHANGELOG"/>
</target>
<!-- validate CSS files with CSS Lint -->
<target name="lint">
<fileset dir="${src.dir}" includes="**/*.css" id="cssfiles.raw"/>
<pathconvert pathsep=" " property="cssfiles.clean" refid="cssfiles.raw" />
<exec executable="java" failonerror="true">
<arg line="-jar"/>
<arg path="${lib.dir}/js.jar"/>
<arg path="${lib.dir}/csslint-rhino.js" />
<!-- your customized arguments go here -->
<arg line="${cssfiles.clean} --errors=errors --quiet"/>
</exec>
</target>
<!-- minify CSS files with YUI Compressor -->
<target name="minify">
<apply executable="java" failonerror="true">
<fileset dir="${build.dir}" includes="*.css"/>
<mapper type="glob" from="*.css" to="${build.dir}/*-min.css"/>
<arg line="-jar"/>
<arg path="${lib.dir}/${yuicompressor}"/>
<arg line="-o"/>
<targetfile/>
<srcfile/>
</apply>
</target>
<!-- build the core library -->
<target name="build.core">
<concat destfile="${build.dir}/${core.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/*! Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<filelist dir="${lib.dir}" files="libraries.css" />
<fileset dir="${src.core.dir}/template" includes="*.css" excludes="*_debug.css"/>
<fileset dir="${src.core.dir}/grid" includes="*.css" excludes="*_debug.css"/>
<fileset dir="${src.core.dir}/module" includes="*.css" excludes="*_debug.css"/>
<fileset dir="${src.core.dir}/media" includes="*.css" excludes="*_debug.css"/>
<filelist dir="${src.core.dir}" files="content.css" />
<fileset dir="${src.core.dir}/heading" includes="*.css" excludes="*_debug.css"/>
<fileset dir="${src.core.dir}/spacing" includes="*.css" excludes="*_debug.css"/>
<fileset dir="${src.core.dir}/table" includes="*.css" excludes="*_debug.css"/>
</concat>
</target>
<!-- build the core debugging library -->
<target name="build.core.debug">
<concat destfile="${build.dir}/${core.debug.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/*! Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<fileset dir="${src.core.dir}/template" includes="*_debug.css"/>
<fileset dir="${src.core.dir}/grid" includes="*_debug.css"/>
<fileset dir="${src.core.dir}/module" includes="*_debug.css"/>
<fileset dir="${src.core.dir}/media" includes="*_debug.css"/>
<fileset dir="${src.core.dir}/heading" includes="*_debug.css"/>
<fileset dir="${src.core.dir}/spacing" includes="*_debug.css"/>
<fileset dir="${src.core.dir}/table" includes="*_debug.css"/>
</concat>
</target>
<!-- build the plugins library -->
<target name="build.plugins">
<concat destfile="${build.dir}/${plugins.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/*! Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<fileset dir="${src.plugins.dir}" includes="**/*.css" excludes="*_debug.css"/>
</concat>
</target>
<!-- Create a release with version number embedded -->
<target name="release" depends="build.all,changelog.update">
<delete dir="${release.dir}" />
<mkdir dir="${release.dir}"/>
<copy todir="${release.dir}">
<fileset dir="${build.dir}" includes="**/*" />
</copy>
<replaceregexp match="@VERSION@" replace="${clovercss.version}" flags="g" byline="true">
<fileset dir="${release.dir}" includes="**/*"/>
</replaceregexp>
</target>
<!-- Update CSS Lint with the latest -->
<target name="csslint.update">
<get src="${csslint.url}" dest="${lib.dir}/" />
</target>
<!-- Build all files -->
<target name="build.all" depends="clean,lint,build.core,build.core.debug,build.plugins,minify">
<concat destfile="${build.dir}/${all.build.file}" fixlastline="true">
<filelist dir="${build.dir}" files="${core.build.file},${plugins.build.file}"/>
</concat>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.