Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 247 lines (204 sloc) 7.75 KB
<?xml version="1.0"?>
<project name="stack-trunk" default="all" basedir=".">
<!-- =================================================================== -->
<!-- Initializes some variables -->
<!-- =================================================================== -->
<property name="project" value="axiom"/>
<property name="home.dir" value="."/>
<property name="build.dir" value="${home.dir}/build"/>
<property name="build.test" value="${build.dir}/test"/>
<property name="lib.dir" value="${home.dir}/lib"/>
<property name="src.dir" value="${home.dir}/src"/>
<property name="src.tests" value="${src.dir}/java/test"/>
<property name="apps.dir" value="${home.dir}/apps"/>
<property name="modules.dir" value="${home.dir}/modules"/>
<property name="jsdoc.dir" value="${home.dir}/doc"/>
<property name="javadoc.dir" value="${home.dir}/javadoc"/>
<property name="utils.dir" value="${home.dir}/utils"/>
<property name="examples.dir" value="${home.dir}/examples"/>
<property name="reports.dir" value="${home.dir}/reports"/>
<property name="axiom-jar.name" value="axiom.jar"/>
<property name="launcher-jar.name" value="launcher.jar"/>
<property name="js-jar.name" value="js.zip"/>
<property name="test.app" value="test"/>
<property name="reports.test" value="${reports.dir}/test"/>
<property environment="env"/>
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<!-- <fileset dir="${env.JAVA_HOME}/lib"> -->
<!-- <include name="tools.jar"/> -->
<!-- </fileset> -->
</path>
<target name="all" depends="build"/>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir}/classes"/>
</target>
<target name="clean">
<delete file="${home.dir}/${launcher-jar.name}"/>
<delete file="${lib.dir}/${axiom-jar.name}"/>
<delete file="${lib.dir}/${js-jar.name}"/>
<delete dir="${build.dir}"/>
<delete dir="${jsdoc.dir}"/>
<delete dir="${javadoc.dir}"/>
</target>
<target name="build" depends="clean, init">
<antcall target="jar"/>
<antcall target="jsdoc"/>
<antcall target="javadoc"/>
</target>
<target name="compile" depends="init">
<property name="deprecation" value="off"/>
<property name="debug" value="on"/>
<property name="optimize" value="on"/>
<property name="encoding" value="utf-8" />
<javac srcdir="${src.dir}/java"
encoding="${encoding}"
destdir="${build.dir}/classes"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
excludes="${src.dir}/test/**/*Test*.java">
<classpath refid="classpath" />
</javac>
</target>
<target name="jar" depends="compile" description="Packages the JAR file">
<!-- Build axiom.jar-->
<jar jarfile="${lib.dir}/${axiom-jar.name}"
basedir="${build.dir}/classes"
excludes="**/test/**, **/main/launcher/**"/>
<!-- build js.zip -->
<zip compress="false" destfile="${lib.dir}/js.zip"
basedir="${src.dir}/js"/>
<!-- Build launcher.jar -->
<jar jarfile="${home.dir}/${launcher-jar.name}"
basedir="${build.dir}/classes"
includes="**/main/launcher/**"
manifest="${src.dir}/java/axiom/main/launcher/manifest.txt"/>
</target>
<target name="junits" depends="clean,jar">
<mkdir dir="${build.test}"/>
<mkdir dir="${reports.test}"/>
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<pathelement location="${build.test}"/>
<pathelement location="${build.dir}/classes"/>
<path refid="classpath"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="${reports.test}">
<fileset dir="${src.tests}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="test">
<delete failonerror="false" ><fileset dir="${home.dir}/db" /></delete>
<move file="${apps.dir}/${test.app}/app.properties.test" tofile="${apps.dir}/${test.app}/app.properties"/>
<move todir="${apps.dir}" includeemptydirs="false">
<fileset dir="${apps.dir}" casesensitive="yes">
<exclude name="**/${test.app}/*"/>
<include name="**/app.properties"/>
</fileset>
<mapper type="glob" from="*" to="*.testing"/>
</move>
<antcall target="clean">
<param name="version" value="${java_version}"/>
</antcall>
<antcall target="jar">
<param name="version" value="${java_version}"/>
</antcall>
<antcall target="junits"></antcall>
<java jar="${home.dir}/launcher.jar" fork="true" timeout="150000">
<sysproperty key="file.encoding" value="UTF-8"/>
<sysproperty key="org.apache.lucene.FSDirectory.class" value="org.apache.lucene.store.TransFSDirectory"/>
<arg line="-w 8081 -h ${home.dir}"/>
</java>
<move todir="${apps.dir}" includeemptydirs="false">
<fileset dir="${apps.dir}" casesensitive="yes">
<exclude name="**/${test.app}/*"/>
<include name="**/app.properties.testing"/>
</fileset>
<mapper type="glob" from="*.testing" to="*"/>
</move>
<move file="${apps.dir}/test/app.properties" tofile="${apps.dir}/${test.app}/app.properties.test"/>
</target>
<target name="javadoc">
<javadoc sourcepath="${src.dir}/java"
destdir="${javadoc.dir}"
packagenames="*"
classpathref="classpath"/>
</target>
<target name="jsdoc" depends="compile">
<javadoc
doclet="axiom.util.JSDoclet"
docletpath="${build.dir}/classes/"
sourcepath="${src.dir}/java"
classpathref="classpath">
<packageset dir="${src.dir}/java" defaultexcludes="yes">
<include name="axiom/**"/>
</packageset>
</javadoc>
<java jar="${utils.dir}/jsdoc-toolkit/jsrun.jar" fork="true">
<arg line="${utils.dir}/jsdoc-toolkit/app/run.js -t=${utils.dir}/jsdoc-toolkit/templates/jsdoc/ -d=${jsdoc.dir} alldoc.js ${src.dir}/js/Global"/>
</java>
<delete file="alldoc.js"/>
</target>
<target name="loadtest-start">
<exec executable="./loadtest.sh" spawn="true"/>
<exec executable="sleep">
<arg value="10"/>
</exec>
</target>
<target name="loadtest-stop">
<exec executable="./loadtest-stop.sh"/>
</target>
<target name="loadtest-remote-deploy">
<exec executable="./utils/loadtest-remote-deploy.sh"/>
<exec executable="sleep">
<arg value="10"/>
</exec>
</target>
<target name="loadtest-remote-cleanup">
<exec executable="./loadtest.sh"/>
</target>
<target name="loadtest-tsung-cached" >
<exec executable="utils/tsung_ctl.sh">
<env key="OUTPUT_PREFIX" value="tsung-cached"/>
<env key="TSUNG_LOG" value="tsunglog-cached"/>
<env key="TSUNG_TIME" value="4"/>
<env key="TSUNG_CONFIG" value="loadtesting/tsung/tsung-cached.xml"/>
</exec>
</target>
<target name="loadtest-tsung-notcached" >
<exec executable="utils/tsung_ctl.sh">
<env key="OUTPUT_PREFIX" value="tsung-notcached"/>
<env key="TSUNG_LOG" value="tsunglog-notcached"/>
<env key="TSUNG_TIME" value="4"/>
<env key="TSUNG_CONFIG" value="loadtesting/tsung/tsung-notcached.xml"/>
</exec>
</target>
<target name="loadtest-jmeter-tests">
<copy file="loadtesting/jmeter/tests.jmx" tofile="jmeter_conf.jmx"/>
<exec executable="utils/jmeter_config.sh">
<arg value="jmeter_conf.jmx"/>
</exec>
<exec executable="/opt/jmeter/bin/jmeter">
<arg value="-n"/>
<arg line="-t jmeter_conf.jmx"/>
<arg line="-p /opt/jmeter/bin/jmeter.properties"/>
<arg line="-l loadtesting/jmeter.jtl"/>
<arg line="-j loadtesting/jmeter.log"/>
<arg value="-r"/>
</exec>
</target>
<target name="loadtest-tsung" depends="loadtest-start, loadtest-tsung-notcached, loadtest-tsung-cached, loadtest-stop">
</target>
<target name="loadtest-jmeter" depends="loadtest-start, loadtest-jmeter-tests, loadtest-stop">
</target>
<target name="loadtest-all" depends="loadtest-jmeter, loadtest-tsung">
</target>
</project>