Using Rodin as Target Platform: Difference between revisions

From Event-B
Jump to navigationJump to search
imported>Nicolas
mNo edit summary
imported>Son
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
When developing plug-ins for Rodin, it is somewhat cumbersome to have to download all sources from the SVN repository, or to import them in the workspace somehow, just to be able to read them.
When developing plug-ins for Rodin, it is somewhat cumbersome to have to
Using a target platform is a convenient alternative.
download all sources from the repository, or to import them in the
workspace somehow, just to be able to read them. Using a target platform is a
convenient alternative. Moreover, this alternative allows to validate one's
plugin against a specific version of the Rodin platform and facilitates
regression testing.


== Configuring a Target Platform ==
== Configuring a Target Platform ==


Window > Preferences > Plug-in Development > Target Platform: click "Add..."
Since Rodin 3.0, a software site is provided for each release, the archive is named {{file|org.rodinp.dev-X.Y.Z-<git-commit>.zip}} in the [http://sourceforge.net/projects/rodin-b-sharp/ SourceForge repository].
It contains the full Rodin platform along with sources.


Select "Nothing: Start with an empty target definition".
=== Definition of the Target Platform ===


On the next page, in "Locations" tab, we will add places where Rodin bundles can be found.
In Eclipse, open the Preferences pop-up window by clicking {{Menu|Window>Preferences}}. Then, select {{Menu|Plug-in Development>Target Platform}} in the tree, and click {{Button|Add...}}.


=== Adding a source directory ===
In the Target Definition window that pops up, select {{radio|Nothing: Start with an empty target definition}}, then click {{button|Next >}}.


It is important to add the source directory first, so that javadoc attachment works.
Enter a name for your target platform, for instance {{file|Rodin 3.0}}.  Then, click the {{button|Add...}} button of the {{Menu|Locations}} tab.


Click "Add...", select "Directory" then browse to the directory containing [[Generating source bundles for inclusion in a target platform configuration|Rodin sources generated for inclusion in a Target Platform]] and click "Finish".
In the {{Menu|Add content}} window that pops up, select {{menu|Software Site}}, then click {{button|Next >}}.
In the new page, titled {{menu|Add Software Site}}, click {{button|Add...}}, enter a name, like  {{file|Rodin 3.0}}.
Click {{button|Archive...}} and browse to the location of the {{file|org.rodinp.dev-X.Y.Z-<git-commit>.zip}}.
Click {{button|OK}} then {{button|Finish}}.


This makes Rodin sources available. For instance, pressing F3 on a reference of the IAxiom interface in client code opens an editor that shows the source code in IAxiom.java.
== For Rodin 2.x ==


=== Adding a Rodin installation ===
Releases prior to Rodin 3.0 provided a slightly different way of configuring a target platform.


Click "Add...", select "Installation" then browse to the target Rodin installation directory and click "Finish".
=== Preparation ===


This allows to build a Rodin plug-in, but by itself it is not sufficient to read the sources as a Rodin installation only contains .class files.
To configure a Rodin release as a target platform, first download two files from [https://sourceforge.net/projects/rodin-b-sharp/files/Core_Rodin_Platform/ SourceForge]:
* {{file|rodin-VERSION-dev.zip}}: contains the Rodin platform together with its sources,
* {{file|rodin-VERSION-repo.zip}}: a p2 repository of the full Rodin platform.
 
Then, unpack the {{file|dev}} file somewhere on your hard disk.  There is no need to unpack the {{file|repo}} file anywhere, as Eclipse can process it directly.
 
=== Definition of the Target Platform ===
 
Then, in Eclipse, open the Preferences pop-up window by clicking {{Menu|Window>Preferences}}. Then, select {{Menu|Plug-in Development>Target Platform}} in the tree, and click {{Button|Add...}}.
 
In the Target Definition window that pops up, select {{radio|Nothing: Start with an empty target definition}}, then click {{button|Next >}}.
 
Enter a name for your target platform, for instance {{file|Rodin 2.7}}.  Then, click the {{button|Add...}} button of the {{Menu|Locations}} tab.
 
In the {{Menu|Add content}} window that pops up, select {{menu|Directory}}, then click {{button|Next >}}.  In the new page, titled {{menu|Add Directory}}, enter the location of the directory where you unpacked the {{file|rodin-VERSION-dev.zip}} and click {{button|Finish}}.
 
Back to the {{menu|Target Content}} window, click {{button|Add…}} again.
 
In the {{Menu|Add content}} window that pops up, select {{menu|Software Site}} this time, then click {{button|Next >}}.  In the new page, titled {{menu|Add Software Site}}, click {{button|Add...}}.
 
In the {{Menu|Add Repository}} window that pops up, click {{button|Archive…}} and select the repository file you have downloaded (e.g., {{file|Rodin-2.7-repo.zip}} and click {{button|OK}} until you are back to the {{Menu|Add Software Site}} window. There, untick the {{button|Group by Category}} checkbox, select {{Menu|Rodin Platform}} in the list and click {{button|Finish}} twice.
 
Back to the {{Menu|Preferences}} window, select the Rodin platform you have just added to activate it and click {{button|OK}}.
 
'''Important:''' It is essential to build the target platform in the order given above, otherwise links to source files do not work correctly in Eclipse.
 
=== Complement to the Target Platform ===
 
If you plan to run tests with JUnit, you have to add the JUnit plug-in as a
complement to your target platform.  For that, edit the target platform
definition from the Preferences window and select {{Menu|Features}} in the
{{menu|Add Content}} window.  In the next page, click {{button|Variables...}}
and select {{menu|eclipse_home}}.  Then, select the feature
{{menu|org.eclipse.jdt}} from the list and click {{button|Finish}} twice.
 
[[Category:Developer documentation]]
[[Category:Rodin Platform]]

Latest revision as of 05:58, 24 October 2014

When developing plug-ins for Rodin, it is somewhat cumbersome to have to download all sources from the repository, or to import them in the workspace somehow, just to be able to read them. Using a target platform is a convenient alternative. Moreover, this alternative allows to validate one's plugin against a specific version of the Rodin platform and facilitates regression testing.

Configuring a Target Platform

Since Rodin 3.0, a software site is provided for each release, the archive is named

org.rodinp.dev-X.Y.Z-<git-commit>.zip

in the SourceForge repository.

It contains the full Rodin platform along with sources.

Definition of the Target Platform

In Eclipse, open the Preferences pop-up window by clicking Window>Preferences. Then, select Plug-in Development>Target Platform in the tree, and click Add....

In the Target Definition window that pops up, select

 Nothing: Start with an empty target definition

, then click Next >. Enter a name for your target platform, for instance

Rodin 3.0

. Then, click the Add... button of the Locations tab.

In the Add content window that pops up, select Software Site, then click Next >.

In the new page, titled Add Software Site, click Add..., enter a name, like

Rodin 3.0

. Click Archive... and browse to the location of the

org.rodinp.dev-X.Y.Z-<git-commit>.zip

.

Click OK then Finish.

For Rodin 2.x

Releases prior to Rodin 3.0 provided a slightly different way of configuring a target platform.

Preparation

To configure a Rodin release as a target platform, first download two files from SourceForge:

  • rodin-VERSION-dev.zip
    : contains the Rodin platform together with its sources,
  • rodin-VERSION-repo.zip
    : a p2 repository of the full Rodin platform.

Then, unpack the

dev

file somewhere on your hard disk. There is no need to unpack the

repo

file anywhere, as Eclipse can process it directly.

Definition of the Target Platform

Then, in Eclipse, open the Preferences pop-up window by clicking Window>Preferences. Then, select Plug-in Development>Target Platform in the tree, and click Add....

In the Target Definition window that pops up, select

 Nothing: Start with an empty target definition

, then click Next >. Enter a name for your target platform, for instance

Rodin 2.7

. Then, click the Add... button of the Locations tab. In the Add content window that pops up, select Directory, then click Next >. In the new page, titled Add Directory, enter the location of the directory where you unpacked the

rodin-VERSION-dev.zip

and click Finish.

Back to the Target Content window, click Add… again.

In the Add content window that pops up, select Software Site this time, then click Next >. In the new page, titled Add Software Site, click Add....

In the Add Repository window that pops up, click Archive… and select the repository file you have downloaded (e.g.,

Rodin-2.7-repo.zip

and click OK until you are back to the Add Software Site window. There, untick the Group by Category checkbox, select Rodin Platform in the list and click Finish twice.

Back to the Preferences window, select the Rodin platform you have just added to activate it and click OK.

Important: It is essential to build the target platform in the order given above, otherwise links to source files do not work correctly in Eclipse.

Complement to the Target Platform

If you plan to run tests with JUnit, you have to add the JUnit plug-in as a complement to your target platform. For that, edit the target platform definition from the Preferences window and select Features in the Add Content window. In the next page, click Variables... and select eclipse_home. Then, select the feature org.eclipse.jdt from the list and click Finish twice.