| <!--/******************************************************************************* |
| * 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}"/> |
| |
| <condition property="version" value="${release.version}"> |
| <or> |
| <not> |
| <isset property="build_id"/> |
| </not> |
| <equals arg1="${build_id}" arg2="" trim="true"/> |
| |
| </or> |
| </condition> |
| <property name="version" value="${release.version}-${build_id}"/> |
| |
| <echo message="version ${version}"/> |
| |
| <!-- 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="${release.version}"/> |
| <echo message="installer_id ${installer_id}"/> |
| |
| <!-- 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.core.base}/${plugins.dir}/${eclipselink.core.jar}_${installer_id}.jar"/> |
| <param name="artifactSrc" value="${eclipselink.core.base}/${plugins.dir}/${eclipselink.core.jar}.source_${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="artifactSrc" value="${eclipselink.jpa.base}/${plugins.dir}/${eclipselink.jpa.jar}.source_${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="artifactSrc" value="${eclipselink.moxy.base}/${plugins.dir}/${eclipselink.moxy.jar}.source_${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="artifactSrc" value="${eclipselink.sdo.base}/${plugins.dir}/${eclipselink.sdo.jar}.source_${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.core.base}/${plugins.dir}/${eclipselink.extension.oracle.jar}_${installer_id}.jar"/> |
| <param name="artifactSrc" value="${eclipselink.core.base}/${plugins.dir}/${eclipselink.extension.oracle.jar}.source_${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="artifactSrc" value="${eclipselink.plugins}/${eclipselink.antlr.jar}.source_${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="artifactSrc" value="${eclipselink.plugins}/${eclipselink.asm.jar}.source_${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="artifactSrc" value="${eclipselink.src.install.prefix}${eclipselink.zip.suffix}"/> |
| <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="version" value="${version}"/> |
| <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="${artifactSrc}" classifier="sources"/> |
| </artifact:deploy> |
| |
| <!-- cleanup --> |
| <delete file="pom.xml"/> |
| |
| </target> |
| </project> |
| |
| |