Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

96 lines (78 sloc) 3.585 kb
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="Hasher" default="all" basedir="./">
<description>
Hasher Build Task. Unify files, compress, validate, generate documentation and distribution files.
</description>
<!-- properties -->
<property file="dev/build/build.properties"/>
<!-- targets -->
<target name="purge" description="Delete destination directories.">
<delete dir="${deploy.dir}" />
</target>
<target name="-mkdirs" description="Make required dirs.">
<mkdir dir="${deploy.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${docs.dir}"/>
</target>
<target name="-purgeDocs">
<delete dir="${docs.dir}" />
</target>
<target name="-purgeJS">
<delete dir="${dist.dir}" />
</target>
<target name="concat" depends="-purgeJS, -mkdirs" description="Concatenate Files and outputs uncompressed version of Hasher.">
<echo message="Building ${dist.name}" />
<tstamp>
<format property="build.date" pattern="yyyy/MM/dd hh:mm aa" unit="hour"/>
</tstamp>
<loadfile property="hasher.js" srcFile="${src.dir}/hasher.js"/>
<loadfile property="license.txt" srcFile="${src.dir}/license.txt"/>
<copy file="${src.dir}/wrapper.js" tofile="${dist.dir}/${dist.name}" />
<replace>
<fileset dir="${dist.dir}" includes="${dist.name}" />
<replacefilter token="//::LICENSE:://" value="${license.txt}" />
<replacefilter token="//::HASHER:://" value="${hasher.js}" />
<!-- version number, build number/date should come after other replaces -->
<replacefilter token="::VERSION_NUMBER::" value="${version.number}"/>
<replacefilter token="::BUILD_DATE::" value="${build.date}"/>
<replacefilter token="::BUILD_NUMBER::" value="${build.number}" />
</replace>
<echo message="${dist.name} built" />
</target>
<target name="minify" description="Build minified version of Hasher.">
<echo message="Building ${dist.min.name}" />
<apply executable="java" parallel="false" verbose="true" dest="${dist.dir}">
<fileset dir="${dist.dir}">
<include name="*.js" />
</fileset>
<arg line="-jar" />
<arg path="${yuicompressor.jar}" />
<arg value="--charset" />
<arg value="ANSI" />
<arg value="-o" />
<targetfile />
<mapper type="glob" from="*.js" to="*.min.js" />
</apply>
<echo message="${dist.min.name} built." />
</target>
<target name="generateDocs" depends="-purgeDocs" description="Build Hasher and generates documentation.">
<echo message="Generating documentation" />
<apply executable="java" parallel="false" verbose="true">
<fileset dir="${dist.dir}">
<include name="${dist.name}" />
</fileset>
<arg line="-jar" />
<arg path="${jsdoc-toolkit.dir}/jsrun.jar" />
<arg value="${jsdoc-toolkit.dir}/app/run.js" />
<arg value="-t=${jsdoc-toolkit.dir}/templates/hasher" />
<arg value="-d=${docs.dir}" />
</apply>
<echo message="Documentation generated" />
</target>
<target name="compile" depends="concat, minify">
<echo message="Compiled." />
</target>
<target name="deploy" depends="purge, -mkdirs, compile, generateDocs">
<echo message="Build Complete." />
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.