blob: cf3e06250242ba1dab3da364a18cc0af281bc274 [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 '.'
* - multi-word targets use hyphens '-'
* - multi-word macros use underscores '_'
* - multi-word macro attributes are concatinated
* e.g. 'runpathref'
* - multi-word tasks (taskdef) names are concatinated
* 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:
* mmeswani - initial API and implementation (checked in by tware)
#******************************************************************************/-->
<project name="Upload EclipseLink artifacts to Maven repository" basedir="." xmlns:artifact="urn:maven-artifact-ant" default="upload-maven-all">
<!-- path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.0.8.jar" /> TODO discuss with Tom where should this value and the actual lib go -->
<path id="maven-ant-tasks.classpath" path="${build.deps.dir}/mavenant/maven-ant-tasks-2.0.8.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant"
classpathref="maven-ant-tasks.classpath" />
<!-- The repository where maven artifacts will be uploaded -->
<artifact:remoteRepository id="eclipselink.repository" url="file:///home/data/httpd/download.eclipse.org/rt/eclipselink/maven.repo" />
<target name = "upload-maven-init">
<property file="./build.properties"/> <!-- release.version and build_id are intialized from here -->
<echo message="release.version ${release.version}"/>
<echo message="build_id ${build_id}"/>
<!-- ensure installer_id is set - in general, installer id will be set by previous scripts when this script is called-->
<property name="installer_id" value="${build_date}"/>
<!-- Get the subversion version for current working copy -->
<!-- A freshly checked out copy of workspace is guaranteed to not have mixed revisions -->
<exec outputproperty="subversion.revision" failonerror="true" executable="svnversion">
<arg line="."/>
</exec>
<echo message="subversion.revision ${subversion.revision}"/>
</target>
<target name = "upload-maven-all" depends = "upload-maven-init">
<!-- call upload for each artifact we want to upload -->
<antcall target="upload-artifact">
<param name="artifactId" value="org.eclipse.persistence.core"/>
<param name="artifact" value="${eclipselink.foundation.base}/${plugins.dir}/${eclipselink.core.jar}_${installer_id}.jar"/>
<param name="artifactName" value="EclipseLink Core"/>
</antcall>
<antcall target="upload-artifact">
<param name="artifactId" value="org.eclipse.persistence.jpa"/>
<param name="artifact" value="${eclipselink.jpa.base}/${plugins.dir}/${eclipselink.jpa.jar}_${installer_id}.jar"/>
<param name="artifactName" value="EclipseLink JPA"/>
</antcall>
<antcall target="upload-artifact">
<param name="artifactId" value="org.eclipse.persistence.moxy"/>
<param name="artifact" value="${eclipselink.moxy.base}/${plugins.dir}/${eclipselink.moxy.jar}_${installer_id}.jar"/>
<param name="artifactName" value="EclipseLink Moxy"/>
</antcall>
<antcall target="upload-artifact">
<param name="artifactId" value="org.eclipse.persistence.sdo"/>
<param name="artifact" value="${eclipselink.sdo.base}/${plugins.dir}/${eclipselink.sdo.jar}_${installer_id}.jar"/>
<param name="artifactName" value="EclipseLink SDO"/>
</antcall>
<antcall target="upload-artifact">
<param name="artifactId" value="org.eclipse.persistence.oracle"/>
<param name="artifact" value="${eclipselink.foundation.base}/${plugins.dir}/${eclipselink.extension.oracle.jar}_${installer_id}.jar"/>
<param name="artifactName" value="EclipseLink Oracle Extensions"/>
</antcall>
<antcall target="upload-artifact">
<param name="artifactId" value="org.eclipse.persistence.antlr"/>
<param name="artifact" value="${eclipselink.plugins}/${eclipselink.antlr.jar}_${installer_id}.jar"/>
<param name="artifactName" value="EclipseLink ANTLR"/>
</antcall>
<antcall target="upload-artifact">
<param name="artifactId" value="org.eclipse.persistence.asm"/>
<param name="artifact" value="${eclipselink.plugins}/${eclipselink.asm.jar}_${installer_id}.jar"/>
<param name="artifactName" value="EclipseLink ASM"/>
</antcall>
<antcall target="upload-artifact">
<param name="artifactId" value="eclipselink"/>
<param name="artifact" value="${eclipselink.jar.name}"/>
<param name="artifactName" value="EclipseLink"/>
</antcall>
</target>
<!-- Uploads a single artifact to maven repository -->
<target name="upload-artifact" >
<!-- Copy pom.template to pom.xml filtering various properties -->
<copy file="pom.xml.template" tofile="pom.xml" overwrite="true">
<filterset>
<filter token="release.version" value="${release.version}"/>
<filter token="qualifier" value="${build_id}"/>
<filter token="subversion.revision" value="${subversion.revision}"/>
<filter token="artifactId" value="${artifactId}"/>
<filter token="artifactName" value="${artifactName}"/>
</filterset>
</copy>
<!-- Delploy the jar to maven repository along with sources -->
<artifact:pom id="maven.project" file="pom.xml" />
<artifact:deploy file="${artifact}">
<remoteRepository refid="eclipselink.repository"/>
<pom refid="maven.project"/>
<artifact:attach file="${eclipselink.src.install.prefix}${eclipselink.zip.suffix}" classifier="sources"/>
</artifact:deploy>
<!-- cleanup -->
<delete file="pom.xml"/>
</target>
</project>