Skip to content

Commit

Permalink
Initial contribution to Eclipse CBI
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbero committed Aug 31, 2018
0 parents commit a35b14c
Show file tree
Hide file tree
Showing 206 changed files with 46,455 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bin/
target
*~
*.rej
*.bak
*.xtendbin
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: java
script: "mvn clean verify -f fr.obeo.releng.targetplatform-parent/pom.xml"
install: true
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
after_failure: echo "=== SUREFIRE REPORTS ===\n" && for F in fr.obeo.releng.targetplatform.tests/target/surefire-reports/*.txt; do echo $F && cat $F && echo; done
142 changes: 142 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
h1. Target Platform Definition DSL and Generator

!https://travis-ci.org/mbarbero/fr.obeo.releng.targetplatform.png?branch=master!:https://travis-ci.org/mbarbero/fr.obeo.releng.targetplatform

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 the links to strict versions (e.g., @3.2.5.v20093493-sfoit-v-rrel@) in @.target@ files. 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.

!http://mbarbero.github.io/fr.obeo.releng.targetplatform/screenshots/editor-outline.png(The targetplatform DSL editor)!

!http://mbarbero.github.io/fr.obeo.releng.targetplatform/screenshots/completion.png(Content assist example)!

h2. Installation

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.io/fr.obeo.releng.targetplatform/p2/* or *http://mbarbero.github.io/fr.obeo.releng.targetplatform/p2/latest/* for the latest version only.

Then, select the _Target Platform Definition DSL and Generator_ feature and click on @Finish@.

bq. This tool requires Xtext 2.7.0 or later. You may need to add the Xtext update site to the list of the available update sites to be able install and/or update Xtext: *http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/*

h3. Requirements

* Java SE 6

* Eclipse 3.7+ (tested on 3.8/4.2 and 4.3)

* Xtext 2.7.0+

h2. Basic usage

* Create a file with @.tpd@ extension

* Once done, right-click on the file and select _Create Target Definition File_. You can also use the the keyboard shortcut @Alt + R@ (@⌥ Alt + R@ on Mac).

* To activate the target platform, you can either use the _Set as Target Platform_ action which is available on right-clicking on a @.tpd@ file, or use the @Ctrl + R@ (@⌘ Cmd + R@ on Mac) keybinding.

!http://mbarbero.github.io/fr.obeo.releng.targetplatform/screenshots/context-menu.png(The right-click command)!

* You can also right-click on an opened file and choose @Validate@, it will look for any error and will also check if all repositories are available and if all specified installation unit are available within the repository (and respecting the version range if any).

!http://mbarbero.github.io/fr.obeo.releng.targetplatform/screenshots/validate-action.png(The right-click validate command)!

!http://mbarbero.github.io/fr.obeo.releng.targetplatform/screenshots/validation-error.png(The validation result)!

h3. Syntax

An empty file is a valid file.

Strings can be surrounded by either simple quotes @'@ or double quotes @"@.

An ID is a character sequence starting with an alpha (no space allowed).

Keywords can be escaped by prefixing them with @^@.

You must start by defining the name of your target by specifying the header.

<pre>
target "The name of my target"
</pre>

Then you can optionally include other target platform files if you decided to split your target platform definition into several files. This will still lead to the generation of a single @.target@ file.

<pre>
include "base.tpd"
include "http://git.some.server.org/tree/tp/all.tpd"
</pre>

You can define some options about what should be retrieved from the p2 repository. You can do that with the @with@ keyword.

<pre>
with source allEnvironments
</pre>

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 so @requirements@ 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.

bq. @source@ and @configurePhase@ are not supported by PDE before 3.8. If you use a version of PDE older than 3.8, these options will simply be ignored.

You can define the environment of your target platform about what should be retrieved from the p2 repository. You can do that with the @environment@ keyword. Content assist is your friend to find proper values.

<pre>
environment linux gtk x86_64
</pre>

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.

<pre>
location "http://download.eclipse.org/releases/kepler/"
</pre>

A location may have an ID that can be written before or after the URI. This is useful if you want to apply some maven stuff (providing a password, a mirror...) for this repository (see "#17":https://github.com/mbarbero/fr.obeo.releng.targetplatform/issues/17 for examples).

<pre>
location kepler "http://download.eclipse.org/releases/kepler/"
</pre>

Then, you may list the Installable Units (IUs) your want to include in your target. This can be _bundles_ or Eclipse _features_ (it may end with @feature.group@).

<pre>
location "http://download.eclipse.org/releases/kepler/" {
org.eclipse.emf.sdk.feature.group
}
</pre>

bq. Don't forget that you can escape a keyword by prefixing it with @^@, e.g. if you need to reference a bundle name @environment@, write it like @^environment@. The @^@ will be automatically stripped during the generation.

If no version is 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.

<pre>
location "http://download.eclipse.org/releases/juno/" {
// select the most recent version of EMF after 2.7.0
org.eclipse.emf.sdk.feature.group 2.7.0
// select the most recent eclipse.rcp feature within the given range
org.eclipse.rcp.feature.group [4.0.0,4.3.0)
}
</pre>

Then, the most recent version of the given IU within this range will be selected.

bq. You can use the special keyword @lazy@ as version to state that you don't want the generator to select the version to put in the @.target@ file. Instead, it puts @0.0.0@ which is interpreted by PDE during the resolution of the @.target@.

h3. Call the generator from the command line

This project provide an Eclipse application that you can launch from the command line. The ID of the application is @org.eclipse.cbi.targetplatform.tpd.converter@ and is provided by the plugin @org.eclipse.cbi.targetplatform@. You can use this app in shell scripts, ant or maven build. If you use Tycho, you may have a look at "this example pom.xml file":https://github.com/hmarchadour/fr.obeo.releng.targetplatform/blob/78e0d470f57bfd82ba6fe7e1c09bfeb2fdfb0180/fr.obeo.releng.targetplatform-parent/targetdefinitions/pom.xml

h2. Build

Go to @fr.obeo.releng.targetplatform-parent@ and do a @mvn clean package@ or @mvn clean verify@.

h2. Contribute

Clone this repository, import all projects in your Eclipse and set your target platform to the one in @fr.obeo.releng.targetplatform-parent/default.target@.

h2. License

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
11 changes: 11 additions & 0 deletions org.eclipse.cbi.targetplatform-feature/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cbi.targetplatform-feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
line.separator=\n
28 changes: 28 additions & 0 deletions org.eclipse.cbi.targetplatform-feature/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>

<p>June 5, 2006</p>
<h3>License</h3>

<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>

<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>

</body>
</html>
17 changes: 17 additions & 0 deletions org.eclipse.cbi.targetplatform-feature/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
################################################################################
# Copyright (c) 2012, 2013 Obeo 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:
# Mikael Barbero (Obeo) - initial API and implementation
################################################################################
bin.includes = epl-v10.html,\
feature.properties,\
feature.xml,\
license.html,\
copyright.txt,\
about.html,\
eclipse32.png
8 changes: 8 additions & 0 deletions org.eclipse.cbi.targetplatform-feature/copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Copyright (c) 2012, 2013 Obeo 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:
Mikael Barbero (Obeo) - initial API and implementation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a35b14c

Please sign in to comment.