Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Equinox/p2/Ant Tasks

< Equinox‎ | p2
Revision as of 18:14, 5 March 2009 by Mpiggott.ca.ibm.com (Talk | contribs) (New page: ==General Format== ===Repositories=== The input format used by repositories in p2 Ant tasks: <source lang=xml> <XXXXX location="file:///Users/Pascal/Downloads/builds/transfer/files/updates...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

General Format

Repositories

The input format used by repositories in p2 Ant tasks:

<XXXXX location="file:///Users/Pascal/Downloads/builds/transfer/files/updates/3.5-I-builds/I20090203-1200" append="true" compressed="true" 
	format="file:///Users/Pascal/Downloads/builds/transfer/files/updates/3.5-I-builds/I20090203-1200" kind="metadata" name="" remove="false" />
Attribute Type Default Description
location URI null The location of the repository
append boolean true Determines if the task should append to an existing repository or empty it first
compressed boolean true Determines if the repository should be compressed
format URI null Location of a repository to copy format from
kind "metadata" or "artifact" Undefined Specifies the type of the repository
name String null The name of the repository
remove boolean false Defines if the repository be removed

In general the location is always required, other attributes may be considered optional by individual tasks.

Mirror Task

<p2.mirror source="file:///Users/Pascal/Downloads/builds/transfer/files/updates/3.5-I-builds/I20090203-1200">
	<destination kind="metadata" location="file:///Users/Pascal/tmp/mirrorTest9" name="RCP Repo" 
		format="file:///Users/Pascal/Downloads/builds/transfer/files	/updates/3.5-I-builds/I20090211-0900"/>
	<destination kind="artifact" location="file:///Users/Pascal/tmp/mirrorTest9" name="RCP Repo" 
		format="file:///Users/Pascal/Downloads/builds/transfer/files/updates/3.5-I-builds/I20090211-0900"/>
	<iu id="org.eclipse.rcp.feature.group" version="3.5.0.v20090202-9RA1FwwFr-TNqU7GSg_iVTQ"/>
</p2.mirror>

Validate Task

This task is used to validate an artifact repository using a comparator (the examples are using an md5 comparator.) A single use example:

<p2.composite.artifact.repository.validate comparatorID="org.eclipse.equinox.artifact.md5.comparator" location="file:///myfile"/>

An example task to validate multiple repositories using the same comparator:

<p2.composite.artifact.repository.validate comparatorID="org.eclipse.equinox.artifact.md5.comparator">
	<repository location="file:///myRepo"/>
	<repository location="file:///myRepo"/>
</p2.composite.artifact.repository.validate>

Creating a Composite Repository

The create composite repository tasks can be used to create an artifact or a metadata composite repository. The composite repository can use an existing repository as an example and match its properties using the format attribute.

<p2.composite.artifact.repository.create compressed="true" name="My new Repo" location="file:///myNewRepo"  />
<p2.composite.metadata.repository.create compressed="false" name="My new Repo" location="file:///myNewRepo" />

Or alternatively multiple repositories can be created at once.

<p2.composite.artifact.repository.create>
	<repository compressed="true" location="file:///myNewRepo" format="file:///anExamplerepo" name="My New Repo" />
</p2.composite.artifact.repository.create>
<p2.composite.metadata.repository.create>
	<repository compressed="true" location="file:///myNewRepo" format="file:///anExamplerepo" name="My New Repo" />
</p2.composite.metadata.repository.create>

Modifying the Children of a Composite Repository

It's also possible to add, or to remove children from a repository with an ant task.

To add a single child to a composite repository:

<p2.composite.artifact.repository.add location="file:///myRepo" child="file:///myChildRepo" />
<p2.composite.metadata.repository.add location="file:///myRepo" child="file:///myChildRepo" />

To remove a single child from a composite repository:

<p2.composite.artifact.repository.remove location="file:///myRepo" child="file:///myChildRepo" />
<p2.composite.metadata.repository.remove location="file:///myRepo" child="file:///myChildRepo" />

Or all children could be removed from a repository:

<p2.composite.artifact.repository.remove location="file:///myRepo" allChildren="True"/>
<p2.composite.metadata.repository.remove location="file:///myRepo" allChildren="True"/>

It's also possible add and remove children at the same time:

<p2.composite.artifact.repository.children location="file:///myRepo">
	<child location="file:///myChildRepo1"/>
	<child location="file:///myChildRepo2" remove="true"/>
</p2.composite.artifact.repository.children>
<p2.composite.metadata.repository.children location="file:///myRepo">
	<child location="file:///myChildRepo1"/>
	<child location="file:///myChildRepo2" remove="true"/>
</p2.composite.metadata.repository.children>

If the allChildren attribute is set to true all existing children are removed from the repository first:

<p2.composite.artifact.repository.children allChildren="true" location="file:///myRepo">
	<child location="file:///myChildRepo1"/>
	<child location="file:///myChildRepo2"/>
</p2.composite.artifact.repository.children>
<p2.composite.metadata.repository.children allChildren="true" location="file:///myRepo">
	<child location="file:///myChildRepo1"/>
	<child location="file:///myChildRepo2"/>
</p2.composite.metadata.repository.children>

Back to the top