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

Difference between revisions of "SMILA/Documentation/HowTo/Howto set up dev environment"

(Doing it manually)
Line 13: Line 13:
 
==== Getting the source code ====
 
==== Getting the source code ====
  
===== Doing it manually =====   
+
There is more than one ways of getting the code into your Eclipse workspace. In the next two sections two recommended ways will be shown. when you're done with the next step the source code will show errors. Don't worry, that will have stopped when you completed this HowTo.
 +
 
 +
Both methods descibed below will lead you to the same result: They will provide you with a workspace containing all core SMILA projects (plus SMILA.releng when you choose the Project Set File).
 +
 
 +
===== Getting the source code manually =====   
 
This is a little more involved than the Project Set File but the recommended practice, especially if you want to update often.
 
This is a little more involved than the Project Set File but the recommended practice, especially if you want to update often.
  
Line 24: Line 28:
 
After you have checked out the source code you need to import it in your IDE:
 
After you have checked out the source code you need to import it in your IDE:
  
Click File --> Import --> General --> Existing Projects into Workspace --> Next --> Select root folder of local trunk --> Finish
+
Click File --> Import --> General --> Existing Projects into Workspace --> Next --> Select root folder of local trunk --> (all projects should be selected automatically) --> Finish
  
===== Project Set File =====
+
===== Using the Project Set File to get the source code =====
This uses a .psf file to import all projects:
+
This uses a .psf file to chek out and import all projects.
 +
 
 +
You have to install a subversion team provider in your eclipse IDE in order to use the Project Set File. We recommend to install the Subversive Team Provider using the from the eclipse repository (you should also install SVN JDT Ignore Extensions).
 +
 
 +
Before you can use the subversive team provider you have to select the SVN connector to use (we suggest that you should take the latest SVN Kit the Subversive Connector Discovery offers to you).
  
 
# Download [https://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/releng/devenv/SMILA-core.psf SMILA-core.psf] file
 
# Download [https://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/releng/devenv/SMILA-core.psf SMILA-core.psf] file
# File --> Import --> Team Project Set
+
# File --> Import --> Team --> Team Project Set
 
# Enter the .psf location
 
# Enter the .psf location
 
# Finish
 
# Finish
 +
 +
Now your IDE starts to download and import the SMILA projects. This will take a while.
 +
 +
'''Hint:'''
 +
