| <!-- |
| Copyright (c) 2010 Stephan Herrmann and others. |
| All rights reserved. This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License v1.0 |
| which accompanies this distribution, and is available at |
| http://www.eclipse.org/legal/epl-v10.html |
| |
| Contributors: |
| Stephan Herrmann - initial API and implementation |
| --> |
| <project name="p2.helper"> |
| |
| <!-- The following tasks prepare a local update site to install the OTDT from --> |
| <target name="createLocalUpdateSite"> |
| <echo message="Creating local update site in ${otdtUpdatesDir}"/> |
| |
| <!-- Create the directory structure --> |
| <mkdir dir="${otdtUpdatesDir}"/> |
| <mkdir dir="${otdtUpdatesDir}/features"/> |
| <mkdir dir="${otdtUpdatesDir}/plugins"/> |
| <!-- Build the jar files --> |
| <ant antfile="${builder}/customTargets.xml" target="allElements" dir="${otdtUpdatesDir}"> |
| <property name="genericTargets" value="${OTScriptDir}/p2helper.xml"/> |
| <property name="target" value="updateSiteExport"/> |
| </ant> |
| <!-- better to do this from run.xml (outside eclipse) --> |
| <!-- <antcall target="generateMetadata"/> --> |
| </target> |
| |
| <target name="updateSiteExport"> |
| <condition property="isTestFeature"> |
| <contains string="${id}" substring="tests"/> |
| </condition> |
| <antcall target="doUpdateSiteExport"/> |
| </target> |
| |
| <target name="doUpdateSiteExport" unless="isTestFeature"> |
| <echo message="Creating content for updateSite, feature ${id}"/> |
| |
| <ant antfile="build.xml" dir="${buildDirectory}/features/${id}/" target="build.update.jar"> |
| <property name="feature.destination" value="${otdtUpdatesDir}/features"/> |
| <property name="plugin.destination" value="${otdtUpdatesDir}/plugins"/> |
| </ant> |
| </target> |
| |
| <target name="generateMetadata"> |
| <echo message="Generating metadata for features and plugins in ${otdtUpdatesDir}"/> |
| <java |
| inputstring="" |
| dir="${baseLocation}" |
| fork="true" |
| classname="org.eclipse.equinox.launcher.Main" |
| classpath="${baseLocation}/plugins/${org.eclipse.equinox.launcher_jar}"> |
| <arg value="-consoleLog"/> |
| <arg value="-nosplash"/> |
| <arg value="-application"/> |
| <arg value="org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher" /> |
| <arg value="-source"/> |
| <arg value="${otdtUpdatesDir}"/> |
| <arg value="-metadataRepository" /> |
| <arg value="file:${otdtUpdatesDir}" /> |
| <arg value="-metadataRepositoryName" /> |
| <arg value="Object Teams Updates" /> |
| <arg value="-artifactRepository" /> |
| <arg value="file:${otdtUpdatesDir}" /> |
| <arg value="-append" /> |
| <!-- arg value="-compress" /--> |
| <!-- don't categorize features at this stage! --> |
| </java> |
| |
| <!-- patch feature version in content.xml --> |
| <property name="patch-content.xsltFile" value="${OTScriptDir}/patch-content-xml.xsl" /> |
| <property name="content.origFile" value="content.xml" /> |
| <property name="content.transFile" value="content-patched.xml" /> |
| <xslt basedir="${otdtUpdatesDir}" destdir="${otdtUpdatesDir}" includes="${content.origFile}" style="${patch-content.xsltFile}" force="true"> |
| <outputproperty name="method" value="xml"/> |
| <outputproperty name="encoding" value="UTF-8"/> |
| <outputproperty name="indent" value="yes"/> |
| <mapper type="glob" from="${content.origFile}" to="${content.transFile}"/> |
| </xslt> |
| <move file="${otdtUpdatesDir}/${content.transFile}" tofile="${otdtUpdatesDir}/${content.origFile}" overwrite="yes"/> |
| </target> |
| |
| <target name="installFeature"> |
| <echo message="Installing ${feature} from ${sourceUpdatesDir} to ${targetEclipseDir}"/> |
| <java |
| inputstring="" |
| dir="${targetEclipseDir}" |
| fork="true" |
| classname="org.eclipse.equinox.launcher.Main" |
| classpath="${targetEclipseDir}/plugins/${org.eclipse.equinox.launcher_jar}"> |
| <jvmarg value="-Declipse.p2.MD5Check=false" /> |
| <arg value="-consoleLog"/> |
| <arg value="-application"/> |
| <arg value="org.eclipse.equinox.p2.director"/> |
| <arg value="-metadataRepository" /> |
| <arg value="file:${sourceUpdatesDir}" /> |
| <arg value="-artifactRepository" /> |
| <arg value="file:${sourceUpdatesDir}" /> |
| <arg value="-installIU" /> |
| <arg value="${feature}" /> |
| </java> |
| </target> |
| |
| <target name="installOTDT"> |
| <echo message="Installing the OTDT from ${otdtUpdatesDir} into ${test.eclipseDir}"/> |
| <antcall target="installFeature"> |
| <param name="feature" value="org.eclipse.objectteams.otequinox.feature.group"/> |
| <param name="sourceUpdatesDir" value="${otdtUpdatesDir}"/> |
| <param name="targetEclipseDir" value="${test.eclipseDir}"/> |
| </antcall> |
| <antcall target="installFeature"> |
| <param name="feature" value="org.eclipse.objectteams.otdt.feature.group"/> |
| <param name="sourceUpdatesDir" value="${otdtUpdatesDir}"/> |
| <param name="targetEclipseDir" value="${test.eclipseDir}"/> |
| </antcall> |
| <echo message="Generating accumulating metadata in ${otdtUpdatesDir}" /> |
| <!-- existing meta data are pre-loaded from build.xml --> |
| </target> |
| |
| <target name="installTests"> |
| <echo message="Installing the Tests from ${testsUpdatesDirBase} into ${test.eclipseDir}"/> |
| <!-- eclipse tests have been expanded into "eclipse", don't have meta data --> |
| <antcall target="installFeature"> |
| <param name="feature" value="org.eclipse.test.feature.group"/> |
| <param name="sourceUpdatesDir" value="${testsUpdatesDirBase}/eclipse"/> |
| <param name="targetEclipseDir" value="${test.eclipseDir}"/> |
| </antcall> |
| <!-- otdt tests have been gathered into "otdt", have and need meta data --> |
| <antcall target="installFeature"> |
| <param name="feature" value="org.eclipse.objectteams.otdt-tests.feature.group"/> |
| <param name="sourceUpdatesDir" value="${testsUpdatesDirBase}/otdt"/> |
| <param name="targetEclipseDir" value="${test.eclipseDir}"/> |
| </antcall> |
| </target> |
| |
| </project> |