| <?xml version="1.0"?> |
| <!--/******************************************************************************* |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 |
| * which accompanies this distribution. |
| * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| * and the Eclipse Distribution License is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * Ant naming conventions: |
| * - regardless of the actual OS platform,'/' is the directory separator |
| * (Ant will convert as appropriate). |
| * - multi-word properties use periods '.' |
| * - properties ending in .jar define jarfile names only (no path) |
| * - properties ending in .lib are fully qualified jars (path and filename) |
| * - properties ending in .dir are directory paths |
| * - properties ending in .path are path refid names (classpath fragments) |
| * - multi-word targets use hyphens '-' |
| * - targets beginning with test- are reserved for high level test targets, |
| * and are used in test results parsing |
| * - targets typically use the form <action>-<object>-<type> (ie. package-bundle-zip) |
| * - multi-word macros use underscores '_' |
| * - multi-word macro attributes are concatenated |
| * e.g. 'runpathref' |
| * - multi-word tasks (taskdef) names are concatenated |
| * e.g. 'validateconnection' |
| * - OS environment variables are in ALLCAPS and have 'env' as a prefix |
| * e.g. ${env.XXX}. |
| * - Ant properties are lower case. |
| * |
| * Contributors: |
| * bdoughan - initial API and implementation |
| * egwin - update to adopt calling standards |
| * egwin - strip BND and compile code. File only needed for dev packaging now |
| #******************************************************************************/--> |
| <project name="org.eclipse.persistence.sdo" default="jar" basedir="."> |
| <available file="../${ant.project.name}" type="dir" property="sdo.is.local"/> |
| <!-- Test to make sure that the calling script doesn't inherit the variable --> |
| <!-- (should be set locally, and be destroyed upon return) --> |
| <fail message="Not running from '${ant.project.name}' directory" unless="sdo.is.local"/> |
| |
| <dirname property="sdo.build.location_temp" file="${ant.file.org.eclipse.persistence.core}"/> |
| <pathconvert targetos="unix" property="sdo.build.location"> |
| <path> |
| <pathelement location="${sdo.build.location_temp}"/> |
| </path> |
| </pathconvert> |
| <condition property="sdo.2.base.dir" value="../.." else=".."> |
| <contains string="${sdo.build.location}" substring="sdo/${ant.project.name}"/> |
| </condition> |
| <echo message="sdo.2.base.dir = '${sdo.2.base.dir}'"/> |
| <property name="sdo.2.common.plugins.dir" value="${sdo.2.base.dir}/plugins"/> |
| |
| <!-- local property overrides --> |
| <condition property="custom.properties.message" value="Loading ${user.home}/build.properties..." |
| else="Custom properties file '${user.home}/build.properties' not found to load."> |
| <available file="${user.home}/build.properties"/> |
| </condition> |
| <echo message="${custom.properties.message}"/> |
| <property file="${user.home}/build.properties"/> |
| <property file="${sdo.build.location}/antbuild.properties"/> |
| |
| |
| <!-- Primary Targets: "jar" separate for dev use --> |
| <target name="jar" depends="package" description="package ${ant.project.name} component"/> |
| |
| <!-- initialize varables and paths needed for compile --> |
| <!-- the number of properties needed now is too great for lazy loading without a target --> |
| <target name="init"> |
| <property name="sdo.manifest.file" value="${sdo.build.location}/META-INF/MANIFEST.MF"/> |
| |
| <!-- versioning --> |
| <!-- These variables are set in autobuild.xml. A manual build gets defaults --> |
| <tstamp> |
| <format property="build.date" pattern="yyyyMMdd"/> |
| <format property="build.time" pattern="HHmm"/> |
| </tstamp> |
| <property name="build.type" value="SNAPSHOT"/> |
| <property name="svn.revision" value="NA"/> |
| <property name="version.qualifier" value="qualifier"/> |
| <property name="version.string" value="${release.version}.${version.qualifier}"/> |
| <property name="release.designation" value="EclipseLink ${release.version} Build"/> |
| <property name="specification.vendor" value="Eclipse.org - EclipseLink Project"/> |
| <property name="implementation.vendor" value="${specification.vendor}"/> |
| |
| <condition property="compiled_classes.dir" value="${classes.dir}" else="target/classes"> |
| <available file="${classes.dir}" type="dir"/> |
| </condition> |
| |
| <available file="${compiled_classes.dir}" type="dir" property="classes.exist"/> |
| </target> |
| |
| <!-- package --> |
| <target name="package-src" depends="init" description="jar OSGI src bundle"> |
| <delete file="${sdo.2.common.plugins.dir}/${ant.project.name}.source_${version.string}.jar"/> |
| <jar jarfile="${sdo.2.common.plugins.dir}/${ant.project.name}.source_${version.string}.jar" duplicate="preserve"> |
| <manifest> |
| <attribute name="Specification-Vendor" value="${specification.vendor}"/> |
| <attribute name="Specification-Version" value="${release.version}"/> |
| <attribute name="Implementation-Vendor" value="${implementation.vendor}"/> |
| <attribute name="Implementation-Version" value="${version.string}"/> |
| <attribute name="Bundle-ManifestVersion" value="2"/> |
| <attribute name="Bundle-Name" value="EclipseLink SDO Source"/> |
| <attribute name="Bundle-SymbolicName" value="${ant.project.name}.source"/> |
| <attribute name="Bundle-Vendor" value="${implementation.vendor}"/> |
| <attribute name="Bundle-Version" value="${version.string}"/> |
| <attribute name="Eclipse-SourceBundle" value="${ant.project.name};version="${version.string}""/> |
| </manifest> |
| <fileset dir="${sdo.2.base.dir}"> |
| <include name="about.html"/> |
| <include name="readme.html"/> |
| <include name="license.*"/> |
| </fileset> |
| <fileset dir="${src.dir}"> |
| <include name="org/eclipse/persistence/**/*.java"/> |
| <include name="commonj/sdo/impl/HelperProviderImpl.java"/> |
| </fileset> |
| </jar> |
| </target> |
| |
| <target name="package" depends="init, package-src" description="jar OSGI bundle"> |
| <delete file="${sdo.2.common.plugins.dir}/${ant.project.name}_${version.string}.jar"/> |
| <jar jarfile="${sdo.2.common.plugins.dir}/${ant.project.name}_${version.string}.jar" duplicate="preserve" manifest="${sdo.manifest.file}"> |
| <fileset dir="${sdo.2.base.dir}"> |
| <include name="about.html"/> |
| <include name="readme.html"/> |
| <include name="license.*"/> |
| </fileset> |
| <fileset dir="${compiled_classes.dir}"> |
| <include name="org/eclipse/persistence/**/*.class"/> |
| <include name="commonj/sdo/impl/HelperProviderImpl.class"/> |
| </fileset> |
| </jar> |
| </target> |
| |
| <target name="build_sdo_lib_jar" depends="compile-sdo-lib, package-sdo-lib-jar" description="Build SDO API lib"/> |
| <!-- compile --> |
| <target name="compile-sdo-lib" description="Compile SDO API lib"> |
| <mkdir dir="../plugins/${commonj.sdo.dir}/${classes.dir}"/> |
| <javac srcdir="../plugins/${commonj.sdo.dir}/commonj" |
| destdir="../plugins/${commonj.sdo.dir}/${classes.dir}" |
| includes="**/*.java" |
| debug="${javac.debug}" |
| debuglevel="${javac.debuglevel}" |
| optimize="${javac.optimize}" |
| source="${javac.version}" |
| target="${javac.version}" |
| deprecation="${javac.deprecation}" |
| failonerror="true" |
| memoryMaximumSize="512m" |
| fork="true" |
| /> |
| </target> |
| <!-- Packages the SDO API jar--> |
| <target name="package-sdo-lib-jar" description="Package SDO API lib jar"> |
| <delete file="../plugins/${commonj.sdo.jar}"/> |
| <echo message="Implementation-Version: ${version.string}"/> |
| <jar jarfile="../plugins/${commonj.sdo.jar}"> |
| <manifest> |
| <attribute name="Manifest-Version" value="1.0"/> |
| <attribute name="Bundle-ManifestVersion" value="2"/> |
| <attribute name="Bundle-Name" value="SDO"/> |
| <attribute name="Bundle-Vendor" value="commonj.sdo Project"/> |
| <attribute name="Bundle-SymbolicName" value="commonj.sdo"/> |
| <attribute name="Bundle-RequiredExecutionEnvironment" value="JavaSE-1.7"/> |
| <attribute name="Bundle-Version" value="2.1.1"/> |
| <attribute name="Export-Package" value="${osgi.export.package}"/> |
| </manifest> |
| <fileset |
| dir="../plugins/${commonj.sdo.dir}/${classes.dir}" |
| includes="**/*.class" |
| /> |
| <fileset |
| dir="../plugins/${commonj.sdo.dir}" |
| includes="xsd/*.xsd" |
| /> |
| <fileset |
| dir="../plugins/${commonj.sdo.dir}" |
| includes="license.txt" |
| /> |
| </jar> |
| </target> |
| |
| </project> |