The Teiid Designer project is a set of Eclipse-based features and plugins. Therefore, Teiid Designer runs within the Eclipse runtime platform. Teiid Designer can also be developed using the Eclipse IDE. This document describes how to setup an Eclipse IDE for Teiid Designer development, maintainence, and testing.
Teiid Designer currently uses Subversion (SVN) for source code management. Follow these steps to check out the latest (trunk) Teiid Designer source code for the first time:
- Create directory where you want to put the Teiid Designer code. For example, mkdir ~/projects/teiid-designer.
- Create a directory within the directory you created in the previous step. I usually call the directory trunk as that is what SVN calls it. For example, mkdir ~/projects/teiid-designer/trunk.
- At a command-line prompt, change directory to the trunk directory. For example, cd ~/projects/teiid-designer/trunk.
- Issue one of these commands:
- For committer trunk (login required): "svn co https://svn.jboss.org/repos/tdesigner/trunk .", or
- For anonymous trunk: "svn co http://anonsvn.jboss.org/repos/tdesigner/trunk .".
When you need to work with source code branches, just follow steps 2 through 4 again for the specific branch you will be working with.
If you need to install Eclipse to use as your IDE you can download it here: Eclipse Downloads. Make sure you download a version that has the PDE (Plugin Devellopment Environment) feature.
After starting up the Eclipse IDE for the first time there a few things we need to do:
- make sure the correct JRE is installed,
- install Teiid Designer preferences,
- install target platform,
- install SVN and create SVN repositories, and
- import Teiid Designer projects.
In Eclipse preferences, make sure that:
- the installed JRE should is set to 1.6 (Preferences -> Java -> Installed JREs), and
- the Java compiler compliance level is set to 1.6 (Preferences -> Java -> Compiler -> Compiler compliance level).
If you don't have JRE 1.6 you can download one here: Java SE Downloads.
Make sure you have checked-out the Teiid Designer source code.
The Teiid Designer Eclipse IDE preferences are stored in the eclipse-preferences.epf file found in the trunk directory we checked out from SVN (see Check It Out). Import this file using File -> Import... -> General -> Preferences. These preferences help ensure we maintain better coding standards and minimize the differences between changes made by committers and previous code versions.
The Eclipse Target Platform is used to compile and test the Teiid Designer plug-ins against. This platform consists of the Eclipse runtime binaries for your operating system, any additional Eclipse features, and any required 3rd-party features and plug-ins. In the case of Teiid Designer, these additional Eclipse features are required: the Eclipse Modeling Framework (EMF), Unified Modeling Language 2.0 (UML2), Eclipse Graphical Editing Framework (GEF), Eclipse Data Tools Project (DTP), and the Eclipse Web Tools Platform (WTP).
One way to create the target platform is to define it manually. Manually creating the target platform requires you to install another Eclipse and install in that version all the required features and plugins needed. An alternative to manually creating the target platform is to use a target definition file from the JBoss Tools (JBT) project. The JBT target definition already has the correct version of the Eclipse runtime and all the required additional features and plug-ins to match the release or product Teiid Designer is being developed for.
Eclipse documentation states that "A target definition file specifies all aspects of a target - including its location, constituent plug-ins and environment." JBoss Tools, the parent project of Teiid Designer, contains several target platform definition files that it uses to perform the various builds of products and releases. These target definition files are found in the JBoss Tools source code repository. Using one of these target definition files as your Teiid Designer target platform ensures the target platform you are developing and testing against, agrees with the target platform JBoss Tools is going to use. To use a JBoss Tools target platform definition file, follow these steps:
- Create directory where you want to put the JBoss Tools code. For example, mkdir ~/projects/jboss-tools/trunk/build.
- At a command-line prompt, change directory to the trunk directory. For example, cd ~/projects/jboss-tools/trunk/build.
- Issue one of these commands:
- For committer trunk (login required): "svn co https://svn.jboss.org/repos/jbosstools/trunk/build .", or
- For anonymous trunk: "svn co http://anonsvn.jboss.org/repos/jbosstools/trunk/build/ .".
- Back in your Eclipse IDE, import the JBoss Tools "jboss-trunk-build" project into your workspace by selecting File -> Import... -> Existing projects into workspace and selecting the single project located in the directory from step 1.
- The target definition files are located in the "jboss-trunk-build" project under the "target-platform" directory.
- In Preferences -> Plug-in Development -> Target Platform select the appropriate target platform. The "unified.target" file is a good one to use.
To create a target platform manually, use the following steps:
- Download and install the Eclipse IDE for Java EE Developers in the directory of your choosing. For instance, mkdir ~/target-platforms/eclipse3.7.2. Yes this is a different installation of Eclipse than the one installed earlier.
- Run this new installation of Eclipse and select Help -> Install New Software.
- Select http://download.eclipse.org/releases/indigo (replace "indigo" with the release name of the target platform Eclipse runtime) n the Work with: drop-down.
- Under Database Development select both "Extender SDK's."
- Under Modeling select the following:
a) EMF - Eclipse Modeling Framework SDK
b) Graphical Editing Framework GEF SDK
c) UML2 Extender SDK
d) XSD - XML Schema Definition SDK
- Under Web, XML, Java EE and OSGi Development select the following:
a) Eclipse Jave Web Developer Tools
c) JST Server UI
d) WST Server Adapters
- Click Next -> Next, accept the licensing terms, and click Next -> Finish to finish the Install wizard.
- When prompted, restart Eclipse so that all these new plugins will be installed.
- Now, exit this version of Eclipse.
- Back in your Eclipse IDE, select Preferences -> Plug-in Development -> Target Platform and click Add... to create a new target definition.
- Choose Nothing: Start with an empty target definition in the New Target Definition wizard and click Next >.
- On the Locations tab, click Add..., select Directory, then Next >, and browse to the directory of where you installed the target platform Eclipse in the first step. If you selected the correct directory (where the command to run Eclipse is located), then all this target platform's will load and show.
- Click Finish and select this new target platform as the active/default target platform.
Teiid Designer uses Subversion (SVN) as its source code management system. In order to work with SVN from within the IDE you must install the SVN plugins and create the SVN source code repositories. Here are the steps:
- Install the SVN plugins by running Help -> Install New Software.
- Select http://download.eclipse.org/releases/indigo (replace "indigo" with the release name of the Eclipse runtime) n the Work with: drop-down.
- Under Collaboration select Subversive SVN Team Provider and Subversive JDT Ignore Extensions.
- Click Next -> Next, accept licensing terms, and click Next -> Finish to finish the Install wizard.
- When prompted, restart your Eclipse IDE.
- When Eclipse restarts you might be asked to select an SVNKit. Select the latest, compatible one for the target platform.
- In Eclipse, open the SVN repositories view by running Window -> Show View -> Other -> SVN -> SVN Repositories.
- Create a new repository by using one of these URLs:
Make sure you have setup your Teiid Designer SVN repository before importing the Teiid Designer projects.
Once you've checked out Teiid Designer source code, you are ready to import those projects. Follow these steps to get the Teiid Designer projects into your Eclipse workspace:
- Run File -> Import... -> Existing projects into workspace.
- Select the root directory where you have put the projects. For example, ~/projects/teiid-designer/trunk.
- The Projects list should be filled up. Deselect any projects that are found in the "depcrecated" directory and press Finish to get all of the projects into your Eclipse workspace.
- Perform a full build of all projects if you need to.
If you ever update or checkout files from the command-line you will need to Refresh your Eclipse workspace.
Under Run -> Run Configurations ..., you will find predefined launch configurations for the different platforms (Mac, Linux, and Windows). Select the appropriate launcher and Run. Once Eclipse starts, there will be a Designer perspective available to open.