Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 337 lines (295 sloc) 12.425 kB
<?xml version="1.0"?>
<project name="erjang" default="all">
<property name="erjang.version" value="0.2" />
<property file="erjang_cfg.properties" />
<path id="erjang.classpath">
<pathelement location="target/classes/" />
<pathelement location="lib/js.jar" />
<pathelement location="lib/kilim.jar" />
<pathelement location="lib/OtpErlang.jar" />
<pathelement location="lib/junit.jar" />
<pathelement location="lib/clj-ds.jar" />
<pathelement location="lib/antlr-3.2.jar" />
<pathelement path="${java.class.path}" />
</path>
<path id="erjang.testwovenclasspath">
<pathelement location="target/classes/" />
<pathelement location="target/test-classes/" />
<pathelement location="lib/kilim.jar" />
<pathelement location="lib/OtpErlang.jar" />
<pathelement location="lib/clj-ds.jar" />
<pathelement location="lib/junit.jar" />
<pathelement location="lib/antlr-3.2.jar" />
<pathelement path="${java.class.path}" />
</path>
<!-- set the operating system test properties -->
<condition property="isMac">
<os family="mac" />
</condition>
<condition property="isWindows">
<os family="windows" />
</condition>
<condition property="isLinux">
<and>
<os family="unix" />
<not>
<os family="mac"/>
</not>
</and>
</condition>
<target name="all" depends="clean,weave,jar" />
<target name="all_with_test" depends="all,weavetest" />
<target name="test" depends="all_with_test,testwoven,perf_test" />
<target name="gen-interpreter">
<echo message="generating interpreter code ===================" />
<exec dir="src/main/java/erjang/beam/interpreter"
executable="perl"
input="src/main/java/erjang/beam/interpreter/ops.spec" failonerror="yes">
<arg value="-W"/>
<arg value="ErjIG_Main.pl"/>
</exec>
</target>
<target name="create-dirs">
<mkdir dir="target" />
<mkdir dir="target/classes" />
<mkdir dir="target/test-classes" />
<mkdir dir="target/test-beam" />
<mkdir dir="target/compiled" />
</target>
<target name="untar_mini_release">
<untar src="erl-r16b01-mini.tgz2" dest="." compression="bzip2" overwrite="false" />
</target>
<target name="gen-test-classes" description="generate test classes based on a generic one" depends="create-dirs,ensure_otp">
<echo message="generating test classes ===================" />
<java classname="erjang.AllTests"
failonerror="true"
fork="true">
<jvmarg value="-Derjang.otp.root=${erjang.otp.root}" />
<arg value="src/test/java/erjang/"/>
<classpath>
<pathelement location="target/test-classes" />
</classpath>
<classpath refid="erjang.classpath" />
</java>
</target>
<target name="compile" depends="gen-interpreter,create-dirs">
<echo message="Compiling src ===================" />
<javac includeantruntime="false" debug="true" srcdir="src/main/java" destdir="target/classes" classpathref="erjang.classpath" deprecation="off" debuglevel="lines,vars,source" target="1.7" source="1.7" fork="true"/>
</target>
<target name="testcompile" depends="compile">
<echo message="Compiling test ===================" />
<javac includeantruntime="false" debug="true" srcdir="src/test/java" destdir="target/test-classes" debuglevel="lines,vars,source" target="1.7">
<classpath>
<pathelement location="target/test-classes" />
</classpath>
<classpath refid="erjang.classpath" />
</javac>
</target>
<target name="gen-test-compile" depends="testcompile,gen-test-classes">
<echo message="Compiling generated test classes ===================" />
<javac includeantruntime="false" debug="true" srcdir="src/test/java" destdir="target/test-classes" debuglevel="lines,vars,source" target="1.7">
<classpath>
<pathelement location="target/test-classes" />
</classpath>
<classpath refid="erjang.classpath" />
</javac>
</target>
<target name="weave" depends="compile">
<echo message="Weaving files ===================" />
<java classname="kilim.tools.Weaver" fork="yes">
<classpath refid="erjang.classpath" />
<assertions>
<enable />
</assertions>
<jvmarg value="-Dkilim.optimize_codesize=true" />
<arg value="-q" />
<arg value="-d" />
<arg value="./target/classes" />
<arg line="./target/classes" />
</java>
</target>
<target name="weavetest" depends="gen-test-compile">
<echo message="Weaving test classes ==============" />
<java classname="kilim.tools.Weaver" fork="yes">
<classpath refid="erjang.classpath" />
<assertions>
<enable />
</assertions>
<jvmarg value="-Dkilim.optimize_codesize=true" />
<arg value="-q" />
<arg value="-d" />
<arg value="./target/test-classes" />
<arg line="./target/test-classes" />
</java>
</target>
<target name="clean">
<echo message="deleting files ===================" />
<delete>
<fileset defaultexcludes="no" dir="." includes="*~,#*,foo,bar,x,y" />
</delete>
<delete dir="./target" />
<delete dir="./.erj" />
<delete>
<fileset dir="src/test/java/erjang" includes="**/*_TEST.java" />
</delete>
</target>
<!-- This runs those tests depend on generated classes in testclasses-->
<target name="testwoven" depends="weavetest,ensure_otp">
<echo message="Testing Tasks ======================" />
<mkdir dir="test-outputs" />
<junit fork="yes" showoutput="yes" printsummary="true">
<formatter type="brief" usefile="false" />
<formatter type="xml"/> <!-- For CI server use. -->
<!-- <formatter type="brief" usefile="false"/> -->
<classpath>
<pathelement location="target/test-classes" />
<pathelement location="target/test-classes/generated/classes" />
</classpath>
<classpath refid="erjang.classpath" />
<assertions><enable /></assertions>
<env key="OTPROOT" file="${erjang.otp.root}"/>
<jvmarg value="-Xmx700m"/>
<jvmarg value="-Xss50m"/>
<jvmarg value="-XX:PermSize=128m"/>
<jvmarg value="-XX:MaxPermSize=700m"/>
<jvmarg value="-Dkilim.optimize_codesize=true" />
<jvmarg value="-Derjang.otp.root=${erjang.otp.root}"/>
<jvmarg value="-Derjang.triq.root=${erjang.triq.root}"/>
<batchtest todir="test-outputs">
<fileset dir="target/test-classes" includes="**/*_TEST.class">
<exclude name="**/arith_tests_erl_TEST.class" />
<exclude name="**/arith_guard_tests_erl_TEST.class" />
<exclude name="**/utf_tests_erl_TEST.class" />
<exclude name="**/ets_test_erl_TEST.class" />
<exclude name="**/erjang_test_erl_TEST.class" />
</fileset>
<!-- <fileset dir="target/test-classes" includes="**/float_tests_erl_TEST.class" />-->
</batchtest>
</junit>
</target>
<target name="arch_linux" if="isLinux">
<property name="otp_arch" value="x86_64-unknown-linux-gnu" />
</target>
<target name="arch_macos" if="isMac">
<property name="otp_arch" value="x86_64-apple-darwin12.4.0" />
</target>
<target name="arch" depends="arch_linux,arch_macos" />
<target name="test_otp">
<available property="has_otp" value="true"
file="${erjang.otp.root}"
type="dir" />
<available property="otp_downloaded"
file="otp_r16b01.tgz"
type="file" />
<property name="erjang.triq.root" value="${basedir}/triq" />
</target>
<target name="download_otp_unix" if="isLinux" depends="test_otp" unless="otp_downloaded">
<echo message="Downloading Erlang/OTP for Linux..."/>
<exec dir="." executable="curl">
<arg value="-s"/>
<arg value="-o"/>
<arg value="otp_r16b01.tgz"/>
<arg value="https://dl.dropboxusercontent.com/u/1360473/otp_r16b01_linux.tgz"/>
</exec>
</target>
<target name="download_otp_macos" if="isMac" depends="test_otp" unless="otp_downloaded">
<echo message="Downloading Erlang/OTP for MacOS X..."/>
<exec dir="." executable="curl">
<arg value="-s"/>
<arg value="-o"/>
<arg value="otp_r16b01.tgz"/>
<arg value="https://dl.dropboxusercontent.com/u/1360473/otp_r16b01_macos.tgz"/>
</exec>
</target>
<target name="ensure_otp"
depends="test_otp,arch,download_otp_unix,download_otp_macos"
unless="has_otp">
<exec dir="." executable="tar">
<arg value="xzpf" />
<arg value="otp_r16b01.tgz" />
</exec>
<property name="erjang.otp.root" value="${basedir}/${otp_arch}" />
<exec dir="." executable="${erjang.otp.root}/Install">
<arg value="-minimal" />
<arg value="${erjang.otp.root}" />
</exec>
<echo message="Did install erlang in ${erjang.otp.root}" />
</target>
<target name="get_otp_version" depends="ensure_otp">
<exec outputproperty="erjang.otp.version"
dir="."
executable="${erjang.otp.root}/bin/erl">
<arg value="-noshell"/>
<arg value="-eval"/>
<arg value='io:format("~s", [erlang:system_info(otp_release)]), erlang:halt().'/>
</exec>
<echo message="Erlang version is ${erjang.otp.version}" />
</target>
<target name="perf_test" depends="estone_test,boot_stat_test"/>
<target name="estone_test" depends="ensure_otp">
<echo message="running estone with root=${erjang.otp.root}" />
<exec dir="." executable="bash" failonerror="no">
<arg value="src/test/shell/run-estone.sh"/>
<arg value="test-outputs/estone"/>
<env key="OTPROOT" file="${erjang.otp.root}"/>
</exec>
</target>
<target name="boot_stat_test">
<exec dir="." executable="bash" failonerror="no">
<arg value="src/test/shell/run-boot.sh"/>
<arg value="test-outputs/boot-stats"/>
<env key="OTPROOT" file="${erjang.otp.root}"/>
</exec>
</target>
<target name="jar" description="generate the distribution" depends="clean,weave">
<echo message="Packaging ======================" />
<copy file="LICENSE" todir="classes/erjang" />
<copy file="NOTICE" todir="classes/erjang" />
<copy file="erjang_logo4.png" todir="classes/erjang" />
<jar jarfile="erjang-${erjang.version}.jar" basedir="target/classes">
<zipgroupfileset dir="lib" includes="*.jar">
<exclude name="junit.jar" />
</zipgroupfileset>
<exclude name="erjang/test/**" />
<exclude name="erjang/examples/**" />
<exclude name="erjang/bench/**" />
<manifest>
<attribute name="Main-Class" value="erjang.Main" />
</manifest>
</jar>
</target>
<target name="otpjar" depends="get_otp_version">
<jar jarfile="otp-${erjang.otp.version}.jar" basedir="${erjang.otp.root}">
<exclude name="**/*.so" />
<exclude name="**/*.dll" />
<exclude name="**/*.a" />
<exclude name="**/*.erl" />
<exclude name="**/bin/beam" />
<exclude name="**/bin/beam.smp" />
<exclude name="lib/megaco-*/**" />
<exclude name="lib/wx-*/**" />
<exclude name="lib/hipe-*/**" />
<exclude name="lib/jinterface-*/**" />
<exclude name="lib/erl_interface-*/**" />
<exclude name="lib/ic-*/java_src/**" />
<exclude name="usr/include/**" />
<exclude name="**/examples/**" />
</jar>
</target>
<target name="alljar" depends="jar,otpjar">
<jar jarfile="erjang-${erjang.otp.version}.jar" basedir="${erjang.otp.root}">
<!-- include all of erjang -->
<zipgroupfileset dir="." includes="erjang-${erjang.version}.jar" />
<!-- include all of OTP -->
<zipgroupfileset dir="." includes="otp-${erjang.otp.version}.jar" />
<manifest>
<attribute name="Main-Class" value="erjang.Main" />
</manifest>
</jar>
</target>
<target name="javadoc" description="generate Javadoc documentation">
<javadoc destdir="target/doc">
<fileset dir="src"><include name="**/*.java"/></fileset>
</javadoc>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.