2010-06-14 23:22:04 +02:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
<!--+
|
|
|
|
|
|
2012-10-19 01:40:31 +02:00
|
|
|
| OpenRefine Extension Jython Build File
|
2010-06-14 23:22:04 +02:00
|
|
|
|
|
|
|
|
+-->
|
2018-01-03 18:37:16 +01:00
|
|
|
|
|
|
|
<project name="refine-jython" default="build" basedir="." xmlns:jacoco="antlib:org.jacoco.ant">
|
2010-06-14 23:22:04 +02:00
|
|
|
|
|
|
|
<property environment="env"/>
|
|
|
|
|
|
|
|
<condition property="version" value="trunk">
|
|
|
|
<not><isset property="version"/></not>
|
|
|
|
</condition>
|
|
|
|
|
|
|
|
<condition property="revision" value="rXXXX">
|
|
|
|
<not><isset property="revision"/></not>
|
|
|
|
</condition>
|
|
|
|
|
|
|
|
<condition property="full_version" value="0.0.0.0">
|
|
|
|
<not><isset property="full_version"/></not>
|
|
|
|
</condition>
|
|
|
|
|
|
|
|
<condition property="dist.dir" value="dist">
|
|
|
|
<not><isset property="dist.dir"/></not>
|
|
|
|
</condition>
|
|
|
|
|
2010-06-20 22:27:04 +02:00
|
|
|
<property name="fullname" value="${name}-${version}-${revision}" />
|
2018-01-03 18:37:16 +01:00
|
|
|
<property name="java_version" value="1.8"/>
|
2010-06-14 23:22:04 +02:00
|
|
|
|
2010-09-22 20:36:33 +02:00
|
|
|
<property name="refine.dir" value="${basedir}/../../main" />
|
|
|
|
<property name="refine.webinf.dir" value="${refine.dir}/webapp/WEB-INF" />
|
|
|
|
<property name="refine.modinf.dir" value="${refine.dir}/webapp/modules/core/MOD-INF" />
|
|
|
|
<property name="refine.classes.dir" value="${refine.webinf.dir}/classes" />
|
|
|
|
<property name="refine.lib.dir" value="${refine.webinf.dir}/lib" />
|
2018-01-03 18:37:16 +01:00
|
|
|
<property name="refine.tests.lib.dir" value="${refine.dir}/tests/server/lib" />
|
2010-06-14 23:22:04 +02:00
|
|
|
|
|
|
|
<property name="src.dir" value="${basedir}/src" />
|
|
|
|
<property name="module.dir" value="${basedir}/module" />
|
|
|
|
<property name="modinf.dir" value="${module.dir}/MOD-INF" />
|
|
|
|
<property name="lib.dir" value="${modinf.dir}/lib" />
|
|
|
|
<property name="classes.dir" value="${modinf.dir}/classes" />
|
|
|
|
|
2018-01-03 18:37:16 +01:00
|
|
|
<property name="extension.tests.dir" value="${basedir}/tests" />
|
|
|
|
<property name="tests.build.dir" value="${extension.tests.dir}/build" />
|
|
|
|
<property name="tests.src.dir" value="${extension.tests.dir}/src" />
|
|
|
|
<property name="tests.classes.dir" value="${extension.tests.dir}/classes" />
|
|
|
|
<property name="tests.report.dir" value="${extension.tests.dir}/report"/>
|
|
|
|
<property name="tests.report.html.dir" value="${tests.report.dir}/html"/>
|
|
|
|
<property name="tests.report.xml.path" value="${tests.report.dir}/jacoco.xml"/>
|
|
|
|
|
2010-06-14 23:22:04 +02:00
|
|
|
<path id="class.path">
|
|
|
|
<fileset dir="${lib.dir}">
|
|
|
|
<include name="**/*.jar" />
|
|
|
|
</fileset>
|
2010-09-22 20:36:33 +02:00
|
|
|
<fileset dir="${refine.lib.dir}">
|
2010-06-14 23:22:04 +02:00
|
|
|
<include name="**/*.jar" />
|
|
|
|
</fileset>
|
2010-09-22 20:36:33 +02:00
|
|
|
<pathelement path="${refine.classes.dir}"/>
|
2018-01-03 18:37:16 +01:00
|
|
|
<pathelement path="${classes.dir}" />
|
2010-06-14 23:22:04 +02:00
|
|
|
</path>
|
2018-01-03 18:37:16 +01:00
|
|
|
|
|
|
|
<path id="extension.tests.class.path">
|
|
|
|
<path refid="class.path"/>
|
|
|
|
<pathelement location="${tests.classes.dir}"/>
|
|
|
|
<pathelement location="${refine.tests.lib.dir}/testng-6.8.jar"/>
|
|
|
|
<fileset dir="${refine.tests.lib.dir}">
|
|
|
|
<include name="**/*.jar" />
|
|
|
|
</fileset>
|
|
|
|
</path>
|
|
|
|
|
|
|
|
|
|
|
|
<taskdef resource="testngtasks" classpath="${refine.tests.lib.dir}/testng-6.8.jar"/>
|
|
|
|
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
|
|
|
|
<classpath path="${refine.tests.lib.dir}/jacocoant.jar"/>
|
|
|
|
</taskdef>
|
2010-06-14 23:22:04 +02:00
|
|
|
|
|
|
|
<target name="build_java">
|
|
|
|
<mkdir dir="${classes.dir}" />
|
2013-07-10 21:45:25 +02:00
|
|
|
<javac source="${java_version}" target="${java_version}" encoding="utf-8" destdir="${classes.dir}" debug="true" includeAntRuntime="no">
|
2010-06-14 23:22:04 +02:00
|
|
|
<src path="${src.dir}"/>
|
|
|
|
<classpath refid="class.path" />
|
|
|
|
</javac>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build" depends="build_java"/>
|
|
|
|
|
2018-01-03 18:37:16 +01:00
|
|
|
<target name="build_tests" depends="build">
|
|
|
|
<mkdir dir="${tests.classes.dir}" />
|
|
|
|
<javac source="${java_version}" target="${java_version}" encoding="utf-8" srcdir="${tests.src.dir}" destdir="${tests.classes.dir}" debug="true" includeAntRuntime="no">
|
|
|
|
<classpath refid="extension.tests.class.path" />
|
|
|
|
</javac>
|
|
|
|
<copy file="${tests.src.dir}/tests.log4j.properties" tofile="${tests.classes.dir}/tests.log4j.properties"/>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<mkdir dir="${tests.build.dir}" />
|
|
|
|
<target name="test" depends="build_tests">
|
|
|
|
<jacoco:coverage destfile="${tests.report.dir}/jacoco.exec">
|
|
|
|
<testng verbose="2" haltOnFailure="true" workingdir="${tests.build.dir}"
|
|
|
|
listener="org.testng.reporters.DotTestListener" excludedgroups="broken"
|
|
|
|
classpathref="extension.tests.class.path">
|
|
|
|
<xmlfileset file="${extension.tests.dir}/conf/tests.xml"/>
|
|
|
|
</testng>
|
|
|
|
</jacoco:coverage>
|
|
|
|
<jacoco:report>
|
|
|
|
<executiondata>
|
|
|
|
<file file="${tests.report.dir}/jacoco.exec"/>
|
|
|
|
</executiondata>
|
|
|
|
|
|
|
|
<structure name="Jython extension">
|
|
|
|
<classfiles>
|
|
|
|
<fileset dir="${classes.dir}"/>
|
|
|
|
</classfiles>
|
|
|
|
<sourcefiles encoding="UTF-8">
|
|
|
|
<fileset dir="${src.dir}"/>
|
|
|
|
</sourcefiles>
|
|
|
|
</structure>
|
|
|
|
<html destdir="${tests.report.html.dir}"/>
|
|
|
|
<xml destfile="${tests.report.xml.path}"/>
|
|
|
|
</jacoco:report>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
2010-06-14 23:22:04 +02:00
|
|
|
<target name="clean">
|
|
|
|
<delete dir="${classes.dir}" />
|
2018-01-03 18:37:16 +01:00
|
|
|
<delete dir="${tests.classes.dir}" />
|
|
|
|
<delete dir="${tests.report.dir}" />
|
|
|
|
<delete dir="${tests.build.dir}" />
|
2010-06-14 23:22:04 +02:00
|
|
|
</target>
|
|
|
|
</project>
|