''When you want to reimport the psf (e.g. because there are new projects available in the SMILA core repository), you have to update the psf in the SMILA.releng project and import it (right click on it and click on "Import Project Set...", be sure to click "No To All" to the question whether to overwrite existing projects in the workspace, otherwise it will check out everything again instead of ignoring the projects, that are already checked out.''
 +
 +
===== Enabling the BPEL Designer =====
  
 
{{note|
 
{{note|
Line 46: Line 61:
 
The target platform defines the set of bundles and features that you are developing against.  
 
The target platform defines the set of bundles and features that you are developing against.  
  
===== The easy way =====
+
===== Defining the target platform the easy way =====
  
SMILA ships a target definition file at http://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/releng/devenv/SMILA.target that you can open in your IDE (after downloading it or even importing the releng project). This file contains all the references needed for developing SMILA. After opening it, eclipse starts to download the referenced bundles/features which it tells you by stating "resolving target platform" in the status bar. This takes a good while. After it is done you can hit the link "Set as Target Platform" on the top left of the editor. Doing so will cause eclipse to start re-compiling the sources and all error markers should be gone.
+
'''Hint:'''
 +
''This way will enable you develop or use SMILA from within your workspace, but we recommend to use the manual way, so you can build releases, even for target platforms that are different to your platform.''
 +
 
 +
SMILA ships a target definition file at http://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/releng/devenv/SMILA.target that you can open in your IDE (after downloading it or even importing the releng project; if you downloaded the source code using the Project Set File you will already have the SMILA.releng project containing the target definition in your workspace).
 +
 
 +
This file contains all the references needed for developing SMILA. After opening it, eclipse starts to download the referenced bundles/features which it tells you by stating "resolving target platform" in the status bar. This takes a good while. After it is done you can hit the link "Set as Target Platform" on the top left of the editor. Doing so will cause eclipse to start re-compiling the sources and all error markers should be gone.
  
===== Doing it manually =====
+
===== Defining the target platform manually =====
  
 
Instead of using the target definition file you can manually set your own target platform like so:
 
Instead of using the target definition file you can manually set your own target platform like so:
  
Install a plain eclipse SDK and a matching delta pack into a directory. This directory will be referenced as "target" in the following lines.
+
::*Download the eclipse SDK (if you have not already done so) and the <tt>Delta Pack</tt> from the eclipse download page listed in the [[#Preconditions|Preconditions]] section.
 +
::**Please note that it really should be the plain Eclipse SDK to prevent naughty problems from occurring when trying to start SMILA, because of conflicting bundles etc.
 +
::*Extract the SDK in a directory you should name something like <tt>eclipse-target</tt> so you don't confuse it with your IDE's installation folder.
 +
::*Unzip the Delta Pack' contents into the contents of the <tt>eclipse-target</tt> folder, always answer <tt>yes</tt> if the system asks you to confirm overwriting of files.
  
 +
This directory will be referenced as "eclipse-target" in the following lines.
 +
 +
In your IDE do the following:
 
::*Click Window --&gt; Preferences --&gt; Plug-in Development --&gt; Target Platform
 
::*Click Window --&gt; Preferences --&gt; Plug-in Development --&gt; Target Platform
 +
::*Rename the new target, e.g. to "Running target + SMILA.Extension"
 
::*Click Add... --&gt; Select "Nothing: Start with an empty target definition" for target initialization and click "Next"
 
::*Click Add... --&gt; Select "Nothing: Start with an empty target definition" for target initialization and click "Next"
 
::*Click Add... --&gt; Select "Installation" and click "Next"
 
::*Click Add... --&gt; Select "Installation" and click "Next"
::*Click on "browse..." and browse to your "target" directory (SDK + delta pack) --&gt; Click Finish
+
::*Click on "Browse..." and browse to your "eclipse-target" directory (SDK + delta pack) --&gt; Click OK
::*Rename the new target, e.g. to "Running target + SMILA.Extension"
+
::*--&gt; Click Finish in the "Add Installation" window
 
::*Click "Add..." --&gt; Select "Directory" --&gt; Click Next --&gt; Select <tt>SMILA.extension/eclipse/plugins</tt> folder under local trunk as the location --&gt; Click Finish
 
::*Click "Add..." --&gt; Select "Directory" --&gt; Click Next --&gt; Select <tt>SMILA.extension/eclipse/plugins</tt> folder under local trunk as the location --&gt; Click Finish
::*The target definition dialog should now look like this:
+
::*The target definition dialog should now contain the following entries:
 
+
::**Name: <tt>Running target + SMILA.Extension</tt>
[[Image:Target.PNG]]
+
::**In page "Locations" the following entries:
 
+
::***Installation icon with path to your <tt>eclipse-target</tt> directory, showing the number of available plug-ins
 +
::***Directory icon with path to the <tt>SMILA.extension/eclipse/plugins</tt> directory in your checked out SMILA code, showing the number of available plug-ins.
 
::*Change to page "Environment" and select "JavaSE-1.6" as Execution Environment
 
::*Change to page "Environment" and select "JavaSE-1.6" as Execution Environment
::*Click "Finish" and activate the new target platform.
+
::*Click "Finish" and activate the new target platform by checking the box left to its name.
 +
::*Click "OK"
  
{{Note|Note|
+
This will trigger a rebuild of the workspace. Afterwards the errors will have vanished.
* this example is somewhat outdated as it uses the host IDE installation which is not recommended anymore
+
* instead of defining the target platform in the preferences you can also create your own target definition file and go from there which is more convenient.
+
}}
+
  
 
==== Launch SMILA in Eclipse IDE ====
 
==== Launch SMILA in Eclipse IDE ====
Line 78: Line 104:
 
If you've checked out SMILA's trunk correctly, than you should have a project called '''SMILA.launch''' in your workspace. This project contains the SMILA's launch configuration for Eclipse IDE. To start SMILA directly in your Eclipse IDE just follow the steps below:
 
If you've checked out SMILA's trunk correctly, than you should have a project called '''SMILA.launch''' in your workspace. This project contains the SMILA's launch configuration for Eclipse IDE. To start SMILA directly in your Eclipse IDE just follow the steps below:
 
::* Click '''Debug''' --> '''Debug Configurations''' and expand '''OSGI Framework'''
 
::* Click '''Debug''' --> '''Debug Configurations''' and expand '''OSGI Framework'''
::* Select launch file for your environment and press '''Debug'''
+
::* Select '''SMILA''' launch file
[[Image:Launch-smila.png]]
+
::* Check if no junit 4 bundles are activated:
 +
::** enter junit in the filter of the '''Bundles'''
 +
::** uncheck all junit 4 bundles, if they are checked (e.g. org.junit4, org.junit(4.8.2....) etc.) since they conflict with the junit 3 bundles used in SMILA.
 +
::* press '''Debug'''
 
:: <br/>
 
:: <br/>
 
::* If everything is started correctly, you will get an output in the '''Console''' view like below:
 
::* If everything is started correctly, you will get an output in the '''Console''' view like below:
[[Image:Console.png]]
+
<source lang="text">
 +
osgi> Persistence bundle starting...
 +
ProviderTracker: New service detected...
 +
ProviderTracker: Added service org.eclipse.persistence.jpa.osgi.PersistenceProviderOSGi
 +
Persistence bundle started.
 +
[INFO ] Context /zookeeper: Registered handler(1) ZooKeeperAdminHandler, pattern /(.*)$
 +
[INFO ] Added worker webFetcher to WorkerManager.
 +
 
 +
...
 +
 
 +
[INFO ] HTTP server has SMILA handler RequestDispatcher for context /smila.
 +
[INFO ] HTTP server started successfully on port 8080.
 +
</source>
 +
 
 +
==== You're done ====
 +
Congratulations! You've just successfully checked out and configured your SMILA development environment and can now start developing your own bundles.

Revision as of 06:12, 18 January 2012

This how-to describes the necessary steps for setting up SMILA development environment. Normally this setup is only interesting for SMILA committers and contributors. SMILA integrators should work with another setup described at How to set up the integration environment.


Preconditions

Here is the list of things that you will definitely need for developing SMILA components:

  1. JDK 1.6
  2. current Eclipse SDK - This how-to was tested with Eclipse Classic SDK 3.7.1 (Indigo SR1)

Getting the source code

There is more than one ways of getting the code into your Eclipse workspace. In the next two sections two recommended ways will be shown. when you're done with the next step the source code will show errors. Don't worry, that will have stopped when you completed this HowTo.

Both methods descibed below will lead you to the same result: They will provide you with a workspace containing all core SMILA projects (plus SMILA.releng when you choose the Project Set File).

Getting the source code manually

This is a little more involved than the Project Set File but the recommended practice, especially if you want to update often.

Use your favorite SVN client to check out SMILA's source code from repository located at:

http://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/core

Hint: We recommend you to check out the trunk/core as opposed to importing the projects through IDE SVN integrations. By doing so you can easily get new projects just by updating your working copy and reimporting the sources.

After you have checked out the source code you need to import it in your IDE:

Click File --> Import --> General --> Existing Projects into Workspace --> Next --> Select root folder of local trunk --> (all projects should be selected automatically) --> Finish

Using the Project Set File to get the source code

This uses a .psf file to chek out and import all projects.

You have to install a subversion team provider in your eclipse IDE in order to use the Project Set File. We recommend to install the Subversive Team Provider using the from the eclipse repository (you should also install SVN JDT Ignore Extensions).

Before you can use the subversive team provider you have to select the SVN connector to use (we suggest that you should take the latest SVN Kit the Subversive Connector Discovery offers to you).

  1. Download SMILA-core.psf file
  2. File --> Import --> Team --> Team Project Set
  3. Enter the .psf location
  4. Finish

Now your IDE starts to download and import the SMILA projects. This will take a while.

Hint: When you want to reimport the psf (e.g. because there are new projects available in the SMILA core repository), you have to update the psf in the SMILA.releng project and import it (right click on it and click on "Import Project Set...", be sure to click "No To All" to the question whether to overwrite existing projects in the workspace, otherwise it will check out everything again instead of ignoring the projects, that are already checked out.

Enabling the BPEL Designer
Note.png

If you want to work with the SMILA extensions for Eclipse BPEL designer, you need to checkout the bundles from trunk/tooling. Currently these are:

  • org.eclipse.smila.processing.designer.model
  • org.eclipse.smila.processing.designer.ui

To compile these you need bundles from the Eclipse BPEL Designer in your target platform. See SMILA/BPEL_Designer for more information on these bundles.



Define target platform

The target platform defines the set of bundles and features that you are developing against.

Defining the target platform the easy way

Hint: This way will enable you develop or use SMILA from within your workspace, but we recommend to use the manual way, so you can build releases, even for target platforms that are different to your platform.

SMILA ships a target definition file at http://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/releng/devenv/SMILA.target that you can open in your IDE (after downloading it or even importing the releng project; if you downloaded the source code using the Project Set File you will already have the SMILA.releng project containing the target definition in your workspace).

This file contains all the references needed for developing SMILA. After opening it, eclipse starts to download the referenced bundles/features which it tells you by stating "resolving target platform" in the status bar. This takes a good while. After it is done you can hit the link "Set as Target Platform" on the top left of the editor. Doing so will cause eclipse to start re-compiling the sources and all error markers should be gone.

Defining the target platform manually

Instead of using the target definition file you can manually set your own target platform like so:

  • Download the eclipse SDK (if you have not already done so) and the Delta Pack from the eclipse download page listed in the Preconditions section.
    • Please note that it really should be the plain Eclipse SDK to prevent naughty problems from occurring when trying to start SMILA, because of conflicting bundles etc.
  • Extract the SDK in a directory you should name something like eclipse-target so you don't confuse it with your IDE's installation folder.
  • Unzip the Delta Pack' contents into the contents of the eclipse-target folder, always answer yes if the system asks you to confirm overwriting of files.

This directory will be referenced as "eclipse-target" in the following lines.

In your IDE do the following:

  • Click Window --> Preferences --> Plug-in Development --> Target Platform
  • Rename the new target, e.g. to "Running target + SMILA.Extension"
  • Click Add... --> Select "Nothing: Start with an empty target definition" for target initialization and click "Next"
  • Click Add... --> Select "Installation" and click "Next"
  • Click on "Browse..." and browse to your "eclipse-target" directory (SDK + delta pack) --> Click OK
  • --> Click Finish in the "Add Installation" window
  • Click "Add..." --> Select "Directory" --> Click Next --> Select SMILA.extension/eclipse/plugins folder under local trunk as the location --> Click Finish
  • The target definition dialog should now contain the following entries:
    • Name: Running target + SMILA.Extension
    • In page "Locations" the following entries:
      • Installation icon with path to your eclipse-target directory, showing the number of available plug-ins
      • Directory icon with path to the SMILA.extension/eclipse/plugins directory in your checked out SMILA code, showing the number of available plug-ins.
  • Change to page "Environment" and select "JavaSE-1.6" as Execution Environment
  • Click "Finish" and activate the new target platform by checking the box left to its name.
  • Click "OK"

This will trigger a rebuild of the workspace. Afterwards the errors will have vanished.

Launch SMILA in Eclipse IDE

If you've checked out SMILA's trunk correctly, than you should have a project called SMILA.launch in your workspace. This project contains the SMILA's launch configuration for Eclipse IDE. To start SMILA directly in your Eclipse IDE just follow the steps below:

  • Click Debug --> Debug Configurations and expand OSGI Framework
  • Select SMILA launch file
  • Check if no junit 4 bundles are activated:
    • enter junit in the filter of the Bundles
    • uncheck all junit 4 bundles, if they are checked (e.g. org.junit4, org.junit(4.8.2....) etc.) since they conflict with the junit 3 bundles used in SMILA.
  • press Debug

  • If everything is started correctly, you will get an output in the Console view like below:
osgi> Persistence bundle starting...
ProviderTracker: New service detected...
ProviderTracker: Added service org.eclipse.persistence.jpa.osgi.PersistenceProviderOSGi
Persistence bundle started.
[INFO ] Context /zookeeper: Registered handler(1) ZooKeeperAdminHandler, pattern /(.*)$
[INFO ] Added worker webFetcher to WorkerManager.
 
...
 
[INFO ] HTTP server has SMILA handler RequestDispatcher for context /smila.
[INFO ] HTTP server started successfully on port 8080.

You're done

Congratulations! You've just successfully checked out and configured your SMILA development environment and can now start developing your own bundles.

Back to the top