Permalink
Fetching contributors…
Cannot retrieve contributors at this time
168 lines (146 sloc) 8.36 KB
<?xml version="1.0" encoding="UTF-8"?>
<project name="easyXDM" default="build" basedir=".">
<property file="build.properties"/>
<property file="build.secret.properties"/>
<property name="project.build.artifactdir" value="./artifacts/"/>
<property name="project.build.publishdir" value="./artifacts/"/>
<property name="project.build.version" value="2.4.12"/>
<!-- Setup classpath for js-build-tools ant tasks -->
<path id="js-build-tasks.classpath">
<pathelement location="."/>
<fileset dir="tools/js-build-tools/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="preprocess" classname="com.moxiecode.ant.tasks.PreProcessTask" classpathref="js-build-tasks.classpath" loaderref="js-build-tasks.classpath.loader" />
<taskdef name="yuicompress" classname="com.moxiecode.ant.tasks.YuiCompressTask" classpathref="js-build-tasks.classpath" loaderref="js-build-tasks.classpath.loader" />
<taskdef name="jslint" classname="com.googlecode.jslint4java.ant.JSLintTask" classpath="tools/jslint4java-1.3.3/jslint4java-1.3.3.jar" />
<path id="githubhuploadtask.classpath">
<pathelement location="."/>
<fileset dir="tools/GitHubUploadTask">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="upload" classname="no.kinsey.ant.GitHubUploadTask" classpathref="githubhuploadtask.classpath" loaderref="githubhuploadtask.classpath.loader" />
<target name="clean" depends="" description="Cleans up the project from temporary files">
<delete dir="work" quiet="true"/>
<delete dir="${project.build.artifactdir}v${project.build.version}" quiet="true"/>
</target>
<target name="jslint">
<jslint>
<formatter type="plain" />
<fileset dir="${project.src.dir}" includes="easyXDM*.js"/>
<fileset dir="${project.src.dir}/stack/" includes="*.js"/>
</jslint>
</target>
<target name="build" depends="clean,jslint">
<buildnumber/>
<mkdir dir="work"/>
<concat destfile="work/easyXDM.combined.js">
<fileset dir="." includes="${project.src.dir}/begin_scope.txt" />
<fileset dir="." includes="${project.src.dir}/Core.js" />
<fileset dir="." includes="${project.src.dir}/Debug.js" />
<fileset dir="." includes="${project.src.dir}/DomHelper.js" />
<fileset dir="." includes="${project.src.dir}/Fn.js" />
<fileset dir="." includes="${project.src.dir}/Socket.js" />
<fileset dir="." includes="${project.src.dir}/Rpc.js" />
<fileset dir="." includes="${project.src.dir}/stack/SameOriginTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/FlashTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/PostMessageTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/FrameElementTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/NameTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/HashTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/ReliableBehavior.js" />
<fileset dir="." includes="${project.src.dir}/stack/QueueBehavior.js" />
<fileset dir="." includes="${project.src.dir}/stack/VerifyBehavior.js" />
<fileset dir="." includes="${project.src.dir}/stack/RpcBehavior.js" />
<fileset dir="." includes="${project.src.dir}/end_scope.txt" />
</concat>
<replace file="work/easyXDM.combined.js" token="%%version%%" value="${project.build.version}.${build.number}"/>
<!-- Process pre proccesing instructions like #if/#endif etc -->
<preprocess infile="work/easyXDM.combined.js" outfile="work/easyXDM.js"/>
<preprocess infile="work/easyXDM.combined.js" outfile="work/easyXDM.debug.js" defines="debug"/>
<preprocess infile="${project.src.dir}/name.html" outfile="work/name.html"/>
<preprocess infile="${project.src.dir}/widgets/Widgets.js" outfile="work/easyXDM.Widgets.js"/>
<preprocess infile="${project.src.dir}/widgets/Widgets.js" outfile="work/easyXDM.Widgets.debug.js" defines="debug"/>
<!-- Compress the file using the YUI Compressor -->
<yuicompress infile="work/easyXDM.js" outfile="work/easyXDM.min.js" />
<yuicompress infile="${project.src.dir}/widgets/Widgets.js" outfile="work/easyXDM.Widgets.min.js" />
<!-- concat header files -->
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.debug.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.debug.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.min.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.min.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.Widgets.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.Widgets.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.Widgets.debug.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.Widgets.debug.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.Widgets.min.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.Widgets.min.js" />
</concat>
<delete file="work/easyXDM.combined.js" quiet="true"/>
<copy todir="${project.build.artifactdir}v${project.build.version}">
<fileset dir="work"/>
<fileset file= "MIT-license.txt"/>
<fileset file= "README.txt"/>
<fileset file= "${project.src.dir}/changes.txt"/>
<fileset file= "tools/json2.js"/>
<fileset file= "src/easyxdm.swf"/>
</copy>
<copy todir="${project.src.dir}/tests">
<fileset file="work/easyXDM.debug.js"/>
</copy>
<copy todir="${project.build.artifactdir}v${project.build.version}/example">
<fileset dir="${project.src.dir}/example"/>
</copy>
<copy todir="${project.build.artifactdir}v${project.build.version}/cors">
<fileset dir="${project.src.dir}/cors"/>
</copy>
<copy todir="${project.build.artifactdir}v${project.build.version}/tests">
<fileset dir="${project.src.dir}/tests"/>
</copy>
</target>
<target name="document">
<delete dir="${project.build.artifactdir}v${project.build.version}-docs" quiet="true"/>
<java jar="tools/ext-doc/ext-doc.jar" fork="true" failonerror="true" maxmemory="128m" >
<arg line="-p docs.xml -o ${project.build.artifactdir}v${project.build.version}-docs -t tools/ext-doc/template/ext/template.xml"/>
</java>
<replace file="${project.build.artifactdir}v${project.build.version}-docs/index.html" token="%%version%%" value="${project.build.version}.${build.number}"/>
</target>
<target name="package" depends="build">
<zip destfile="${project.build.artifactdir}${ant.project.name}-${project.build.version}.${build.number}.zip" basedir="${project.build.artifactdir}v${project.build.version}"/>
</target>
<target name="publish" depends="document, package">
<delete dir="${project.build.publishdir}v${project.build.version}" quiet="true" />
<copy todir="${project.build.publishdir}v${project.build.version}">
<fileset dir="${project.build.artifactdir}v${project.build.version}"/>
</copy>
<copy todir="${project.build.publishdir}v${project.build.version}/docs/">
<fileset dir="${project.build.artifactdir}v${project.build.version}-docs"/>
</copy>
</target>
<target name="publishtoweb" depends="package, document">
<delete dir="${project.build.publishdir}v${project.build.version}" quiet="true" />
<copy todir="${project.build.publishdir}v${project.build.version}">
<fileset dir="${project.build.artifactdir}v${project.build.version}"/>
</copy>
<copy todir="${project.build.publishdir}v${project.build.version}/docs/">
<fileset dir="${project.build.artifactdir}v${project.build.version}-docs"/>
</copy>
<copy file="${project.build.artifactdir}${ant.project.name}-${project.build.version}.${build.number}.zip" tofile="${project.build.publishdir}v${project.build.version}/download.zip" />
<upload user="${github.user}" repo="${github.repo}" username="${github.username}" token="${github.token}" description="just a test" path="${project.build.artifactdir}${ant.project.name}-${project.build.version}.${build.number}.zip" />
</target>
</project>