BuildChartTests.xml from BIRT at Krugle
Show BuildChartTests.xml syntax highlighted
<?xml version="1.0"?>
<!--
*************************************************************************
* Copyright (c) 2004, 2005 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
*
*************************************************************************
*
* Build.xml
*
* Created on 03/21/2006
* Build script for project org.eclipse.birt.chart.tests
*
*
* The following are public targets callable by external users.
*
* "Clean" - Clean all objects created by this script. Individual project build script can not call this target;
* "Jar" - Compile source code and generate jar for this project.
* The compile dependency on other projects should be defined explicitly.
* eclipse.home should be passed in when Individual project build script call this target;
* the property of "failonerror" should be set true(default) when compiling source code
* "UnitTest" - Run unit tests. This task must be called after calling Jar task,
* so it needn't depend on Jar explicitly
* "Export" - Export the project, for instance, jar files are copied to a designated folder.
* this task must be called after calling Jar task, so it needn't depend on Jar explicitly
* "JavaDoc" - generate java documents
*
* Usage:
* ant [any one or more of the public targets]
* -Declipse.home=<your eclipse home>
*
* Default target is "Jar".
*
* "utest" - Run unit tests
*
* This script may also additional targets. These targets are private to this build script only.
*
*
*
* Notes:
* 1. classpath need to be set for junit.jar
* 2. This file now requires Ant 1.6
*
* Change History:
*
* 1. 03/21/2006: initial version
*
-->
<project name="BIRT Chart Tests Project" default="build" basedir=".">
<description>BIRT Chart Tests Project.</description>
<!-- set global properties for this build -->
<!-- Public properties, used by public targets, top level build script
will pass on the value at runtime.
-->
<property name="eclipse.home" location="." />
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="bin" location="bin"/>
<property name="module.name" value="org.eclipse.birt.chart.tests"/>
<property name="core.dir" location="../org.eclipse.birt.core"/>
<property name="chart.device.extension.dir" location="../org.eclipse.birt.chart.device.extension"/>
<property name="chart.device.svg.dir" location="../org.eclipse.birt.chart.device.svg"/>
<property name="chart.device.pdf.dir" location="../org.eclipse.birt.chart.device.pdf"/>
<property name="chart.engine.dir" location="../org.eclipse.birt.chart.engine"/>
<property name="chart.engine.extension.dir" location="../org.eclipse.birt.chart.engine.extension"/>
<!-- set platform related properties-->
<condition property="basews" value="win32">
<os family="windows"/>
</condition>
<condition property="basews" value="gtk">
<not>
<os family="windows"/>
</not>
</condition>
<!-- set eclipse related properties -->
<property name="eclipse.runtime.dir" value="org.eclipse.core.runtime" />
<property name="eclipse.osgi.dir" value="org.eclipse.osgi" />
<property name="emf.common.dir" value="org.eclipse.emf.common" />
<property name="emf.ecore.dir" value="org.eclipse.emf.ecore" />
<path id="class.path">
<pathelement path="${bin}"/>
<fileset dir="${eclipse.home}/plugins">
<include name="${eclipse.runtime.dir}_*/runtime.jar"/>
<include name="org.eclipse.core.*.jar"/>
<include name="${eclipse.osgi.dir}_*/osgi.jar"/>
<include name="org.eclipse.osgi*.jar"/>
<include name="${emf.common.dir}_*/runtime/common.jar"/>
<include name="${emf.ecore.dir}_*/runtime/ecore.jar"/>
<include name="${emf.common.dir}_*.jar"/>
<include name="${emf.ecore.dir}_*.jar"/>
<include name="org.eclipse.equinox.*.jar"/>
<include name="com.ibm.icu_*.jar"/>
<include name="org.junit_*/junit.jar"/>
</fileset>
<fileset dir="${core.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${chart.engine.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${chart.engine.extension.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${chart.device.extension.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${chart.device.svg.dir}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${chart.device.pdf.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- Compile source code and generate jar for this project.
Input parameters:
eclipse.home
-->
<target name="Jar" depends="UnitTest" description="create project jar">
<jar destfile="tests.jar">
<fileset dir="${bin}">
<include name="**/*.*"/>
</fileset>
</jar>
</target>
<!-- Export the project, for instance, jar files are copied to a designated folder
the dependency on Jar should implement in top level script by call sequence
Parameters:
- ${export.dir} target directory to put the plugin binaries
- ${plugin.version} the version of plugin exported
-->
<target name="Export">
<property file="META-INF/MANIFEST.MF" />
<copy todir="${export.dir}/${module.name}_${Bundle-Version}">
<fileset dir="." includes="tests.jar,about.html,plugin.xml,plugin*.properties,.options,lib/**,META-INF/MANIFEST.MF"/>
</copy>
</target>
<!-- public task UnitTest will not explicitly depend on complie, Top level script should call compile before calling UnitTest -->
<!-- Run Unit test.
Parameters:
- ${utest.report.dir} target directory to put the unit test report
-->
<target name="UnitTest" depends="compileTest" description="run all the unit tests" >
<junit printsummary="on"
fork="true"
dir="."
haltonfailure="false"
failureproperty="test.failed"
showoutput="true">
<jvmarg value="-DBIRT_HOME=${eclipse.home}" />
<jvmarg value="-ea"/>
<classpath refid="class.path" />
<formatter type="xml" usefile="true" />
<batchtest todir="${src}">
<fileset dir="${src}">
<include name="AllTests.java" />
<exclude name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<!-- Compile Test code -->
<target name="compileTest" depends="buildDependency" description="Compile Chart Test Files">
<mkdir dir="${bin}" />
<copy todir="${bin}">
<fileset dir="${src}">
<include name="**/input/*.*" />
<include name="**/golden/*.*" />
<include name="**/*.properties" />
</fileset>
</copy>
<javac srcdir="${src}"
destdir="${bin}"
source="1.4"
target="1.4"
debug="true"
encoding="utf-8"
failonerror="true">
<classpath refid="class.path" />
</javac>
</target>
<!-- Clean all objects created by this script -->
<target name="Clean" description="clean up">
<!-- Delete the binary directory trees -->
<delete dir="${bin}"/>
<delete file="tests.jar"/>
</target>
<!-- Build the dependent projects -->
<target name="buildDependency">
<echo message="start call Jar task in ${core.dir}" />
<ant dir="${core.dir}" antfile="BuildCore.xml" target="Jar" inheritall="false">
<property name="eclipse.home" value="${eclipse.home}" />
</ant>
<echo message="end call Jar task in ${core.dir}" />
<echo message="start call Jar task in ${chart.engine.dir}" />
<ant dir="${chart.engine.dir}" antfile="BuildChartEngine.xml" target="Jar" inheritAll="false">
<property name="eclipse.home" value="${eclipse.home}" />
<property name="eclipse.version" value="${eclipse.version}" />
</ant>
<echo message="end call Jar task in ${chart.engine.dir}" />
<echo message="start call Jar task in ${chart.engine.extension.dir}" />
<ant dir="${chart.engine.extension.dir}" antfile="BuildChartEngineExtension.xml" target="Jar" inheritAll="false">
<property name="eclipse.home" value="${eclipse.home}" />
<property name="eclipse.version" value="${eclipse.version}" />
</ant>
<echo message="end call Jar task in ${chart.engine.extensioin.dir}" />
<echo message="start call Jar task in ${chart.device.extension.dir}" />
<ant dir="${chart.device.extension.dir}" antfile="BuildChartDeviceExtension.xml" target="Jar" inheritAll="false">
<property name="eclipse.home" value="${eclipse.home}" />
<property name="eclipse.version" value="${eclipse.version}" />
</ant>
<echo message="end call Jar task in ${chart.device.extension.dir}" />
<echo message="start call Jar task in ${chart.device.svg.dir}" />
<ant dir="${chart.device.svg.dir}" antfile="BuildChartDeviceSVG.xml" target="Jar" inheritAll="false">
<property name="eclipse.home" value="${eclipse.home}" />
<property name="eclipse.version" value="${eclipse.version}" />
</ant>
<echo message="end call Jar task in ${chart.device.svg.dir}" />
<echo message="start call Jar task in ${chart.device.pdf.dir}" />
<ant dir="${chart.device.pdf.dir}" antfile="BuildChartDevicePDF.xml" target="Jar" inheritAll="false">
<property name="eclipse.home" value="${eclipse.home}" />
<property name="eclipse.version" value="${eclipse.version}" />
</ant>
<echo message="end call Jar task in ${chart.device.pdf.dir}" />
</target>
<target name="build" depends="Jar" description="package tests files" />
</project>
See more files for this project here