Skip to content

Instantly share code, notes, and snippets.

@jaconza
Created February 23, 2012 21:38
Show Gist options
  • Save jaconza/1895209 to your computer and use it in GitHub Desktop.
Save jaconza/1895209 to your computer and use it in GitHub Desktop.
Example ANT build file for usage of PrefixrAntTask
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Prefixr Example Usage" basedir="." default="prefix-css-files-override">
<!--
Initiate the task defnition, we do it up here so that we do not have to
do it in each targer
-->
<taskdef name="prefixr" classname="org.apache.tools.ant.taskdefs.Prefixr"
classpath="Prefixr.jar" />
<!-- An example of overriding the current css file.-->
<target name="prefix-css-files-override"
description="Uses the Prefixr task definition to contact the Prefixr api
and prefix the css properies">
<prefixr override="true">
<fileset dir="/home/jaco/Documents" includes="styles.css" />
</prefixr>
</target>
<!--
An example where we create a new css file for each file in the fileset
and add a suffix to the new file's name. So results from styles.css will
be written to styles.out.css.
-->
<target name="prefix-css-files-suffixed"
description="Uses the Prefixr task definition to contact the Prefixr api
and prefix the css properies, then writes the results to a new file">
<prefixr override="false" suffix="out">
<fileset dir="/home/jaco/Documents" includes="styles.css" />
</prefixr>
</target>
<!--
The default configuration of the task is to use a suffix of prefixr. Thus
results for 'styles.css' will be written to 'styles.prefixr.css'
-->
<target name="prefix-css-files-default"
description="Uses the Prefixr task definition to contact the Prefixr api
and prefix the css properies with the default configuration">
<prefixr override="false" suffix="out">
<fileset dir="/home/jaco/Documents" includes="styles.css" />
</prefixr>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment