Difference between revisions of "Using Rodin as Target Platform"

From Event-B
Jump to navigationJump to search
imported>Laurent
(Add advantage of this approach)
imported>Laurent
(Overhaul of the procedure with more detailed instructions)
Line 8: Line 8:
 
== Configuring a Target Platform ==
 
== Configuring a Target Platform ==
  
Window > Preferences > Plug-in Development > Target Platform: click "Add..."
+
=== File to Download ===
  
Select "Nothing: Start with an empty target definition".
+
To configure a Rodin release as a target platform, you must first download a
 +
p2 repository of the Rodin platform.  It can be downloaded from SourceForge
 +
and is named {{file|rodin-VERSION-repo.zip}}.
  
On the next page, in "Locations" tab, we will add places where Rodin bundles can be found.
+
=== Definition of the Target Platform ===
  
=== Adding a source directory ===
+
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 : click {{Button|Add...}}.
  
It is important to add the source directory first, so that javadoc attachment works.
+
In the Target Definition window that pops up, select {{radio|Nothing: Start
 +
with an empty target definition}, then click {{button|Next >}}.
  
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]] (rodin-XXX-dev.zip unzipped) and click "Finish".
+
Enter a name for your target platform, for instance {{file|Rodin 2.7}}.
 +
Then, click the {{button|Add...}} button of the {{Menu|Locations}} tab.
  
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.
+
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...}}.
  
=== Adding a Rodin installation ===
+
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|Event-B Modeling Environment}} in the list
 +
and click {{button|Finish}} twice.
  
Click "Add...", select "Installation" then browse to the target Rodin installation directory and click "Finish".
+
Back to the {{Menu|Preferences}} window, select the Rodin platform you have
 +
just added to activate it and click {{button|OK}}.
  
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.
+
=== Complement to the Target Platform ===
  
Alternatively, one can instead add a ''Software Site'', browse to rodin-x.y-repo.zip, then select Rodin Platform (after unchecking 'Group by category').
+
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:Developer documentation]]
 
[[Category:Rodin Platform]]
 
[[Category:Rodin Platform]]

Revision as of 14:35, 15 December 2012

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. 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

File to Download

To configure a Rodin release as a target platform, you must first download a p2 repository of the Rodin platform. It can be downloaded from SourceForge

and is named

rodin-VERSION-repo.zip

.

Definition of the Target Platform

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

In the Target Definition window that pops up, select {{radio|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 Software Site, then click Next >. In the new page, titled Add Software Site, click Add....

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

rodin-2.7-repo.zip

and click {{button|OK} until you are back to the

Add Software Site window. There, untick the Group by Category checkbox, select Event-B Modeling Environment 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.

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.