BuildOdaJdbc.xml from BIRT at Krugle
Show BuildOdaJdbc.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/15/2005
* Build script for project org.eclipse.birt.report.data.oda.jdbc
*
*
* 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>
* -Ddtp.home=<your DTP plugins source home> [optional]
*
* Default target is "Jar".
*
*
* 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/15/2005: initial version
*
-->
<project name="ODA-JDBC Bridge" default="Jar" basedir=".">
<description>BIRT ODA-JDBC Bridge Driver</description>
<!-- set global properties for this build -->
<!-- Public properties, used by public targets, top level build script
will pass on the value at runtime. Properties will have there default
value.
eclipse.home
utest.report.dir
javadoc.dir
plugin.version
-->
<!-- ===== Default value for public properties ============= -->
<property name="utest.report.dir" location="utestreports" />
<property name="javadoc.dir" location="docs/api" />
<property name="export.dir" location="export" />
<property name="eclipse.home" location="." />
<property name="dtp.home" location=".." />
<property name="dir.utest" value="utest" />
<property name="dir.src" value="src" />
<property name="dir.test" value="test" />
<property name="dir.bin" value="bin" />
<property name="dir.lib" value="lib" />
<property name="dir.drivers" value="drivers" />
<property name="module.name" value="org.eclipse.birt.report.data.oda.jdbc"/>
<property name="dtp.oda.dir" location="${dtp.home}/org.eclipse.datatools.connectivity.oda" />
<property name="user" value="Actuate" />
<property name="password" value="Actuate" />
<property name="host" value="localhost" />
<property name="database" value="DTETest" />
<path id="class.path">
<pathelement path="${dir.bin}" />
<pathelement path="../org.apache.derby.core/derby.jar" />
<!-- <fileset dir="${core.dir}">
<include name="core.jar"/>
<include name="lib/*.jar"/>
</fileset>
<fileset dir="${dtp.oda.dir}">
<include name="oda.jar"/>
</fileset>
--> <fileset dir=".">
<include name="*.jar"/>
</fileset>
<!-- dependend on eclipse due to Plugin class -->
<fileset dir="${eclipse.home}/plugins">
<include name="org.eclipse.core.runtime_*/runtime.jar"/>
<include name="org.eclipse.osgi_*/*.jar"/>
<include name="org.eclipse.core.runtime*.jar"/>
<include name="org.eclipse.osgi*.jar"/>
<include name="org.junit_*/*.jar"/>
<include name="com.ibm.icu*.jar"/>
<include name="org.eclipse.equinox.registry_*.jar"/>
<include name="org.eclipse.equinox.common_*.jar"/>
<include name="org.eclipse.datatools.connectivity*.jar"/>
<include name="org.eclipse.datatools.connectivity*/*.jar"/>
</fileset>
</path>
<!-- Compile source code and generate jar for this project.
Input parameters:
eclipse.home
dtp.home
-->
<target name="Jar" depends="compileSource">
<jar destfile="oda-jdbc.jar">
<fileset dir="${dir.bin}">
<include name="**/*.class" />
<include name="**/*.txt" />
<include name="**/*.xml" />
<include name="**/*.def" />
<include name="**/*.properties" />
<exclude name="**/*Test.class" />
</fileset>
<!-- <zipfileset src="${dtp.oda.dir}/oda.jar" excludes="**/*.MF"/>
--> </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" />
<xmlproperty file="plugin.xml" collapseAttributes="true"/>
<copy todir="${export.dir}/${module.name}_${Bundle-Version}">
<fileset dir="." includes="*.jar,plugin.xml,about.html, .options, ${dir.drivers}/**, schema/**, about_files/**, plugin*.properties, META-INF/**"/>
</copy>
</target>
<!-- Run Unit Test -->
<target name="UnitTest" depends="compileTest" description="run all the unit tests">
<ant dir="../org.eclipse.birt.core" antfile="BuildCore.xml" target="UnitTest" inheritAll="false" inheritRefs="false">
<property name="dir.utest" value="utest" />
<property name="utest.report.dir" value="${utest.report.dir}" />
<property name="module.name" value="${module.name}" />
<property name="classname" value="org.eclipse.birt.report.data.oda.jdbc.AllTests" />
</ant>
</target>
<!-- Clean all objects created by this script -->
<target name="Clean" description="clean up">
<!-- Delete the ${dir.bin} and ${dir.utest} directory trees -->
<delete dir="${dir.bin}" />
<delete dir="${dir.utest}" />
<delete>
<fileset dir="." includes="*junit*" />
</delete>
<!-- Delete the target jar file -->
<delete file="oda-jdbc.jar" />
</target>
<!-- Generate the JavaDoc.
Parameters:
- ${javadoc.dir} target directory to put the java document
-->
<target name="Javadoc">
<mkdir dir="${javadoc.dir}" />
<javadoc destdir="${javadoc.dir}"
author="true"
version="true"
use="true"
windowtitle="Birt oda-jdbc API"
source="1.4"
packagenames="${module.name}.*">
<packageset dir="${dir.src}" defaultexcludes="yes" />
<bottom><![CDATA[<i>Copyright © 2005 Actuate Corp. All rights reserved. </i>]]></bottom>
<classpath refid="class.path" />
</javadoc>
</target>
<!-- Generate the ApiJavaDoc.
-->
<target name="apiJavaDoc" />
<target name="buildDependency">
<echo message="start call Jar task in ${dtp.oda.dir}"/>
<!-- <ant dir="${dtp.oda.dir}" antfile="build.xml" target="build.jars" inheritAll="false">
<property name="eclipse.home" value="${eclipse.home}" />
</ant>
<echo message="end call Jar task in ${dtp.oda.dir}"/>
--> </target>
<target name="compileSource" depends="buildDependency" description="compile the source ">
<mkdir dir="${dir.bin}" />
<copy todir="${dir.bin}">
<fileset dir="${dir.src}">
<include name="**/*.properties"/>
</fileset>
</copy>
<!-- Compile the java code from ${dir.src} into ${dir.bin} -->
<javac srcdir="${dir.src}"
destdir="${dir.bin}"
encoding="utf-8"
source="1.4"
debug="true">
<classpath refid="class.path" />
<exclude name="util/**/*" />
</javac>
</target>
<!-- Compile Oda Test Files
javac.failonerror should be true.
-->
<target name="compileTest" depends="compileSource" description="compile the test ">
<mkdir dir="${dir.bin}" />
<!-- Compile the java code from ${dir.test} into ${dir.bin} -->
<javac srcdir="${dir.test}"
destdir="${dir.bin}"
encoding="utf-8"
source="1.4"
debug="true"
failonerror="true" >
<classpath refid="class.path"/>
</javac>
</target>
</project>
See more files for this project here