blob: 11839d035573f149613fa88cd626fe0cd3061558 [file] [log] [blame]
<!--/*******************************************************************************
* 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:
* egwin - initial API and implementation
#******************************************************************************/-->
<project name="oraclelibs" default="build" basedir=".">
<available file="../${ant.project.name}" type="dir" property="p2.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="p2.is.local"/>
<!-- Need generate "dependency bundle" in p2.bundle.dir from supplied oracle jars bundles,
and create the features into the "p2.repos.dir/plugins" dir; also need to filter copy
the feature xml files to "p2.repos.dir/features" to substitute the actual version.qualifer string into it.
Then can Generate P2.
-->
<target name="build" depends="init, clean, generate-p2"/>
<target name="init">
<tstamp>
<format property="oraclelibs.build.date" pattern="yyyyMMdd"/>
<format property="oraclelibs.build.time" pattern="HHmm"/>
</tstamp>
<dirname property="oraclelibs.build.location_temp" file="${ant.file.oraclelibs}"/>
<pathconvert targetos="unix" property="oraclelibs.build.location">
<path>
<pathelement location="${oraclelibs.build.location_temp}"/>
</path>
</pathconvert>
<!-- oraclelibs.2.base.dir needs to be explicit (not relative) for antcall usage -->
<!-- (I think the selectbundle call reverts to calling dir - despite the antcall "dir=") -->
<property name="oraclelibs.2.base.dir" value="${oraclelibs.build.location}/../.."/>
<property name="oraclelibs.2.buildsys.dir" value="${oraclelibs.2.base.dir}/buildsystem"/>
<echo message="ant.project.name ='${ant.project.name}'"/>
<echo message="basedir ='${basedir}'"/>
<echo message="oraclelibs.build.location ='${oraclelibs.build.location}'"/>
<echo message="oraclelibs.2.base.dir ='${oraclelibs.2.base.dir}'"/>
<echo message="oraclelibs.2.buildsys.dir ='${oraclelibs.2.buildsys.dir}'"/>
<echo message=" ---"/>
<condition property="custom.properties.message" value="Loading user defined properties from: '${user.home}/build.properties'"
else="No custom properties file at '${user.home}/build.properties'. Continuing build using defaults.">
<available file="${user.home}/build.properties"/>
</condition>
<echo message="${custom.properties.message}"/>
<property file="${user.home}/build.properties"/>
<echo message=" "/>
<!-- Sets default for all extensions.depend dir locations to static paths -->
<property name="oracle.extensions.depend.dir" value="${oraclelibs.2.base.dir}/../extension.oracle.lib.external"/>
<echo message="oracle.extensions.depend.dir = '${oracle.extensions.depend.dir}'"/>
<!-- This HAS to be defined after allowing user redefinitions (which will cause the condition not to set anything) -->
<!-- This tests to make sure the extensions dir exists, if not sets to a existant dummy location -->
<condition property="extensions.depend.dir" value="${oraclelibs.2.base.dir}/../extension.lib.external"
else="${oraclelibs.build.location}">
<available file="${oraclelibs.2.base.dir}/../extension.lib.external" type="dir"/>
</condition>
<echo message="extensions.depend.dir = '${extensions.depend.dir}'"/>
<property name="ojdbc.jar" value="ojdbc7.jar"/>
<property name="orai18n.jar" value="orai18n.jar"/>
<property name="sdoapi.jar" value="sdoapi.jar"/>
<property name="xdb.jar" value="xdb.jar"/>
<property name="xmlparser.jar" value="xmlparserv2.jar"/>
<property name="ucp.jar" value="ucp.jar"/>
<property name="dms.jar" value="dms.jar"/>
<property name="aqapi.jar" value="aqapi.jar"/>
<property name="xml.jar" value="xml.jar"/>
<property name="kvclient.jar" value="kvclient-1.1.100.jar"/>
<echo message=" "/>
<echo message="Defined Oracle dependencies:"/>
<echo message=" ojdbc.jar = '${ojdbc.jar}'"/>
<echo message=" orai18n.jar = '${orai18n.jar}'"/>
<echo message=" sdoapi.jar = '${sdoapi.jar}'"/>
<echo message=" xdb.jar = '${xdb.jar}'"/>
<echo message=" xmlparser.jar = '${xmlparser.jar} '"/>
<echo message=" ucp.jar = '${ucp.jar}'"/>
<echo message=" dms.jar = '${dms.jar}'"/>
<echo message=" aqapi.jar = '${aqapi.jar} '"/>
<echo message=" xml.jar = '${xml.jar}'"/>
<echo message=" kvclient.jar = '${kvclient.jar}'"/>
<echo message=" ---"/>
<!-- Custom task definitions -->
<property name="custom.tasks.lib" value="${oraclelibs.2.buildsys.dir}/ant_customizations.jar"/>
<property name="custom.echo.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.Say"/>
<property name="custom.selectbundle.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.SelectBundle"/>
<echo message="custom.tasks.lib ='${custom.tasks.lib}'"/>
<echo message="custom.echo.task.class ='${custom.echo.task.class}'"/>
<echo message="custom.selectbundle.task.class ='${custom.selectbundle.task.class}'"/>
<echo message=" ---"/>
<taskdef name="say" classname="${custom.echo.task.class}" classpath="${custom.tasks.lib}"/>
<taskdef name="selectbundle" classname="${custom.selectbundle.task.class}" classpath="${custom.tasks.lib}"/>
<!-- Defaults of Pre-Set variables -->
<property name="oraclelibs.version" value="1.0.0"/>
<property name="oraclelibs.qualifier" value="v${oraclelibs.build.date}${oraclelibs.build.time}"/>
<property name="oraclelibs.version.string" value="${oraclelibs.version}.${oraclelibs.qualifier}"/>
<property name="bld.src.dir" value="${oraclelibs.build.location}/target"/>
<property name="p2.repos.dir" value="${oraclelibs.build.location}/p2repo"/>
<property name="specification.vendor" value="Eclipse.org - EclipseLink Project"/>
<echo message="oraclelibs.version ='${oraclelibs.version}'"/>
<echo message="oraclelibs.qualifier ='${oraclelibs.qualifier}'"/>
<echo message="oraclelibs.version.string ='${oraclelibs.version.string}'"/>
<echo message="p2.repos.dir ='${p2.repos.dir}'"/>
<echo message="specification.vendor ='${specification.vendor}'"/>
<echo message=" ---"/>
<!-- Tool definitions -->
<property name="eclipse.install.dir" value="D:/Juno-M7/eclipse"/>
<property name="eclipse.plugin.dir" value="${eclipse.install.dir}/plugins"/>
<property name="p2.publisher.prefix" value="org.eclipse.equinox.p2.publisher"/>
<property name="p2.launcher.prefix" value="org.eclipse.equinox.launcher"/>
<property name="p2.artifact.prefix" value="org.eclipse.equinox.artifact.repository"/>
<available file="${eclipse.plugin.dir}" property="sdk.install.exist"/>
<echo message="eclipse.install.dir ='${eclipse.install.dir}'"/>
<say message="eclipse.plugin.dir ='${eclipse.plugin.dir}'" if="sdk.install.exist"/>
<say message="eclipse.plugin.dir: '${eclipse.plugin.dir}' not found!" unless="sdk.install.exist"/>
<echo message="p2.publisher.jar ='${p2.publisher.jar}'"/>
<echo message="p2.launcher.jar ='${p2.launcher.jar}'"/>
<echo message="p2.artifact.jar ='${p2.artifact.jar}'"/>
<echo message=" ---"/>
<!-- Input definitions -->
<property name="p2.feature.dir" value="${p2.repos.dir}/features"/>
<property name="p2.bundle.dir" value="${p2.repos.dir}/plugins"/>
<echo message="p2.feature.dir ='${p2.feature.dir}'"/>
<echo message="p2.bundle.dir ='${p2.bundle.dir}'"/>
<echo message=" ---"/>
<!-- Helper definitions derived from Pre-set variables -->
<property name="oraclelibs.build.dir" value="${p2.feature.dir}"/>
<echo message="oraclelibs.build.dir ='${oraclelibs.build.dir}'"/>
<echo message=" ---"/>
<!-- Output definitions -->
<property name="p2.repos.url" value="file:/${p2.repos.dir}"/> <!-- DO NOT Override this one -->
<property name="p2.release.repos.name" value="EclipseLink oraclelibs Repository"/>
<property name="metadata.repos.name" value="&quot;${p2.release.repos.name}&quot;"/>
<property name="artifact.repos.name" value="&quot;EclipseLink oraclelibs Artifacts&quot;"/>
<echo message="p2.repos.url ='${p2.repos.url}'"/>
<echo message="p2.release.repos.name ='${p2.release.repos.name}'"/>
<echo message="metadata.repos.name ='${metadata.repos.name}'"/>
<echo message="artifact.repos.name ='${artifact.repos.name}'"/>
<!-- Feature Dependency variables -->
<property name="oracle.libs.prefix" value="oracle.libs"/>
<property name="oracle.libs.criteria" value="[0.0.1,5.0.0)"/>
</target>
<!-- Targets to build dependency jar for deployment to p2 -->
<target name="check-oracle-dependencies" depends="init">
<condition property="ojdbc.lib" value="${oracle.extensions.depend.dir}/${ojdbc.jar}"
else="${extensions.depend.dir}/${ojdbc.jar}">
<available file="${oracle.extensions.depend.dir}/${ojdbc.jar}"/>
</condition>
<condition property="sdoapi.lib" value="${oracle.extensions.depend.dir}/${sdoapi.jar}"
else="${extensions.depend.dir}/${sdoapi.jar}">
<available file="${oracle.extensions.depend.dir}/${sdoapi.jar}"/>
</condition>
<condition property="xdb.lib" value="${oracle.extensions.depend.dir}/${xdb.jar}"
else="${extensions.depend.dir}/${xdb.jar}">
<available file="${oracle.extensions.depend.dir}/${xdb.jar}"/>
</condition>
<condition property="xmlparser.lib" value="${oracle.extensions.depend.dir}/${xmlparser.jar}"
else="${extensions.depend.dir}/${xmlparser.jar}">
<available file="${oracle.extensions.depend.dir}/${xmlparser.jar}"/>
</condition>
<condition property="ucp.lib" value="${oracle.extensions.depend.dir}/${ucp.jar}"
else="${extensions.depend.dir}/${ucp.jar}">
<available file="${oracle.extensions.depend.dir}/${ucp.jar}"/>
</condition>
<condition property="dms.lib" value="${oracle.extensions.depend.dir}/${dms.jar}"
else="${extensions.depend.dir}/${dms.jar}">
<available file="${oracle.extensions.depend.dir}/${dms.jar}"/>
</condition>
<condition property="aqapi.lib" value="${oracle.extensions.depend.dir}/${aqapi.jar}"
else="${extensions.depend.dir}/${aqapi.jar}">
<available file="${oracle.extensions.depend.dir}/${aqapi.jar}"/>
</condition>
<condition property="xml.lib" value="${oracle.extensions.depend.dir}/${xml.jar}"
else="${extensions.depend.dir}/${xml.jar}">
<available file="${oracle.extensions.depend.dir}/${xml.jar}"/>
</condition>
<condition property="kvclient.lib" value="${oracle.extensions.depend.dir}/${kvclient.jar}"
else="${extensions.depend.dir}/${kvclient.jar}">
<available file="${oracle.extensions.depend.dir}/${kvclient.jar}"/>
</condition>
<!-- oracle dependency tests -->
<available file="${ojdbc.lib}" property="ojdbc.bundle.exist"/>
<available file="${sdoapi.lib}" property="sdoapi.bundle.exist"/>
<available file="${xdb.lib}" property="xdb.bundle.exist"/>
<available file="${xmlparser.lib}" property="xmlparser.bundle.exist"/>
<available file="${ucp.lib}" property="ucp.bundle.exist"/>
<available file="${dms.lib}" property="dms.bundle.exist"/>
<available file="${aqapi.lib}" property="aqapi.bundle.exist"/>
<available file="${xml.lib}" property="xml.bundle.exist"/>
<available file="${kvclient.lib}" property="kvclient.bundle.exist"/>
<condition property="dependencies.exist" value="true">
<and>
<isset property="ojdbc.bundle.exist"/>
<isset property="sdoapi.bundle.exist"/>
<isset property="xdb.bundle.exist"/>
<isset property="xmlparser.bundle.exist"/>
<isset property="ucp.bundle.exist"/>
<isset property="dms.bundle.exist"/>
<isset property="aqapi.bundle.exist"/>
<isset property="xml.bundle.exist"/>
<isset property="kvclient.bundle.exist"/>
</and>
</condition>
<say message="Found: '${ojdbc.lib}'" if="ojdbc.bundle.exist"/>
<say message="Cannot find: '${ojdbc.lib}'" unless="ojdbc.bundle.exist"/>
<say message="Found: '${sdoapi.lib}'" if="sdoapi.bundle.exist"/>
<say message="Cannot find: '${sdoapi.lib}'" unless="sdoapi.bundle.exist"/>
<say message="Found: '${xdb.lib}'" if="xdb.bundle.exist"/>
<say message="Cannot find: '${xdb.lib}'" unless="xdb.bundle.exist"/>
<say message="Found: '${xmlparser.lib}'" if="xmlparser.bundle.exist"/>
<say message="Cannot find: '${xmlparser.lib}'" unless="xmlparser.bundle.exist"/>
<say message="Found: '${ucp.lib}'" if="ucp.bundle.exist"/>
<say message="Cannot find: '${ucp.lib}'" unless="ucp.bundle.exist"/>
<say message="Found: '${dms.lib}'" if="dms.bundle.exist"/>
<say message="Cannot find: '${dms.lib}'" unless="dms.bundle.exist"/>
<say message="Found: '${aqapi.lib}'" if="aqapi.bundle.exist"/>
<say message="Cannot find: '${aqapi.lib}'" unless="aqapi.bundle.exist"/>
<say message="Found: '${xml.lib}'" if="xml.bundle.exist"/>
<say message="Cannot find: '${xml.lib}'" unless="xml.bundle.exist"/>
<say message="Found: '${kvclient.lib}'" if="kvclient.bundle.exist"/>
<say message="Cannot find: '${kvclient.lib}'" unless="kvclient.bundle.exist"/>
<fail message="All dependencies not found! Aborting..." unless="dependencies.exist"/>
</target>
<target name="package-oracle-dep-jar" depends="check-oracle-dependencies" description="package single jar with OSGi manifest, and Oracle POJO dependency jars">
<delete dir="${p2.bundle.dir}" failonerror="false"/>
<mkdir dir="${p2.bundle.dir}"/>
<echo message="Packaging: '${p2.bundle.dir}/${oracle.libs.prefix}_${oraclelibs.version.string}.jar'..."/>
<delete file="${p2.bundle.dir}/${oracle.libs.prefix}_${oraclelibs.version.string}.jar"/>
<jar jarfile="${p2.bundle.dir}/${oracle.libs.prefix}_${oraclelibs.version.string}.jar" duplicate="preserve">
<manifest>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="Oracle Target Libraries"/>
<attribute name="Bundle-SymbolicName" value="${oracle.libs.prefix}"/>
<attribute name="Bundle-Version" value="${oraclelibs.version.string}"/>
<attribute name="Bundle-ClassPath" value="${xmlparser.jar},${aqapi.jar},${dms.jar},${ojdbc.jar},${sdoapi.jar},${xdb.jar},${xml.jar},${ucp.jar},${kvclient.jar}"/>
<attribute name="Bundle-Vendor" value="Oracle"/>
<attribute name="Export-Package" value="javax.xml,javax.xml.bind,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.namespace,javax.xml.parsers,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stream,javax.xml.xpath,oracle.AQ,oracle.core.lmx,oracle.core.lvf,oracle.dms,oracle.dms.instrument,oracle.dms.spy,oracle.jdbc,oracle.jdbc.aq,oracle.jdbc.connector,oracle.jdbc.dcn,oracle.jdbc.driver,oracle.jdbc.internal,oracle.jdbc.oci,oracle.jdbc.oracore,oracle.jdbc.pool,oracle.jdbc.rowset,oracle.jdbc.util,oracle.jdbc.xa,oracle.jdbc.xa.client,oracle.jms,oracle.jpub.runtime,oracle.kv,oracle.net.TNSAddress,oracle.net.ano,oracle.net.aso,oracle.net.jndi,oracle.net.nl,oracle.net.nl.mesg,oracle.net.ns,oracle.net.nt,oracle.net.resolver,oracle.security.o3logon,oracle.security.o5logon,oracle.spatial.geometry,oracle.sql,oracle.sql.converter,oracle.ucp,oracle.ucp.jdbc,oracle.ucp.jdbc.oracle,oracle.xdb,oracle.xdb.bean,oracle.xdb.dom,oracle.xdb.servlet,oracle.xdb.spi,oracle.xml.async,oracle.xml.binxml,oracle.xml.comp,oracle.xml.dbaccess,oracle.xml.differ,oracle.xml.io,oracle.xml.jaxb,oracle.xml.jaxp,oracle.xml.jdwp,oracle.xml.mesg,oracle.xml.parser.schema,oracle.xml.parser.v2,oracle.xml.pipeline.controller,oracle.xml.pipeline.processes,oracle.xml.scalable,oracle.xml.schemavalidator,oracle.xml.transviewer,oracle.xml.transx,oracle.xml.util,oracle.xml.xmlcomp,oracle.xml.xmldbaccess,oracle.xml.xpath,oracle.xml.xqxp,oracle.xml.xqxp.datamodel,oracle.xml.xqxp.functions,oracle.xml.xqxp.functions.builtIns,oracle.xml.xslt,oracle.xml.xsql,oracle.xml.xsql.actions,oracle.xml.xsql.serializers,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.events,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.traversal,org.w3c.dom.validation,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers"/>
<attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.5"/>
<attribute name="Import-Package" value="javax.jms;version=&quot;1.1.0&quot;;resolution:=optional,javax.resource;version=&quot;1.5.0&quot;;resolution:=optional,javax.resource.spi;version=&quot;1.5.0&quot;;resolution:=optional,javax.resource.spi.endpoint;version=&quot;1.5.0&quot;;resolution:=optional,javax.resource.spi.security;version=&quot;1.5.0&quot;;resolution:=optional,javax.servlet;version=&quot;2.4.0&quot;;resolution:=optional,javax.servlet.http;version=&quot;2.4.0&quot;;resolution:=optional,javax.transaction.xa;version=&quot;1.1.0&quot;;resolution:=optional"/>
</manifest>
<fileset dir="${oracle.extensions.depend.dir}">
<include name="${ojdbc.jar}"/>
<include name="${sdoapi.jar}"/>
<include name="${xdb.jar}"/>
<include name="${xmlparser.jar}"/>
<include name="${ucp.jar}"/>
<include name="${dms.jar}"/>
<include name="${aqapi.jar}"/>
<include name="${xml.jar}"/>
<include name="${kvclient.jar}"/>
</fileset>
<fileset dir="${extensions.depend.dir}">
<include name="${ojdbc.jar}"/>
<include name="${sdoapi.jar}"/>
<include name="${xdb.jar}"/>
<include name="${xmlparser.jar}"/>
<include name="${ucp.jar}"/>
<include name="${dms.jar}"/>
<include name="${aqapi.jar}"/>
<include name="${xml.jar}"/>
<include name="${kvclient.jar}"/>
</fileset>
</jar>
</target>
<!-- Feature Targets -->
<!-- clean -->
<target name="clean" depends="init" description="Clean all generated content">
<delete dir="${bld.src.dir}" includeEmptyDirs="true" failonerror="false"/>
<delete dir="${p2.repos.dir}" includeEmptyDirs="true" failonerror="false"/>
</target>
<target name="resolve-feature-dependencies" depends="init, package-oracle-dep-jar">
<echo message="Searching ${p2.bundle.dir}..."/>
<selectbundle basename="${oracle.libs.prefix}" directory="${p2.bundle.dir}"
criterion="${oracle.libs.criteria}" property="oracle.libs.version" versiononly="true"
/>
<say message=" oracle.libs.version = '${oracle.libs.version}'" if="oracle.libs.version"/>
<say message=" '${oracle.libs.prefix}_${oracle.libs.criteria}.jar' not found! Generated features will be invalid." unless="oracle.libs.version"/>
</target>
<!-- build feature jars -->
<target name="jar-feature" description="General target for packaging a feature">
<mkdir dir="${oraclelibs.build.dir}"/>
<jar jarfile="${oraclelibs.build.dir}/${feature.name}_${oraclelibs.version.string}.jar" duplicate="preserve">
<fileset dir="${bld.src.dir}/${feature.name}">
<include name="*.*"/>
<exclude name="*.bak"/>
</fileset>
</jar>
</target>
<target name="create-deployable-features" depends="resolve-feature-dependencies">
<mkdir dir="${bld.src.dir}"/>
<!-- Filters for feature.xml files -->
<filter token="VERSION" value="${oraclelibs.version}"/>
<filter token="QUALIFIER" value="${oraclelibs.qualifier}"/>
<!-- Filters for dependencies in feature.xml files -->
<filter token="ORACLE_LIBS_VERSION" value="${oracle.libs.version}"/>
<!-- Filters for feature.properties files -->
<filter token="PROVIDER" value="${specification.vendor}"/>
<filter token="REPOS_NAME" value="${p2.release.repos.name}"/>
<filter token="MILESTONE_REPOS" value="${p2.release.repos.name}"/>
<filter token="PRIME_UPDATE_URL" value="${p2.repos.url}"/>
<filter token="SECOND_UPDATE_URL" value="${p2.repos.url}"/>
<copy todir="${bld.src.dir}" filtering="true">
<fileset dir="${oraclelibs.build.location}">
<include name="**/feature*.*"/>
</fileset>
</copy>
<antcall target="jar-feature">
<param name="feature.name" value="oracle.libs.feature"/>
</antcall>
</target>
<!-- P2 Targets -->
<target name="configure-tooling" depends="init">
<selectbundle basename="${p2.launcher.prefix}" directory="${eclipse.plugin.dir}"
criterion="[0.0.1,9.0.0)" property="p2.launcher.jar"
/>
<selectbundle basename="${p2.publisher.prefix}" directory="${eclipse.plugin.dir}"
criterion="[0.0.1,9.0.0)" property="p2.publisher.jar"
/>
<echo message="eclipse.plugin.dir ='${eclipse.plugin.dir}'"/>
<say message="p2.launcher.jar ='${p2.launcher.jar}'" if="p2.launcher.jar"/>
<say message=" '${p2.launcher.prefix}_[0.0.1,9.0.0).jar' not found! P2 Generation will fail." unless="p2.launcher.jar"/>
<say message="p2.publisher.jar ='${p2.publisher.jar}'" if="p2.publisher.jar"/>
<say message=" '${p2.publisher.prefix}_[0.0.1,9.0.0).jar' not found!P2 Generation will fail." unless="p2.publisher.jar"/>
<condition property="p2.tooling.available">
<and>
<isset property="p2.launcher.jar"/>
<isset property="p2.publisher.jar"/>
</and>
</condition>
<say message="All P2 Generation libraries not available. Generation aborted!" unless="p2.tooling.available"/>
</target>
<target name="generate-p2" if="p2.tooling.available" depends="configure-tooling, create-deployable-features">
<echo message="java.home ='${java.home}'"/>
<echo message="-----"/>
<echo message="eclipse.plugin.dir='${eclipse.plugin.dir}'"/>
<echo message="p2.launcher.jar ='${p2.launcher.jar}'"/>
<echo message="p2.publisher.jar ='${p2.publisher.jar}'"/>
<echo message="-----"/>
<echo message="p2.repos.dir ='${p2.repos.dir}'"/>
<echo message="p2.repos.url ='${p2.repos.url}'"/>
<echo message="-----"/>
<!-- Metadata generator apparently doesn't rebuild the artifact and content xml files if they already exist -->
<delete failonerror="false">
<fileset dir="${p2.repos.dir}" includes="artifact*.*, content*.*"/>
</delete>
<java classname="org.eclipse.equinox.launcher.Main" fork="true" timeout="10800000" taskname="p2"
jvm="${java.home}/bin/java" failonerror="false" maxmemory="256m">
<classpath>
<fileset dir="${eclipse.plugin.dir}"
includes="${p2.launcher.jar},
${p2.publisher.jar}"/>
<pathelement location="${eclipse.plugin.dir}" />
</classpath>
<arg line=" -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher" />
<arg line=" -metadataRepository ${p2.repos.url}" />
<arg line=" -artifactRepository ${p2.repos.url}" />
<arg line=" -source ${p2.repos.dir}" />
<arg line=" -compress -publishArtifacts -configs all" />
</java>
</target>
</project>