Source

kink / build.xml

Full commit
<?xml version="1.0" encoding="UTF-8"?>

<project name="kink"
  default="classes"
  basedir="."
  xmlns:ivy="antlib:org.apache.ivy.ant">

  <description>
    Kink is the original implementation of an interpreter of the Kink language.
  </description>


  <!-- PROPERTIES -->

  <property environment="env" />
  <property file="${basedir}/build.properties" />
  <antversion property="antversion" />
  <property name="jdk.version" value="1.8" />
  <property name="src.dir" location="${basedir}/src" />
  <property name="extern.dir" location="${basedir}/extern" />
  <property name="dest.dir" location="${basedir}/dest" />
  <property name="doc.dir" location="${basedir}/doc" />
  <property name="bin.dir" location="${basedir}/bin" />
  <property name="lib.dir" location="${basedir}/lib" />
  <property name="basename" value="kink" />

  <condition property="bin.file" value="${bin.dir}/kink.exe" else="${bin.dir}/kink">
    <os family="dos" />
  </condition>

  <condition property="test.junit.skip" value="true">
    <isset property="test.skip" />
  </condition>

  <condition property="test.bin.skip" value="true">
    <isset property="test.skip" />
  </condition>

  <!-- TARGETS -->

  <target name="tags" description="Ctags file">
    <exec executable="ctags" failonerror="true">
      <arg value="-R" />
      <arg value="src/main/java" />
      <arg value="src/test/java/org/kink_lang/common/test" />
    </exec>
  </target>

  <target name="clean" description="Delete generated or temporaryfiles">
    <delete includeemptydirs="true">
      <fileset dir="${basedir}">
        <include name="**/*.bak" />
        <include name="**/*.orig" />
        <include name="**/*.mo" />
      </fileset>
    </delete>
    <delete dir="${dest.dir}" />
    <delete dir="${doc.dir}" />
  </target>

  <target name="all" depends="jar , bin , doc"
    description="Make all artifacts" />

  <target name="ci"
    depends="clean,all,-classloader_leak_test,-coverage_main,-pmd_xml,-findbugs_xml"
    description="Build files for CI">
    <touch>
      <fileset dir="${dest.dir}/classes/test_xml">
        <include name="TEST-*.xml" />
      </fileset>
    </touch>
  </target>

  <target name="precommit"
    description="Prepares to commit the project"
    depends="clean , all">
  </target>

  <target name="dist" depends="bin , doc" description="Makes distribution files">
    <exec executable="${src.dir}/build/make-dist.sh" failonerror="true">
      <arg value="${basename}" />
    </exec>
  </target>

  <!-- MACROS -->

  <macrodef name="run-junit">
    <attribute name="printsummary"/>
    <attribute name="haltonfailure"/>
    <attribute name="failureproperty" default="none"/>
    <attribute name="testbase"/>
    <element name="innerelements" implicit="true" optional="true" />
    <sequential>
      <mkdir dir="@{testbase}/junittemp" />
      <mkdir dir="@{testbase}/kinktemp" />
      <junit
        printsummary="@{printsummary}"
        haltonfailure="@{haltonfailure}"
        failureproperty="@{failureproperty}"
        dir="${basedir}"
        tempdir="@{testbase}/junittemp"
        showoutput="true"
        fork="true"
        forkmode="once">
        <assertions> <enable /> </assertions>
        <jvmarg value="-XX:MaxMetaspaceSize=48m"/>
        <sysproperty key="file.encoding" value="US-ASCII" />
        <sysproperty key="org.kink_lang.kink.testdirs"
          value="${src.dir}/main/kink,${src.dir}/test/kink" />
        <sysproperty key="org.kink_lang.kink.errorlog"
          value="@{testbase}/test_error.log" />
        <sysproperty key="org.kink_lang.kink.tempdir"
          value="@{testbase}/kinktemp" />
        <sysproperty key="org.kink_lang.kink.binfile"
          value="${bin.file}" />
        <innerelements />
      </junit>
    </sequential>
  </macrodef>

  <!-- IMPORTS -->

  <import file="${src.dir}/build/build_ivy.xml" />
  <import file="${src.dir}/build/build_classes.xml" />
  <import file="${src.dir}/build/build_jar.xml" />
  <import file="${src.dir}/build/build_bin.xml" />
  <import file="${src.dir}/build/build_doc.xml" />
  <import file="${src.dir}/build/build_checkstyle.xml" />
  <import file="${src.dir}/build/build_pmd.xml" />
  <import file="${src.dir}/build/build_findbugs.xml" />
  <import file="${src.dir}/build/build_coverage.xml" />

</project>

<!-- vim: set et sw=2 sts=2 : -->