Permalink
Fetching contributors…
Cannot retrieve contributors at this time
304 lines (253 sloc) 13.7 KB
<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="jar" name="ioke">
<description>
ioke is a next generation language, based on Io, Self, Smalltalk, Ruby and Lisp
</description>
<property environment="env" />
<condition property="VERSION_ADDITION" value="">
<isset property="env.BUILD_RELEASE_VERSION" />
</condition>
<condition property="VERSION_ADDITION" value="-p${env.GO_PIPELINE_COUNTER}">
<isset property="env.ADD_SNAPSHOT_VERSION" />
</condition>
<property file="build.properties"/>
<property file="default.build.properties"/>
<property file="version.properties"/>
<taskdef resource="tasks.properties">
<classpath>
<fileset dir="${lib.build.dir}" includes="*.jar"/>
<fileset dir="${lib.release.dir}" includes="asm-*.jar"/>
</classpath>
</taskdef>
<path id="build.classpath">
<fileset dir="${lib.build.dir}" includes="*.jar"/>
<fileset dir="${lib.release.dir}" includes="*.jar"/>
</path>
<target name="prepare" description="Creates the directories needed for building">
<mkdir dir="${build.dir}"/>
<mkdir dir="${coverage.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${test.results.dir}"/>
<mkdir dir="${html.test.results.dir}"/>
</target>
<target name="generate_filters" depends="prepare" description="Generates source files">
<exec executable="ruby" input="generate_filter_data.rb" failonerror="false" failifexecutionfails="false"/>
</target>
<target name="generate_version_data" depends="generate_filters" description="Generates version data">
<filter filtersfile="version_data.properties"/>
<filter token="VERSION" value="${VERSION_NAME}"/>
<filter token="VERSION_RUNTIME" value="${VERSION_NUMBER}${VERSION_ADDITION}"/>
<filter token="VERSION_STRING" value="Ioke ${VERSION_NAME} ikj ${VERSION_NUMBER}${VERSION_ADDITION}"/>
<copy todir="${classes.dir}" filtering="true" overwrite="true">
<fileset dir="${src.dir}" includes="**/*.properties"/>
</copy>
</target>
<target name="add_new_version_file" depends="generate_version_data" description="Adds a new version property file to an existing jar-file">
<jar destfile="${lib.dir}/ioke.jar" update="true">
<fileset dir="${classes.dir}">
<include name="**/*.properties"/>
</fileset>
</jar>
</target>
<target name="gen-pom" description="Creates new pom.xml files based on the current version configuration. This should be run before doing any Maven stuff">
<filter token="VERSION_NAME" value="${VERSION_NAME}"/>
<filter token="VERSION_NUMBER" value="${VERSION_NUMBER}"/>
<filter token="VERSION_ADDITION" value="${VERSION_ADDITION}"/>
<copy file="maven/ikj/pom.xml.template" tofile="maven/ikj/pom.xml" filtering="true" overwrite="true"/>
<copy file="maven/ikj-lib/pom.xml.template" tofile="maven/ikj-lib/pom.xml" filtering="true" overwrite="true"/>
</target>
<target name="compile" depends="generate_filters" description="Compile the source files for the project.">
<filter filtersfile="version_data.properties"/>
<filter token="VERSION" value="${VERSION_NAME}"/>
<filter token="VERSION_RUNTIME" value="${VERSION_NUMBER}${VERSION_ADDITION}"/>
<filter token="VERSION_STRING" value="Ioke ${VERSION_NAME} ikj ${VERSION_NUMBER}${VERSION_ADDITION}"/>
<javac destdir="${classes.dir}" debug="true" source="${javac.version}" target="${javac.version}" encoding="UTF-8">
<classpath refid="build.classpath"/>
<src path="${src.dir}"/>
<include name="**/*.java"/>
</javac>
<copy todir="${classes.dir}" filtering="true" overwrite="true">
<fileset dir="${src.dir}" includes="**/*.properties,**/*.html,**/*.css"/>
</copy>
<copy todir="${classes.dir}">
<fileset dir="${src.raw.dir}" includes="builtin/**/*.ik"/>
<fileset dir="${src.raw.dir}/ikj" includes="builtin/**/*.ik"/>
</copy>
</target>
<target name="coverage.instrument" depends="compile, ci-coverage.instrument" description=""/>
<target name="ci-coverage.instrument" description="">
<cobertura-instrument todir="${coverage.classes.dir}">
<fileset dir="${classes.dir}" excludes="ioke/lang/parser/**/*.class,com/google/**/*.class,org/jregex/**/*.class,gnu/**/*.class,ioke/lang/test/**/*.class,ioke/lang/performance/**/*.class"/>
</cobertura-instrument>
</target>
<target name="test" depends="compile" description="Runs all ISpec tests">
<java classname="ioke.lang.Main" fork="true" failonerror="true" maxmemory="256m">
<sysproperty key="ispec.ansi" value="${ispec.ansi}"/>
<classpath refid="build.classpath"/>
<classpath path="${classes.dir}"/>
<arg line="bin/ispec test -fs"/>
</java>
</target>
<target name="ci-test" description="Runs all ISpec tests">
<java classname="ioke.lang.Main" fork="true" maxmemory="256m" resultproperty="ispec.result">
<sysproperty key="ispec.ansi" value="${ispec.ansi}"/>
<classpath refid="build.classpath"/>
<classpath path="${classes.dir}"/>
<arg line="bin/ispec test -fx to: ${test.results.dir}"/>
</java>
<delete dir="${html.test.results.dir}" quiet="true"/>
<delete file="${test.results.dir}/TESTS-TestSuites.xml" quiet="true"/>
<junitreport todir="${test.results.dir}" tofile="../TESTS-TestSuites.xml">
<fileset dir="${test.results.dir}" includes="TEST-*.xml"/>
<report format="noframes" todir="${html.test.results.dir}"/>
</junitreport>
<condition property="ispec.failure">
<not>
<equals arg1="0" arg2="${ispec.result}"/>
</not>
</condition>
<fail if="ispec.failure" message="Test(s) failed."/>
</target>
<target name="ci-dokgen" description="Generate dokumentation">
<java classname="ioke.lang.Main" failonerror="true" fork="true" maxmemory="512m" >
<classpath refid="build.classpath"/>
<classpath path="${classes.dir}"/>
<arg line="bin/dokgen -S"/>
</java>
</target>
<target name="coverage" depends="compile, ci-coverage" description="Runs all ISpec tests using Cobertura and produces a report"/>
<target name="ci-coverage" depends="ci-coverage.instrument" description="Runs all ISpec tests using Cobertura and produces a report">
<java classname="ioke.lang.Main" fork="true" maxmemory="320m" failonerror="true">
<classpath path="${coverage.classes.dir}"/>
<classpath refid="build.classpath"/>
<classpath path="${classes.dir}"/>
<arg line="bin/ispec test -fs"/>
</java>
<cobertura-report srcdir="${src.dir}" destdir="${coverage.report.dir}"/>
</target>
<target name="jar" depends="test, ci-jar" description="Create the ioke.jar file"/>
<target name="ci-jar" depends="prepare" description="Create the ioke.jar file without depending on earlier stages">
<jar destfile="${lib.dir}/ioke.jar">
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<include name="**/*.ik"/>
<include name="**/*.properties"/>
<include name="**/*.html"/>
<include name="**/*.css"/>
</fileset>
<zipfileset src="${lib.release.dir}/jline-0.9.93.jar" includes="**/*"/>
<zipfileset src="${lib.release.dir}/joda-time-1.6.jar" includes="**/*"/>
<zipfileset src="${lib.release.dir}/asm-3.3.1.jar" includes="**/*"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="ioke.lang.Main"/>
</manifest>
</jar>
</target>
<target name="jar-lib" depends="jar, ci-jar-lib" description="Create the ioke-lib.jar file"/>
<target name="ci-jar-lib" depends="prepare" description="Create the ioke-lib.jar file">
<jar destfile="${lib.dir}/ioke-lib.jar">
<fileset dir="lib/ioke">
<include name="**/*"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
</target>
<target name="jar-notest" depends="compile, ci-jar" description="Create the ioke.jar file"/>
<target name="jar-lib-notest" depends="jar-notest" description="Create the ioke-lib.jar file">
<jar destfile="${lib.dir}/ioke-lib.jar">
<fileset dir="lib/ioke">
<include name="**/*"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
</manifest>
</jar>
</target>
<target name="dist-bin" depends="jar, ci-dist-bin"/>
<target name="ci-push-distribution-files" depends="prepare">
<copy file="${lib.dir}/ioke.jar" tofile="${release.dir}/ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.jar" overwrite="true"/>
<copy file="${lib.dir}/ioke-lib.jar" tofile="${release.dir}/ioke-${VERSION_NAME}-ikj-lib-${VERSION_NUMBER}${VERSION_ADDITION}.jar" overwrite="true"/>
<scp todir="ioke.org@ioke.org:/home/ioke.org/web/public/dist" keyfile="${user.home}/.ssh/id_rsa">
<fileset dir="${release.dir}">
<include name="ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz"/>
<include name="ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.zip"/>
<include name="ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.jar"/>
<include name="ioke-${VERSION_NAME}-ikj-lib-${VERSION_NUMBER}${VERSION_ADDITION}.jar"/>
<include name="ioke-${VERSION_NAME}-ikc-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz"/>
<include name="ioke-${VERSION_NAME}-ikc-${VERSION_NUMBER}${VERSION_ADDITION}.zip"/>
</fileset>
</scp>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; rm -rf *-latest.*)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz ioke-ikj-latest.tar.gz)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.zip ioke-ikj-latest.zip)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.jar ioke-ikj-latest.jar)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikj-lib-${VERSION_NUMBER}${VERSION_ADDITION}.jar ioke-ikj-lib-latest.jar)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikc-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz ioke-ikc-latest.tar.gz)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public/dist; ln -s ioke-${VERSION_NAME}-ikc-${VERSION_NUMBER}${VERSION_ADDITION}.zip ioke-ikc-latest.zip)"/>
</target>
<target name="ci-push-snapshot-doks" depends="prepare">
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public; mkdir -p dok/latest)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public; rm -rf dok/latest/*)"/>
<scp todir="ioke.org@ioke.org:/home/ioke.org/web/public/dok/latest" keyfile="${user.home}/.ssh/id_rsa">
<fileset dir="dok"/>
</scp>
</target>
<target name="ci-push-release-doks" depends="prepare">
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public; mkdir -p dok/release)"/>
<sshexec host="ioke.org" username="ioke.org" keyfile="${user.home}/.ssh/id_rsa" command="(cd /home/ioke.org/web/public; rm -rf dok/release/*"/>
<scp todir="ioke.org@ioke.org:/home/ioke.org/web/public/dok/release" keyfile="${user.home}/.ssh/id_rsa">
<fileset dir="dok"/>
</scp>
</target>
<target name="ci-dist-bin" depends="prepare">
<tar destfile="${release.dir}/ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz" compression="gzip">
<tarfileset mode="755" dir="." prefix="ioke">
<include name="bin/*.bat"/>
<include name="bin/dokgen"/>
<include name="bin/ioke"/>
<include name="bin/ispec"/>
</tarfileset>
<tarfileset dir="." prefix="ioke">
<include name="lib/ioke*.jar"/>
<include name="lib/ioke/**"/>
<include name="dok/**"/>
<include name="share/**"/>
<include name="COPYING"/>
<include name="LICENSE"/>
<include name="LICENSE.kawa"/>
<include name="README"/>
</tarfileset>
</tar>
<zip destfile="${release.dir}/ioke-${VERSION_NAME}-ikj-${VERSION_NUMBER}${VERSION_ADDITION}.zip">
<zipfileset filemode="755" dir="." prefix="ioke">
<include name="bin/*.bat"/>
<include name="bin/dokgen"/>
<include name="bin/ioke"/>
<include name="bin/ispec"/>
</zipfileset>
<zipfileset dir="." prefix="ioke">
<include name="lib/ioke*.jar"/>
<include name="lib/ioke/**"/>
<include name="dok/**"/>
<include name="share/**"/>
<include name="COPYING"/>
<include name="LICENSE"/>
<include name="LICENSE.kawa"/>
<include name="README"/>
</zipfileset>
</zip>
</target>
<target name="dist" depends="dist-bin"/>
<target name="ci-dist" depends="ci-dist-bin"/>
<target name="ci-clean-dist" description="clean things from releases">
<delete dir="${release.dir}"/>
</target>
<target name="clean" description="clean almost everything">
<delete dir="${build.dir}"/>
<delete file="${lib.dir}/ioke.jar" quiet="true"/>
<delete file="${lib.dir}/ioke-lib.jar" quiet="true"/>
</target>
</project>