Find file
Fetching contributors…
Cannot retrieve contributors at this time
185 lines (161 sloc) 6.57 KB
<?xml version="1.0"?>
+ iUI Ant Buildfile
+ For help, open a command-line window and set yoru current directory to
+ the iui project root. Then type "ant -p" for help...
+ Copyright (c) 2007, iUI Project Members
+ See LICENSE.txt for licensing terms
<project name="iui" default="releasedir" basedir=".">
Build file for iUI distributions
Targets marked with an "*" (asterisk) are useful when you have local modifications to iUI
Targets marked with an "r" are typically used only by the iUI team for building releases
To run a target type "ant [targetname]"
<!-- If you wish to override build settings, create a file called in
The project root. SVN is configured to ignore this file, so it won't accidentally be
checked in. Note that in Ant, whatever sets a property first "wins". -->
<property file="" />
<loadproperties srcFile="" /> <!-- Required -->
<!-- If version undefined at this point, use a timestamp -->
<tstamp />
<property name="iui.version" value="v${DSTAMP}-${TSTAMP}" />
<property name="iui.release.summary" value="Release summary goes here" />
<property name="tarfilename" value="iui-${iui.version}.tar.gz" />
<property name="src.dir" location="iui" />
<property name="target.dir" location="target" />
<property name="release.dir" location="${target.dir}/release" />
<property name="tarfile" location="${target.dir}/${tarfilename}" />
<path id="compress-js.path">
<fileset dir="releasetools/lib">
<include name="compress-js.jar"/>
<include name="custom_rhino_from_lcasoft.jar"/>
<path id="yui-compressor.path">
<fileset dir="releasetools/lib">
<include name="yuicompressor-2.2.5.jar"/>
<include name="yui-rhino-1.6R7.jar"/>
<include name="yui-jargs-1.0.jar"/>
<path id="ant-googlecode.path">
<fileset dir="releasetools/lib">
<include name="ant-googlecode-0.0.0test.jar"/>
<!-- Define extension Ant tasks that aren't part of the standard Ant distro -->
<taskdef name="compress-js" classname=""
classpathref="compress-js.path" />
<taskdef name="GoogleCodeUploadTask" classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask"
classpathref="ant-googlecode.path" />
<!-- Ant targets, use "ant -p" for easier reading of the "description" attributes -->
<target name="compress-js" description="* - Create iuix.js by compressing iui.js">
<mkdir dir="${release.dir}" />
<compress-js file="${src.dir}/iui.js"
stripCR="true" />
<!-- Compress CSS using Yahoo YUI Compressor -->
<target name="compress-css" description="* - Create iuix.css by compressing iui.css">
<java jar="releasetools/lib/yuicompressor-2.2.5.jar" fork="true" classpathref="yui-compressor.path">
<arg value="--type"/>
<arg value="css"/>
<arg value="iui/iui.css" />
<arg value="-o"/>
<arg value="${release.dir}/iui/iuix.css"/>
<target name="docopy" description="* - Copy Files to release directory">
<mkdir dir="${release.dir}/iui"/>
<mkdir dir="${release.dir}/samples"/>
<!-- Copy subset of files of project root to release root -->
<copy todir="${release.dir}">
<fileset dir="${basedir}">
<include name="*.txt"/>
<include name="index.html"/>
<!-- Copy iUI images, css, and js -->
<copy todir="${release.dir}/iui">
<fileset dir="${src.dir}"/>
<!-- Copy samples -->
<copy todir="${release.dir}/samples">
<fileset dir="samples"/>
<!-- Make second copy of sample.html in samplex.html that uses iuix.css and iuix.js -->
<copy todir="${release.dir}/samples">
<fileset dir="samples">
<include name="*.html"/>
<globmapper from="*.html" to="*x.html"/>
<replaceregex pattern="../iui/iui.css" replace="../iui/iuix.css" flags="g"/>
<replaceregex pattern="../iui/iui.js" replace="../iui/iuix.js" flags="g"/>
<target name="releasedir" depends="compress-js, compress-css, docopy" description="* - Build releasedir (all tasks)">
<target name="clean" description="* - Remove all generated files">
<echo message="Deleting ${target.dir}" />
<delete dir="${target.dir}" />
<target name="iui-tarball" depends="releasedir" description="r - Make the tarball">
<mkdir dir="${release.dir}"/>
<tar basedir="${release.dir}" tarfile="${tarfile}" compression="gzip" />
<target name="iui-release" depends="iui-tarball"
description="r - Upload to download area of project site, requires Ant 1.7">
<echo message="Uploading using username ${gc.username}..." />
<target name="publish-samples" depends="releasedir" description="r - publish sample apps via SSH">
<scp verbose="true" todir="${sample-server.ssh.user}:${sample-server.ssh.password}@${}:~/iui">
<fileset dir="${release.dir}"/>
<target name="install-myproj" depends="releasedir" description="* - Install iUI into YOUR local project">
<mkdir dir="${myproj.dir.scripts}"/>
<mkdir dir="${myproj.dir.styles}"/>
<mkdir dir="${myproj.dir.images}"/>
<copy todir="${myproj.dir.styles}">
<fileset dir="${release.dir}/iui">
<include name="iui.css" if="myproj.copy-uncompressed"/>
<include name="iuix.css" if="myproj.copy-compressed"/>
<!-- Adjust image urls in the CSS file to use ${myproj.image.path} -->
<replaceregex pattern="url\(([^.]*)\.(png|gif)\)" replace="url\(${myproj.image.path}\1.\2\)" flags="g"/>
<copy todir="${myproj.dir.scripts}">
<fileset dir="${release.dir}/iui">
<include name="iui.js" if="myproj.copy-uncompressed"/>
<include name="iuix.js" if="myproj.copy-compressed"/>
<copy todir="${myproj.dir.images}">
<fileset dir="${release.dir}/iui">
<include name="*.png"/>
<include name="*.gif"/>