Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (83 sloc) 3.36 KB
<project name="nui" default="build.all">
<!-- version number -->
<property name="nui.version" value="0.1.0" />
<!-- the directories containing the source files -->
<property name="src.dir" value="./src" />
<property name="components.dir" value="${src.dir}/components" />
<property name="core.dir" value="${src.dir}/core" />
<!-- the directories and files to output to -->
<property name="lib.dir" value="./lib" />
<!-- the directories and files to output to -->
<property name="build.dir" value="./build" />
<!-- output filenames -->
<property name="full.build.file" value="nui.js"/>
<property name="core.build.file" value="nui-core.js"/>
<property name="components.build.file" value="nui-components.js"/>
<property name="css.build.file" value="nui-components.css"/>
<!-- license information -->
<loadfile property="license.text" srcfile="LICENSE" />
<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>
<!-- validate JS files with JSHint -->
<target name="lint">
<fileset dir="${src.dir}" includes="core/*.js,components/*/*.js" id="jsfiles.raw"/>
<pathconvert pathsep=" " property="jsfiles.clean" refid="jsfiles.raw" />
<exec executable="java" failonerror="true">
<arg line="-jar"/>
<arg path="${lib.dir}/js.jar"/>
<arg path="${lib.dir}/jshint.js" />
<arg line="${jsfiles.clean} curly=true,forin=true,latedef=true,evil=true,loopfunc=true,undef=true,rhino=false" />
</exec>
</target>
<!-- build the full library -->
<target name="build.full" depends="build.core,build.components,build.css">
</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="${src.dir}/core" files="nui.js" />
<fileset dir="${src.dir}/core" includes="*.js" excludes="nui.js"/>
</concat>
</target>
<!-- build the component library -->
<target name="build.components">
<concat destfile="${build.dir}/${components.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/* Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<fileset dir="${components.dir}" includes="**/*.js" />
</concat>
</target>
<!-- build the CSS library -->
<target name="build.css">
<concat destfile="${build.dir}/${css.build.file}" fixlastline="true">
<header trimleading="yes">/*!
${license.text}
*/
/* Version v@VERSION@, Build time: ${RIGHT_NOW} */
</header>
<fileset dir="${components.dir}" includes="*.css" />
</concat>
</target>
<!-- Build all files -->
<target name="build.all" depends="lint,build.full"/>
</project>