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"

m (Setup an Eclipse instance/installation for building)
(Checkstyle configuration)
(130 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[Category:SMILA]]
+
<br> This HowTo describes the necessary steps for setting up a SMILA development environment.
=== Howto Build and Test Locally ===
+
  
==== Setup an Eclipse instance/installation for building ====
+
==== Preconditions  ====
  
Setting up an own instance is recommended so that no extensions/features u might have installed in ur eclipse instance u use for developing interferes with the build. It probably also makes the build a little faster as the headless start of eclipse takes less time due to fewer plug-ins installed.
+
Here is the list of things that you will definitely need for developing SMILA components:
  
Eclipse 3.4
+
* JDK 1.7
# Download an eclipse SDK, starting with at least [http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.4.1-200809111700/eclipse-SDK-3.4.1-win32.zip eclipse-SDK-3.4.1-win32.zip].
+
* Recent Eclipse SDK - This HowTo was tested with [http://download.eclipse.org/eclipse/downloads/drops4/R-4.2-201206081400/ Eclipse Classic SDK 4.2] (Juno Release) <br>  
# Download [http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.4.1-200809111700/eclipse-3.4.1-delta-pack.zip eclipse-3.4.1-delta-pack.zip].
+
# unzip the archive and copy '''org.eclipse.equinox.executable_<version>''' from features into your features folder under your eclipse installation.
+
# copy all necessary plug-ins (containing linux.x86 or win32.x86) from plugins into your plugins folder under your eclipse installation.
+
# start that eclipse and set up a custom target platform:
+
:* Unzip SMILA-xxx-.zips:
+
:::* Unzip SMILA-incubation-win32.win32.x86.zip into a directory (e.g. E:\ SMILA-incubation-win32.win32.x86). You may download it from [http://demo1.brox.de/smila/daily/SMILA-incubation-win32.win32.x86.zip SMILA-incubation-win32.win32.x86.zip]
+
:::* Unzip Smila-test-and-sample.zip into a directory (e.g. E:\Smila-test-and-sample). You may download it from [http://demo1.brox.de/pipelets/SMILA-test-and-sample.zip SMILA-test-and-sample.zip]
+
:* Copy test specific plug-ins to Smila target platform:
+
:::* Copy org.junit_3.8.2xxx from the “plugins” folder of your eclipse installation or copy org.junit_3.8.2.v200706111738 from Smila-test-and-sample folder to your Smila installation (e.g. E:\ SMILA-incubation-win32.win32.x86/plugins).
+
:::* Copy org.eclipse.smila.test_0.5.0.jar from Smila-test-and-sample folder to your Smila installation (e.g. E:\ SMILA-incubation-win32.win32.x86/plugins).
+
:* Start eclipse and set the target platform location to this folder (e.g. E:\SMILA-incubation-win32.win32.x86).
+
::Click Window --> Preferences --> Plug-in Development --> Target Platform
+
  
 +
==== Getting the source code ====
  
Eclipse 3.3
+
There is more than one way of getting the code into your Eclipse workspace. The following sections will describe how to get the source code via SVN (recommended!).  
# Download an eclipse SDK, starting with at least [http://archive.eclipse.org/eclipse/downloads/drops/R-3.3.2-200802211800/download.php?dropFile=eclipse-SDK-3.3.2-win32.zip eclipse-SDK-3.3.2-win32.zip].
+
# Download [http://archive.eclipse.org/eclipse/downloads/drops/R-3.3.2-200802211800/download.php?dropFile=eclipse-RCP-3.3.2-delta-pack.zip eclipse-RCP-3.3.2-delta-pack.zip].
+
# unzip the archive and copy '''org.eclipse.equinox.executable_<version>''' from features into your features folder under your eclipse installation.
+
# copy all necessary plug-ins (containing linux.x86 or win32.x86) from plugins into your plugins folder under your eclipse installation.
+
# start that eclipse and add sole extension location to WC /SMILA.extension by:
+
:* Menu: Help / Software Updates / Manage configuration
+
:* add extension location and choose the folder SMILA.extension/eclipse from smila project folder
+
  
==== Configuring the Build ====
+
As an alternative, you could download the complete source code from the [http://www.eclipse.org/smila/downloads.php release download page] or the [http://build.eclipse.org/rt/smila/nightly/ nightly build downloads] and unpack the archive into your workspace.  
The folder <tt>SMILA.builder</tt> contains everything needed to build SMILA and/or run all tests locally.  
+
  
Whether u build from command line or from eclipse, in both cases the <tt>make.xml</tt> ant script is executed. Before execution certain properties need to be set to meet the local setup.
+
===== Installing SVN Provider =====
 +
''(skip this section if SVN Team Provider is already installed in your eclipse IDE)''
  
===== Setting the Target Build Platform =====
+
* Install ''Subversive SVN Team Provider'' and ''Subversive SVN JDT Ignore Extensions'' from the Eclipse software repository.<br>
 +
* Restart Eclipse.
 +
* Select ''Windows &gt; Preferences &gt; Team &gt; SVN''. This should open the ''Subversive Connector Discovery'' window.
 +
* Select the Subversive SVN Connector that you wish to use. We suggest to take the latest SVN Kit that is offered. At the time of writing it was SVN Kit 1.3.5.
  
Independent of which way you are going to build, in both cases you must set the <tt>configs</tt> property in  the <tt>build.properties</tt> file to your setup.
+
===== Get source code from SVN =====
  
{|
+
There are two ways for this, automatically by using the ''Project Set File'' or manually. Both are described in the following:  
! Windows
+
| {{Codeblock|<pre>...
+
configs=win32,win32,x86
+
# ... </pre>
+
}}
+
|+
+
! Linux
+
| {{Codeblock|<pre>...
+
configs=linux,gtk,x86
+
# ... </pre>
+
}}
+
|}
+
''Note:
+
:The default is to build for both, windows and linux platforms. However, for this to work locally the eclipse must have the corresponding plugins installed which is usually not the case if you downloaded a platform specific distribution. If platform plugins are missing you will end up on Windows with:
+
  
:<tt>...
+
''Manually checking out and importing the projects into eclipse afterwards:''
:[java] D:\Program Files\eclipse33\eclipse-SDK-3.3.2-win32-smila-build\eclipse\plugins\org.eclipse.pde.build_3.3.2.v20071019\scripts\genericTargets.xml:85: Unable to find plug-in: org.eclipse.core.filesystem.linux.x86_0.0.0. Please check the error log for more details.</tt>
+
* Use your favorite SVN client (''except the eclipse SVN client'') to check out SMILA's source code from the repository located at:<br> <tt>https://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/core</tt>. If you later want to be able to build a SMILA distribution, all SMILA projects should be located in the same directory.
 +
:: <pre>svn co https://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/core</pre>
 +
::'''Note:''' ''The upside of doing so is that you can easily get new projects just by updating your working copy and reimporting the sources into eclipse. Removed projects will be deleted on update. Eclipse will indicate this to the user by displaying an empty project.''
 +
* Import all SMILA project into your workspace:
 +
** Click ''File'' &gt; ''Import'' &gt; ''General'' &gt; ''Existing Projects into Workspace'' &gt; ''Next.''
 +
** Select the folder that contains all SMILA projects --&gt; (all projects should be selected automatically) &gt; ''Finish''.
  
===== Setting Build Properties =====
+
''Automatic checkout and import by using the Project Set File:''
 +
* In eclipse, create an SVN repository location with URL <tt>https://dev.eclipse.org/svnroot/rt/org.eclipse.smila</tt>
 +
* Checkout <tt>trunk/releng</tt>
 +
* Right click on <tt>SMILA.releng/devenv.SMILA-core.psf</tt>
 +
* Click ''Import Project Set...'' and choose "No To All"
 +
::'''Hint:''': ''New projects should always be added to the .psf file so you can import them (as before): right click on .psf file 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. If projects are removed you have to remove them manually from the workspace, this can't be handled via .psf file.''
  
{| border="1" style="font-family:Tahoma, Verdana, Helvetica, sans-serif;font-size:100%;border-color:#CCC;border-collapse:collapse;color:black;" cellspacing="0" cellpadding="5" valign=top
+
After having imported the source code into your workspace, it will show up a lot of errors. Don't worry, they'll disappear after the next steps below.
! Property !! Default !! Comment
+
|-
+
|buildDirectory || <SMILA_HOME>/eclipse.build  ||
+
|-
+
|eclipse.home || <ECLIPSE_HOME>  || the location of the [[#Setup an Eclipse instance/installation for building|eclipse instance]] used to build smila
+
|-
+
|builder || <SMILA_HOME>/SMILA.builder 
+
|-
+
|eclipse.running || true 
+
|-
+
|pdeBuildPluginVersion || 3.4.1.R34x_v20080805 (for 3.4.1) || 3.3.2.v20071019 (for 3.3.2) to change the value go to build.properties file in folder SMILA.builder
+
|-
+
|equinoxLauncherPluginVersion || 1.0.101.R34x_v20080819 (for 3.4.1)  || 1.0.1.R33x_v20080118 (for 3.3.2) to change the value go to build.properties file in folder SMILA.builder
+
|-
+
|os || win32 || rowspan=3 | these merely control under which platform the test will run. It must be one of the [[#Setting the Target Build Platform |target platforms]] you have build.
+
|-
+
|ws || win32 
+
|-
+
|arch || x86 
+
|-
+
|test.java.home || <JAVA_HOME> || a java 1.5 SDK instance
+
|-
+
|}
+
  
 +
==== Defining the target platform  ====
  
For the build from eclipse u pass in these values via the command line text box in the launch config on the command line these are set in a shell script.
+
The target platform defines the set of bundles and features that you are developing against. SMILA ships a ''Target Definition File'' that you can open in your IDE to configure the target platform automatically. This file contains all the references needed for developing SMILA with Eclipse Juno (Release 4.2).
  
==== Executing the make.xml ====
+
===== Using the target platform provided by SMILA =====
  
[[Image:Smila.build.all.png|thumb|right| <tt>all</tt> dependency graph]]
+
* Checkout <tt>../org.eclipse.smila/trunk/releng</tt> (''if you haven't already done before'')
 +
* Open the file <tt>SMILA.releng/devenv/SMILA.target</tt> with the ''Target Definition'' editor. <br>Eclipse starts downloading the referenced bundles/features which it tells you by stating "Resolving Target Definition" in its status bar. Be patient, this will take quite a while. After it has finished, you can click the link "Set as Target Platform" on the top right of the ''Target Definition'' editor. Doing so will cause Eclipse to start re-compiling the sources and all error markers should be gone when finished.
  
The default target is <tt>all</tt>. This will by default build the application and run all unit tests.
+
===== Defining the target platform manually  =====
The [[:image:Smila.build.all.png|dependency graph]] will explain what will happen and shows the relevant targets u may call instead.
+
  
 +
* Instead of using the target definition file provided by SMILA (see above) you can also [[SMILA/Development Guidelines/Howto set up target platform|manually set your own target platform]].
  
===== Executing make.xml from within eclipse =====
+
==== Launching SMILA in Eclipse IDE  ====
# select the SMILA.builder bundle
+
# open External Tools Dialog
+
# create a new ant build configuration or choose your configuration if exists
+
# choose the build file of this bundle, e. g. ${workspace_loc:/SMILA.builder/make.xml}
+
# insert all properties from above into the arguments input field (but adapt these to your setup) but prepend each with <tt>-D</tt> so each is passed into <tt>ant</tt> as a property, e.g.
+
#: -DbuildDirectory=D:/eccenca/SMILA/eclipse.build
+
#: -Declipse.home=D:/eclipse33
+
#: -Dbuilder=D:/eccenca/SMILA/SMILA.builder
+
#: -Declipse.running=true
+
#: -DpdeBuildPluginVersion=3.3.2.v20071019
+
#: -DequinoxLauncherPluginVersion=1.0.1.R33x_v20080118
+
#: -Dos=win32 -Dws=win32 -Darch=x86
+
#: -Dtest.java.home=D:/java/jre1.5.0_11
+
# Apply, close and run SMILA.builder with this external tool configuration
+
  
''Note
+
If you've checked out SMILA's trunk correctly, 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:
: To start another than the default target specify the desired target also in the argument input box.
+
  
===== Executing make.xml from command line =====
+
* Click <span style="font-style: italic;">Run</span>--&gt; ''Debug Configurations'' and expand '''''OSGI Framework'''''<b>.</b>
 +
* Select the ''SMILA'' launch file.
 +
* Click '''Debug'''. <br> If everything works fine, you will get an output in the '''Console''' view similar to the following:
  
The make.bat (or .sh) is just a shell script to set the properties that are needed for the ant script. These files exist only as templates in SVN with <tt>.#~#~#</tt> appended to denote their template nature. Rename it as u see fit, but make.bat (.sh) is already in the svn:ignore to prevent it from beeing committed accidentally, so it is recommended to use that.
+
<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>
  
Steps:
+
==== You're done  ====
# adjust all paths in \SMILA.builder\make.bat according to own setup
+
# execute make.bat
+
  
''Note:
+
Congratulations! You've just successfully checked out and configured your SMILA development environment and you can now start [[SMILA/Development Guidelines/Create a bundle (plug-in)|developing your own bundles]].
: To execute another than the default target just pass it as an argument, like so:
+
:: {{Code|make build}}
+
  
=== Howto Setup Development Environment ===
+
==== Additional steps ====
  
* SVN location
+
The following steps may be needed for special purposes. If you are a SMILA user who only wants to integrate an own component you won't need them.  
*: Until the project leaves incubation status and we are able to move all our sources to our  [https://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk eclipse SVN] this restricted SVN repository is used for daily development (for contributors only): <pre>https://svn.brox.de/svn/eccenca/EILF/trunk</pre>
+
* Eclipse
+
*: Most use an eclipse 3.3 with various plugins according to their choice. See [[#Howto Build and Test Locally|Howto Build and Test Locally]] for a most basic setup.
+
*: An Extension location containing the <tt>EILF.extension/eclipse</tt> is mandatory
+
* see also: [[SMILA/Development Guidelines|Development Guidelines]]
+
  
=== Howto Run junit tests for OSGi bundles ===
+
===== Delta Pack =====
* Plugin Junit Launch config
+
''(only needed for building the software outside of eclipse IDE)''
* write config.ini and ref it from lauch config.
+
 
*:tip: use \ to brake up long lines to have better overview
+
For building the software you may need to add a "Delta Pack" to an Eclipse SDK installation. You can download it from [http://download.eclipse.org/eclipse/downloads/ here] by selecting the corresponding eclipse version that you have in use. After downloading, you can copy the contained plugins and features in your eclipse installation.
* share the launch config
+
 
For further information see: [[SMILA/Development Guidelines|Development Guidelines]]
+
===== Checkstyle configuration =====
 +
 
 +
If you have the [http://eclipse-cs.sourceforge.net/ Eclipse Checkstyle plugin] installed, you will get a lot of error messages complaining about missing check configurations when Eclipse builds the workspace.
 +
 
 +
<source lang="text">
 +
Errors running builder 'Checkstyle Builder' on project 'org.eclipse.smila.utils'.
 +
Fileset from project "org.eclipse.smila.utils" has no valid check configuration.
 +
...
 +
</source>
 +
 
 +
You can solve this by [[SMILA/Development_Guidelines#Checkstyle|setup your Checkstyle configuration]].
 +
 
 +
===== Enabling the BPEL Designer =====
 +
 
 +
If you want to work with the SMILA extensions for Eclipse BPEL designer, you need to check out the bundles from <tt>trunk/tooling</tt>. Currently, the required bundles are:
 +
 
 +
*<tt>org.eclipse.smila.processing.designer.model</tt>
 +
*<tt>org.eclipse.smila.processing.designer.ui</tt>
 +
 
 +
To compile them you need additional bundles from the [http://www.eclipse.org/bpel Eclipse BPEL Designer] in your target platform. See [[SMILA/BPEL Designer]] for more information.
 +
 
 +
 
 +
[[Category:SMILA]]

Revision as of 10:19, 9 April 2013


This HowTo describes the necessary steps for setting up a SMILA development environment.

Preconditions

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

Getting the source code

There is more than one way of getting the code into your Eclipse workspace. The following sections will describe how to get the source code via SVN (recommended!).

As an alternative, you could download the complete source code from the release download page or the nightly build downloads and unpack the archive into your workspace.

Installing SVN Provider

(skip this section if SVN Team Provider is already installed in your eclipse IDE)

  • Install Subversive SVN Team Provider and Subversive SVN JDT Ignore Extensions from the Eclipse software repository.
  • Restart Eclipse.
  • Select Windows > Preferences > Team > SVN. This should open the Subversive Connector Discovery window.
  • Select the Subversive SVN Connector that you wish to use. We suggest to take the latest SVN Kit that is offered. At the time of writing it was SVN Kit 1.3.5.
Get source code from SVN

There are two ways for this, automatically by using the Project Set File or manually. Both are described in the following:

Manually checking out and importing the projects into eclipse afterwards:

svn co https://dev.eclipse.org/svnroot/rt/org.eclipse.smila/trunk/core
Note: The upside of doing so is that you can easily get new projects just by updating your working copy and reimporting the sources into eclipse. Removed projects will be deleted on update. Eclipse will indicate this to the user by displaying an empty project.
  • Import all SMILA project into your workspace:
    • Click File > Import > General > Existing Projects into Workspace > Next.
    • Select the folder that contains all SMILA projects --> (all projects should be selected automatically) > Finish.

Automatic checkout and import by using the Project Set File:

Hint:: New projects should always be added to the .psf file so you can import them (as before): right click on .psf file 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. If projects are removed you have to remove them manually from the workspace, this can't be handled via .psf file.

After having imported the source code into your workspace, it will show up a lot of errors. Don't worry, they'll disappear after the next steps below.

Defining the target platform

The target platform defines the set of bundles and features that you are developing against. SMILA ships a Target Definition File that you can open in your IDE to configure the target platform automatically. This file contains all the references needed for developing SMILA with Eclipse Juno (Release 4.2).

Using the target platform provided by SMILA
  • Checkout ../org.eclipse.smila/trunk/releng (if you haven't already done before)
  • Open the file SMILA.releng/devenv/SMILA.target with the Target Definition editor.
    Eclipse starts downloading the referenced bundles/features which it tells you by stating "Resolving Target Definition" in its status bar. Be patient, this will take quite a while. After it has finished, you can click the link "Set as Target Platform" on the top right of the Target Definition editor. Doing so will cause Eclipse to start re-compiling the sources and all error markers should be gone when finished.
Defining the target platform manually

Launching SMILA in Eclipse IDE

If you've checked out SMILA's trunk correctly, 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 Run--> Debug Configurations and expand OSGI Framework.
  • Select the SMILA launch file.
  • Click Debug.
    If everything works fine, you will get an output in the Console view similar to the following:
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 you can now start developing your own bundles.

Additional steps

The following steps may be needed for special purposes. If you are a SMILA user who only wants to integrate an own component you won't need them.

Delta Pack

(only needed for building the software outside of eclipse IDE)

For building the software you may need to add a "Delta Pack" to an Eclipse SDK installation. You can download it from here by selecting the corresponding eclipse version that you have in use. After downloading, you can copy the contained plugins and features in your eclipse installation.

Checkstyle configuration

If you have the Eclipse Checkstyle plugin installed, you will get a lot of error messages complaining about missing check configurations when Eclipse builds the workspace.

Errors running builder 'Checkstyle Builder' on project 'org.eclipse.smila.utils'.
Fileset from project "org.eclipse.smila.utils" has no valid check configuration.
...

You can solve this by setup your Checkstyle configuration.

Enabling the BPEL Designer

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

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

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

Back to the top