blob: 3fe51986d6131e440a7189ffa5bd5e76ea59baf2 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
*************************************************************************
* Copyright (c) 2004, 2006 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Actuate Corporation - initial API and implementation
*
*************************************************************************
*
* buildAnt.xml
*
* Build script for project org.eclipse.datatools.connectivity.oda
*
* 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 "build.jars".
*
* Notes:
* 1. classpath need to be set for junit.jar
* 2. The build script requires Ant 1.6
*
-->
<project name="org.eclipse.datatools.connectivity.oda" default="build.jars" basedir=".">
<property file="build.properties"/>
<property name="module.name" value="org.eclipse.datatools.connectivity.oda"/>
<property file="META-INF/MANIFEST.MF" />
<property name="plugin.version" value="${Bundle-Version}" />
<property name="plugin.package" value="${module.name}_${plugin.version}" />
<property name="src.dir" value="${source..}"/>
<property name="test.src.dir" value="./test/"/>
<property name="bin.dir" value="${output..}"/>
<path id="class.path">
<pathelement path="${bin.dir}"/>
<!-- Dependencies on Eclipse installation -->
<fileset dir="${eclipse.home}/plugins">
<include name="org.eclipse.core.runtime_*.jar"/>
<include name="org.eclipse.osgi*.jar"/>
<include name="org.eclipse.equinox.*.jar"/>
<include name="com.ibm.icu_*.jar"/>
</fileset>
</path>
<target name="oda.jar" description="Create jar: oda.jar.">
<mkdir dir="${bin.dir}"/>
<!-- compile the source code -->
<javac srcdir="${src.dir}"
destdir="${bin.dir}"
debug="${javac.debug}"
includeAntRuntime="no"
source="${javac.source}"
target="${javac.target}"
encoding="utf-8">
<classpath refid="class.path"/>
</javac>
<!-- copy necessary resources -->
<copy todir="${bin.dir}/${package.oda.jar}" failonerror="true">
<fileset dir="${oda.src.dir}" includes="${jar.includes}" />
</copy>
<mkdir dir="${build.result.dir}"/>
<jar destfile="${build.result.dir}/oda.jar">
<fileset dir="${bin.dir}">
<exclude name="**/package.html"/>
<exclude name="**/*Test.class"/>
</fileset>
</jar>
</target>
<target name="odasrc.zip" unless="odasrc.zip">
<mkdir dir="${build.result.dir}"/>
<zip zipfile="${build.result.dir}/odasrc.zip" filesonly="false" whenempty="skip" update="false">
<fileset dir="${src.dir}" excludes="**/*.class"/>
</zip>
</target>
<target name="build.jars" description="Build all the jars for the plug-in.">
<available property="oda.jar" file="${build.result.dir}/oda.jar"/>
<antcall target="oda.jar"/>
</target>
<target name="build.source.zips" description="Create zip files containing the source for the plug-in.">
<available property="odasrc.zip" file="${build.result.dir}/odasrc.zip"/>
<antcall target="odasrc.zip"/>
</target>
<target name="clean" description="Clean the plug-in of all the zips, jars and logs created.">
<!-- Delete the target jar and zip files -->
<delete file="${build.result.dir}/oda.jar"/>
<delete file="${build.result.dir}/odasrc.zip"/>
<delete>
<fileset dir="${plugin.destination}" includes="${module.name}_*.zip"/>
</delete>
<!-- Delete the binary and unit tests directories -->
<delete dir="${bin.dir}"/>
<delete dir="${temp.dir}"/>
<antcall target="clean.download.dir"/>
<delete dir="${build.result.dir}/${javadoc.dir}"/>
</target>
<target name="clean.download.dir" unless="dtp.build">
<delete dir="${download.dir}"/>
</target>
<target name="create.download.dir" unless="dtp.build">
<mkdir dir="${download.dir}"/>
</target>
<target name="gather.bin.parts" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${plugin.package}"/>
<copy todir="${destination.temp.folder}/${plugin.package}" failonerror="true">
<fileset dir="${basedir}" includes="${bin.includes}"/>
</copy>
</target>
<target name="gather.src.parts" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${plugin.package}"/>
<copy todir="${destination.temp.folder}/${plugin.package}" failonerror="false" overwrite="false">
<fileset dir="${build.result.dir}" includes="odasrc.zip"/>
</copy>
</target>
<target name="zip.plugin" description="Create a zip containing the plug-in.">
<delete dir="${temp.dir}"/>
<mkdir dir="${temp.dir}"/>
<antcall target="build.jars"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.dir}/"/>
</antcall>
<delete>
<fileset dir="${temp.dir}" includes="**/*.bin.log"/>
</delete>
<zip zipfile="${plugin.destination}/${plugin.package}.zip"
basedir="${temp.dir}"
filesonly="true"
whenempty="skip"
update="false"/>
<delete dir="${temp.dir}"/>
</target>
<!--
<target name="nativeToAsciiUtil">
<native2ascii encoding="Cp1252"
src="${oda.src.dir}/util"
dest="${oda.src.dir}/util"
ext=".java"
includes="OdaResources_de_DE.msg, OdaResources_fr_FR.msg, OdaResources_es_ES.msg"/>
<native2ascii encoding="GBK"
src="${oda.src.dir}/util"
dest="${oda.src.dir}/util"
ext=".java"
includes="OdaResources_zh_CN.msg"/>
<native2ascii encoding="SJIS"
src="${oda.src.dir}/util"
dest="${oda.src.dir}/util"
ext=".java"
includes="OdaResources_ja_JP.msg"/>
<native2ascii encoding="MS949"
src="${oda.src.dir}/util"
dest="${oda.src.dir}/util"
ext=".java"
includes="OdaResources_ko_KR.msg"/>
</target>
<target name="nativeToAsciiConsumer">
<native2ascii encoding="Cp1252"
src="${oda.src.dir}/consumer/i18n"
dest="${oda.src.dir}/consumer/i18n"
ext=".properties"
includes="Messages_de_DE.msg, Messages_fr_FR.msg, Messages_es_ES.msg"/>
<native2ascii encoding="GBK"
src="${oda.src.dir}/consumer/i18n"
dest="${oda.src.dir}/consumer/i18n"
ext=".properties"
includes="Messages_zh_CN.msg"/>
<native2ascii encoding="SJIS"
src="${oda.src.dir}/consumer/i18n"
dest="${oda.src.dir}/consumer/i18n"
ext=".properties"
includes="Messages_ja_JP.msg"/>
<native2ascii encoding="MS949"
src="${oda.src.dir}/consumer/i18n"
dest="${oda.src.dir}/consumer/i18n"
ext=".properties"
includes="Messages_ko_KR.msg"/>
</target>
-->
<!-- Compile ODA Test Files
javac.failonerror should be true.
-->
<target name="compileTest">
<mkdir dir="${bin.dir}"/>
<javac srcdir="${test.src.dir}"
destdir="${bin.dir}"
encoding="utf-8"
source="1.4"
failonerror="true"
debug="true">
<classpath refid="class.path"/>
<classpath>
<fileset dir=".">
<include name="oda.jar"/>
</fileset>
</classpath>
</javac>
</target>
<!-- Generate the JavaDoc.
Parameters:
- ${javadoc.dir} target directory to put the java document
-->
<target name="javadoc" description="Create Javadoc API documentation for this plugin.">
<delete dir="${build.result.dir}/${javadoc.dir}"/>
<mkdir dir="${build.result.dir}/${javadoc.dir}"/>
<javadoc destdir="${build.result.dir}/${javadoc.dir}"
author="true"
version="true"
use="true"
windowtitle="DTP Open Data Access 3.0 API Specification"
doctitle="DTP Open Data Access (ODA) API (Provisional)"
source="1.4"
access="public"
packagenames="org.eclipse.datatools.connectivity.oda.*">
<packageset dir="${src.dir}"
defaultexcludes="yes" />
<classpath refid="class.path" />
<bottom><![CDATA[<i>Copyright &#169; 2006 Actuate Corporation. All rights reserved. </i>]]></bottom>
</javadoc>
</target>
<target name="gather.doc.parts" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${plugin.package}"/>
<copy todir="${destination.temp.folder}/${plugin.package}" failonerror="true">
<fileset dir="${build.result.dir}" includes="${javadoc.dir}/**"/>
</copy>
</target>
<target name="download.plugin" description="Create a download folder that contains all the files to include in DTP download build.">
<antcall target="clean"/>
<antcall target="create.download.dir"/>
<antcall target="build.jars"/>
<antcall target="jar.plugin"/>
</target>
<target name="jar.plugin" >
<property file="META-INF/MANIFEST.MF" />
<property name="jar.name" value="${plugin.package}.jar" />
<jar destfile="${download.dir}/${jar.name}" manifest="./META-INF/MANIFEST.MF">
<fileset dir="${bin.dir}">
<include name="**/*.class"/>
<include name="**/*.txt"/>
<include name="**/*.xml"/>
<include name="**/*.def"/>
<include name="**/*.properties"/>
<exclude name="**/*Test.class"/>
</fileset>
<fileset dir="." includes="${bin.includes}"/>
</jar>
</target>
</project>