Target Platform Definition DSL and Generator provides a DSL with an advanced editor and a generator taking this DSL as input and generating a .target
file that PDE is able to read to provision a Target Platform.
The greatest thing about this tool is that it avoids you to manage .target files links to strict versions (e.g., 3.2.5.v20093493-sfoit-v-rrel
). It lets you define the bundles and features you want to use in your target platform and it handles the generation of the .target file with the most recent available version. It is possible to restrict the lookup within a version range.
Add the following p2 repository (update-site) in your update manager (in Eclipse, Help Menu > Install New Software...
, Add...
button on the top right corner)
http://mbarbero.github.com/fr.obeo.releng.targetplatform/p2/
Then, select the “Target Platform Definition DSL and Generator” feature suitable for your current Eclipse version and click on Finish
.
This tool requires Xtext 2.3.0 (released along with Eclipse Juno – 3.8/4.2) or later. If installing on Eclipse 3.6 or 3.7, you may need to add the Juno repository to the available update sites to be able install and/or update Xtext: http://download.eclipse.org/releases/juno/
- Java SE 6
- Eclipse 3.6+ (tested on 3.6, 3.7, 3.8/4.2 and 4.3)
- Xtext 2.3.0+
- Create a file with
.targetplatform
extension
- Once done, right-click on the file and select “Create Target Definition File”
An empty file is a valid file.
Strings can be surrounded by either simple quotes '
or double quotes "
.
You must start by defining the name of your target by specifying the header
target "The name of my target"
Then, you define the locations of your p2 repositories. You can add as many locations as your want to your target. Location string must be URL, if your p2 repository is local, don’t forget to put a file:/
URL.
location "http://download.eclipse.org/releases/juno/" { }
You can define some options (separated with comma) about what should be retrieved from the p2 repository. You can do that with the with
keyword immediatly after the opening curl brace:
location "http://download.eclipse.org/releases/juno/" { with source, allEnvironments }
Available options are:
requirements
, whether this target must have all required IUs of the selected IUs available and included in the target to resolve successfully. If this option is true, the planner will be used to resolve otherwise the slicer is used. The planner can describe any missing requirements as errors.allEnvironments
, whether this target should download and include environment (platform) specific units for all available platforms (vs. only the current target definition’s environment settings). Only supported by the slicer sorequirements
must not be used for this setting to be used.source
, whether this location should download and include source bundles for the selected units if the associated source is available in the repository.configurePhase
, whether this target should execute the configure phase after fetching the selected units.
Then, you may list the Installable Units (IUs) your want to include in your target. This can be Bundles or Eclipse Features (then it ends with feature.group
).
location "http://download.eclipse.org/releases/juno/" { with source, allEnvironments org.eclipse.emf.sdk.feature.group }
If no version specified, the most recent IUs will be selected in the repository. You can restrain the range of version to use by using the same syntax as in MANIFEST.MF
files.
location "http://download.eclipse.org/releases/juno/" { with source, allEnvironments org.eclipse.emf.sdk.feature.group org.eclipse.rcp.feature.group;version="(4.0.0,4.3.0]" }
Then, the most recent version of the given IU within this range will be selected.
Go to fr.obeo.releng.targetplatform-parent
and do a mvn clean package
.
Clone this repository, import all projects in your Eclipse and set your target platform to the one in fr.obeo.releng.targetplatform-parent/targetdefinitions
.
Copyright © 2012, 2013 Obeo. 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