Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
110 lines (93 sloc) 3.45 KB
<project name="CustomWidget" default="test" basedir=".">
<description>Test and distribute a custom jQueryUI widget.</description>
<property name="src" location="src" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="dist-js-file" location="${dist}/custom-widget.js" />
<property name="dist-min-js-file" location="${dist}/custom-widget.min.js" />
<property name="js-engine" value="node" />
<property name="js-compiler" value="build/uglify.js" />
<property name="theme" location="${src}/theme" />
<property name="dist-theme-dir" location="${dist}/theme" />
<property name="dist-css-file" location="${dist-theme-dir}/theme.css" />
<target name="test">
<exec executable="phantomjs" error="/dev/null">
<arg value="spec/run_jasmine.js" />
<arg value="http://localhost:8000/spec/SpecRunner.html" />
</exec>
</target>
<target name="test-hudson">
<exec executable="phantomjs" output="test-hudson-output.xml" error="/dev/null">
<arg value="spec/run_jasmine_for_hudson.js" />
<arg value="http://localhost:8000/spec/SpecRunner.html" />
</exec>
</target>
<target name="test-browser">
<exec executable="google-chrome" spawn="true">
<arg value="http://localhost:8000/spec/SpecRunner.html" />
</exec>
</target>
<target name="serve">
<echo>Serving project on http://localhost:8000</echo>
<exec executable="python">
<arg value="-m" />
<arg value="SimpleHTTPServer" />
</exec>
</target>
<target name="dist-init">
<mkdir dir="${dist}" />
<mkdir dir="${dist-theme-dir}" />
<exec executable="date" outputProperty="dist-date" logError="true" />
<exec executable="cat" outputProperty="dist-version" logError="true">
<arg value="version.txt" />
</exec>
</target>
<target name="concat-js" depends="dist-init">
<concat destfile="${dist-js-file}">
<filelist dir="${src}" files="intro.js" />
<fileset dir="${src}" includes="*.js" excludes="intro.js,outro.js"/>
<filelist dir="${src}" files="outro.js" />
</concat>
</target>
<target name="replace-js" depends="concat-js">
<replaceregexp file="${dist-js-file}"
match="@DATE"
replace="${dist-date}"
/>
<replaceregexp file="${dist-js-file}"
match="@VERSION"
replace="${dist-version}"
/>
</target>
<target name="lint-js" depends="replace-js">
<echo message="Checking against JSLINT..." />
<exec executable="${js-engine}">
<arg value="build/jslint-check.js" />
</exec>
</target>
<target name="minify-js" depends="replace-js">
<echo message="Minifying JavaScript..." />
<exec executable="${js-engine}" output="${dist-min-js-file}" logError="true">
<arg value="build/uglify.js" />
<arg value="${dist-js-file}" />
</exec>
</target>
<target name="concat-theme-css">
<echo message="Concatinating css..." />
<concat destfile="${dist-css-file}">
<filelist dir="${theme}" files="intro.css" />
<fileset dir="${theme}" includes="*.css" excludes="intro.css,outro.css"/>
<filelist dir="${theme}" files="outro.css" />
</concat>
</target>
<target name="dist-theme" depends="concat-theme-css">
<copy todir="${dist-theme-dir}">
<fileset dir="${theme}" excludes="*.css" />
</copy>
</target>
<target name="dist" depends="lint-js, minify-js, dist-theme">
</target>
<target name="clean">
<delete dir="${dist}" />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.