Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 10ec089578
Fetching contributors…

Cannot retrieve contributors at this time

314 lines (280 sloc) 12.164 kB
<?xml version="1.0"?>
<project name="vie.js" basedir="." default="all">
<property name="VERSION" value="2.1.0alpha2"/>
<property name="DOCS_ROOT" value="./docs" />
<property name="DOCS_DIR" value="${DOCS_ROOT}/${VERSION}" description="API documentation"/>
<property name="DOCS_TMP" value="./docs_tmp" />
<property name="DIST_DIR" value="./dist"/>
<property name="DEMOS_DIR" value="./demos"/>
<property name="LIB_DIR" value="./lib"/>
<property name="SRC_DIR" value="./src"/>
<property name="TEST_DIR" value="./test"/>
<property name="TMP_DIR" value="./tmp"/>
<property name="TOOLS_DIR" value="./utils"/>
<property name="YUI" value="${TOOLS_DIR}/yui-compressor/yuicompressor-2.4.2.jar" />
<target name="timestamp">
<tstamp>
<format property="current.time"
pattern="yyyyMMddHHmmss" />
</tstamp>
</target>
<target name="doc" depends="init" description="Generates documentation for vie.js with Docco-Husky">
<echo message="Generating Documentation"/>
<echo message="Attention: 'Docco-Husky' is needed for that. Make sure it is on your PATH or"/>
<echo message="get it from: https://github.com/mbrevoort/docco-husky"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="docco-husky src/" />
</exec>
<move todir="${DOCS_DIR}">
<fileset dir="${DOCS_TMP}" />
</move>
<delete dir="${DOCS_TMP}"/>
</target>
<target name="doc_copy" depends="doc" description="Copies documentation into gh-pages branch ">
<echo message="Move docs temporarily"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="mv ${DOCS_DIR} ${DOCS_ROOT}/tmp"/>
</exec>
<echo message="Switching to gh-pages branch"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git checkout gh-pages" />
</exec>
<echo message="Move docs again"/>
<delete dir="${DOCS_DIR}" quiet="true"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="mv ${DOCS_ROOT}/tmp ${DOCS_DIR}"/>
</exec>
<echo message="Adding..."/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git add ${DOCS_DIR}" />
</exec>
<echo message="Committing..."/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git commit -m 'updating documentation for version ${VERSION}' ${DOCS_DIR}" />
</exec>
<echo message="Pushing..."/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git push origin gh-pages" />
</exec>
<echo message="Switching to master branch"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git checkout master" />
</exec>
</target>
<target name="test_copy" depends="dist" description="Copies browser-tests into gh-pages branch ">
<echo message="Move dist folder temporarily"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="mv ${DIST_DIR} ${DIST_DIR}_tmp"/>
</exec>
<echo message="Move lib folder temporarily"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="cp -R ${LIB_DIR} ${LIB_DIR}_tmp"/>
</exec>
<echo message="Move tests temporarily"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="mv ${TEST_DIR} ${TEST_DIR}_tmp"/>
</exec>
<echo message="Switching to gh-pages branch"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git checkout gh-pages" />
</exec>
<delete dir="${DIST_DIR}"/>
<echo message="Move dist again"/>
<delete dir="${DIST_DIR}" quiet="true"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="mv ${DIST_DIR}_tmp ${DIST_DIR}"/>
</exec>
<echo message="Remove timestamped files"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="rm ${DIST_DIR}/*_*.js"/>
</exec>
<delete dir="${LIB_DIR}"/>
<echo message="Move libs again"/>
<delete dir="${LIB_DIR}" quiet="true"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="mv ${LIB_DIR}_tmp ${LIB_DIR}"/>
</exec>
<delete dir="${TEST_DIR}"/>
<echo message="Move tests again"/>
<delete dir="${TEST_DIR}" quiet="true"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="mv ${TEST_DIR}_tmp ${TEST_DIR}"/>
</exec>
<echo message="Adding..."/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git add ${TEST_DIR}/*" />
</exec>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git add ${LIB_DIR}/*" />
</exec>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git add ${DIST_DIR}/*" />
</exec>
<echo message="Committing..."/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git commit -m 'updating browser-tests for version ${VERSION}_${current.time}' ${DIST_DIR} ${LIB_DIR} ${TEST_DIR}" />
</exec>
<echo message="Pushing..."/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git push origin gh-pages" />
</exec>
<echo message="Switching to master branch"/>
<exec executable="sh" dir=".">
<arg value="-c" />
<arg value="git checkout master" />
</exec>
</target>
<target name="clean" description="Tidy up project.">
<echo message="Deleting distribution and API documentation"/>
<delete dir="${DIST_DIR}"/>
<delete dir="${DOCS_DIR}"/>
</target>
<target name="init" depends="clean, timestamp">
<mkdir dir="${DIST_DIR}" />
<mkdir dir="${DOCS_DIR}" />
</target>
<target name="all" depends="dist"/>
<target name="dist" depends="init, combine, minimise, combineCore, minimiseCore, combineAll, minimiseAll" />
<target name="zip" depends="dist">
<zip destfile="${DIST_DIR}/vie-${VERSION}_${current.time}.zip">
<zipfileset dir="docs/" prefix="docs"/>
<zipfileset dir="service" prefix="service"/>
<zipfileset dir="dist/" includes="*.js"/>
</zip>
</target>
<target name="combine" description="combines core/*.js files into one file">
<echo message="Building vie.js Distribution" />
<concat destfile="${DIST_DIR}/vie-${VERSION}_${current.time}.debug.js">
<string>/*
</string>
<fileset dir="." includes="LICENSE"/>
<string>*/
</string>
<string>(function(){
</string>
<fileset dir="${SRC_DIR}" includes="VIE.js"/>
<fileset dir="${SRC_DIR}" includes="Able.js"/>
<fileset dir="${SRC_DIR}" includes="Util.js"/>
<fileset dir="${SRC_DIR}" includes="Entity.js"/>
<fileset dir="${SRC_DIR}" includes="Collection.js"/>
<fileset dir="${SRC_DIR}" includes="Type.js"/>
<fileset dir="${SRC_DIR}" includes="Attribute.js"/>
<fileset dir="${SRC_DIR}" includes="Namespace.js"/>
<!-- VIE 1.0 API compat -->
<fileset dir="${SRC_DIR}" includes="Classic.js"/>
<fileset dir="${SRC_DIR}/service" includes="*.js"/>
<fileset dir="${SRC_DIR}/view" includes="*.js"/>
<!-- Internet Explorer specific jQuery Ajax transport handler -->
<fileset dir="${SRC_DIR}" includes="xdr.js"/>
<string>
})();
</string>
</concat>
<copy file="${DIST_DIR}/vie-${VERSION}_${current.time}.debug.js" tofile="${DIST_DIR}/vie-latest.debug.js" overwrite="true" />
</target>
<target name="combineCore" description="combines core/*.js files into one file. Excludes services and views.">
<echo message="Building vie-core.js Distribution" />
<concat destfile="${DIST_DIR}/vie-core-${VERSION}_${current.time}.debug.js">
<string>/*</string>
<fileset dir="." includes="LICENSE"/>
<string>*/</string>
<string>(function(){</string>
<fileset dir="${SRC_DIR}" includes="VIE.js"/>
<fileset dir="${SRC_DIR}" includes="Able.js"/>
<fileset dir="${SRC_DIR}" includes="Util.js"/>
<fileset dir="${SRC_DIR}" includes="Entity.js"/>
<fileset dir="${SRC_DIR}" includes="Collection.js"/>
<fileset dir="${SRC_DIR}" includes="Type.js"/>
<fileset dir="${SRC_DIR}" includes="Attribute.js"/>
<fileset dir="${SRC_DIR}" includes="Namespace.js"/>
<string>})();</string>
</concat>
<copy file="${DIST_DIR}/vie-core-${VERSION}_${current.time}.debug.js" tofile="${DIST_DIR}/vie-core-latest.debug.js" overwrite="true" />
</target>
<target name="combineAll" description="combines js libs and core/*.js files into one file" depends="timestamp">
<echo message="Building vie.js Distribution" />
<concat destfile="${DIST_DIR}/vie-ALL-${VERSION}_${current.time}.debug.js">
<string>/*
</string>
<fileset dir="${LIB_DIR}/jquery" includes="LICENSE"/>
<string>*/
</string>
<fileset dir="${LIB_DIR}/jquery/1.7" includes="jquery-1.7.1.min.js"/>
<string>/*
</string>
<fileset dir="${LIB_DIR}/underscoreJS" includes="LICENSE"/>
<string>*/
</string>
<fileset dir="${LIB_DIR}/underscoreJS" includes="underscore.js"/>
<string>/*
</string>
<fileset dir="${LIB_DIR}/backboneJS" includes="LICENSE"/>
<string>*/
</string>
<fileset dir="${LIB_DIR}/backboneJS" includes="backbone.js"/>
<string>/*
</string>
<fileset dir="${LIB_DIR}/json" includes="README"/>
<string>*/
</string>
<fileset dir="${LIB_DIR}/json" includes="json2.js"/>
<fileset dir="${DIST_DIR}" includes="vie-latest.debug.js"/>
</concat>
<copy file="${DIST_DIR}/vie-ALL-${VERSION}_${current.time}.debug.js" tofile="${DIST_DIR}/vie-ALL-latest.debug.js" overwrite="true" />
</target>
<target name="minimise">
<echo message="Minimising vie.js" />
<antcall target="minimiseJSFile">
<param name="inputFile" value="${DIST_DIR}/vie-${VERSION}_${current.time}.debug.js" />
<param name="outputFile" value="${DIST_DIR}/vie-${VERSION}_${current.time}.js" />
</antcall>
<replaceregexp file="${DIST_DIR}/vie-${VERSION}_${current.time}.js" match="^" replace="/* VIE ${VERSION} may be freely distributed under the MIT license. See http://viejs.org/ for more details. */" />
<copy file="${DIST_DIR}/vie-${VERSION}_${current.time}.js" tofile="${DIST_DIR}/vie-latest.js" overwrite="true" />
</target>
<target name="minimiseCore">
<echo message="Minimising vie-core.js" />
<antcall target="minimiseJSFile">
<param name="inputFile" value="${DIST_DIR}/vie-core-${VERSION}_${current.time}.debug.js" />
<param name="outputFile" value="${DIST_DIR}/vie-core-${VERSION}_${current.time}.js" />
</antcall>
<replaceregexp file="${DIST_DIR}/vie-core-${VERSION}_${current.time}.js" match="^" replace="/* VIE ${VERSION} may be freely distributed under the MIT license. See http://viejs.org/ for more details. */" />
<copy file="${DIST_DIR}/vie-core-${VERSION}_${current.time}.js" tofile="${DIST_DIR}/vie-core-latest.js" overwrite="true" />
</target>
<target name="minimiseAll">
<echo message="Minimising ALL vie.js" />
<antcall target="minimiseJSFile">
<param name="inputFile" value="${DIST_DIR}/vie-ALL-${VERSION}_${current.time}.debug.js" />
<param name="outputFile" value="${DIST_DIR}/vie-ALL-${VERSION}_${current.time}.js" />
</antcall>
<copy file="${DIST_DIR}/vie-ALL-${VERSION}_${current.time}.js" tofile="${DIST_DIR}/vie-ALL-latest.js" overwrite="true" />
<replaceregexp file="${DIST_DIR}/vie-latest.js" match="^" replace="/*VIE may be freely distributed under the MIT license.*/" />
</target>
<target name="minimiseJSFile">
<java jar="${YUI}" fork="true" failonerror="true">
<arg line="--type js" />
<arg line="-o ${outputFile}" />
<arg value="${inputFile}" />
</java>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.