Jump to: navigation, search

Difference between revisions of "Developing Tycho"

(Added hints for troubleshooting build errors after import)
m (Avoid overloaded term "Tycho project")
Line 12: Line 12:
 
* In EGit, open the '''Git Repositories''' view, select '''Clone a Git Repository''' and clone from the location https://github.com/sonatype/sonatype-tycho.git
 
* In EGit, open the '''Git Repositories''' view, select '''Clone a Git Repository''' and clone from the location https://github.com/sonatype/sonatype-tycho.git
 
* In a shell (e.g. from [http://code.google.com/p/msysgit/ msysgit] or [http://cygwin.com/ Cygwin]), execute <tt>git clone git://github.com/sonatype/sonatype-tycho.git</tt>
 
* In a shell (e.g. from [http://code.google.com/p/msysgit/ msysgit] or [http://cygwin.com/ Cygwin]), execute <tt>git clone git://github.com/sonatype/sonatype-tycho.git</tt>
<li> In Eclipse, use '''File > Import > Existing Maven Projects''' and the <tt>sonatype-tycho/tycho-p2-resolver</tt> and <tt>sonatype-tycho/</tt> directories. (The two imports are necessary because there is no POM that aggregates all Tycho projects.) Install the proposed project configurators and restart Eclipse after the second import.
+
<li> In Eclipse, use '''File > Import > Existing Maven Projects''' and the <tt>sonatype-tycho/tycho-p2-resolver</tt> and <tt>sonatype-tycho/</tt> directories. (The two imports are necessary because there is no POM that aggregates all Tycho modules.) Install the proposed project configurators and restart Eclipse after the second import.
 
<li> Optional: Select all projects, right click and choose '''Team > Share Project > Git'''
 
<li> Optional: Select all projects, right click and choose '''Team > Share Project > Git'''
 
<li> The result should be an eclipse workspace without build errors. m2eclipse may take some time to download required libraries to the local repo.
 
<li> The result should be an eclipse workspace without build errors. m2eclipse may take some time to download required libraries to the local repo.

Revision as of 06:48, 19 July 2011

Tycho requires a current version of m2eclipse (0.13.0 or later) in order to import the Tycho sources into Eclipse.

Here is the step by step approach assuming you use a Windows OS:

  1. Get an Indigo version of Eclipse
  1. Install the following additional software into Eclipse:
  2. Install Maven version 3.0 or later
  3. Window > Preferences > Maven > Installations > Add... and add your maven 3 installation, activate it
  4. Get the sources from Github; there are different ways to do this:
  5. In Eclipse, use File > Import > Existing Maven Projects and the sonatype-tycho/tycho-p2-resolver and sonatype-tycho/ directories. (The two imports are necessary because there is no POM that aggregates all Tycho modules.) Install the proposed project configurators and restart Eclipse after the second import.
  6. Optional: Select all projects, right click and choose Team > Share Project > Git
  7. The result should be an eclipse workspace without build errors. m2eclipse may take some time to download required libraries to the local repo.

If there are build errors after import, you can try the following steps to work around caching issues in the PDE:

  1. Refresh all projects. A jars folder should show up in both org.eclipse.tycho.surefire.junit and org.eclipse.tycho.surefire.osgibooter.
  2. For the projects starting with "org.eclipse.tycho.surefire", select Maven > Update Project Configuration from the context menu. This should add a Referenced Libraries classpath container referencing the libraries in projects' jars folders (where available).
  3. Remove the Plug-in Dependencies classpath containers on the projects starting with "org.eclipse.tycho", and re-create them via the context menu PDE Tools > Update Classpath.... After this step, the Plug-in Dependencies classpath containers should also contain projects from the workspace.

In order to build Tycho from the command line, you should use the scripts in the root of the sources:

  1. Edit bootstrap.cmd in the sonatype-tycho/ root directory and adapt the variables TYCHO_TEST_TARGET_PLATFORM -> point to Eclipse SDK 3.7.0 plus delta pack, TYCHO_M2_HOME -> point to maven 3 home directory
  2. If you want to skip long-running integration tests, comment out line mvn -f tycho-its\pom.xml clean test
  3. Execute .\bootstrap.cmd

Executing integration tests in Eclipse

It is possible to start the integration tests directly from Eclipse. Note however that you will still need to build Tycho through a mvn install whenever you have made changes to the Tycho code, e.g. using the bootstrap.cmd as described above. (Background: The integration tests trigger builds of test projects -- and these builds take Tycho from it's normal location, i.e. the local Maven repository.)

Tips:

  • The integration test builds use the settings stored in tycho-its/settings.xml (they don't use the default Maven settings.xml). If you have special requirements, e.g. for proxy settings, you can edit this file. Alternatively, you can point to a different settings.xml with the system property tycho.testSettings.