Exercise 02: Build Releng Project From Template

What This Exercise Is About

Using a template, create a releng project for running automated builds with PDE Build. Then, customize that builder to create another zip bundle.


What You Should Be Able To Do

At the end of the lab, you should be able to:

Required Materials

Exercise Instructions

This exercise is carried out entirely using the Eclipse Software Development Kit (SDK) version 3.4M5 with the Eclipse Modeling Framework (EMF) 2.4M5 installed into it. The exercise instructions refer to this product as either Eclipse or as "the workbench."

These instructions are located in your workspace, in the Build_Workshop/Exercise02_BuildRelengProject folder.

The solutions to this exercise can be installed using the cheat sheet.


Directions

Step A: Method 1 - Check out the template project from CVS

  1. Switch to the Plug-in Development perspective, if not already there.
    1. Select Window -> Open Perspective -> Other... -> Plug-in Development.
  2. In the Package Explorer view, right-click the file Build_Workshop\Exercise02_BuildRelengProject\exercise_02.psf and select Import..., then select Team -> Team Project Set. Hit Next.
  3. If not already selected, click Browse... to select the exercise_02.psf file in this directory. Hit OK, then Finish.

Step A: Method 2 - Import from existing projects using cheat sheet

  1. Switch to the Plug-in Development perspective, if not already there.
    1. Select Window -> Open Perspective -> Other... -> Plug-in Development.
  2. Cheat Use the cheat sheet to copy the sources into the Build_Workshop project.
  3. In the Package Explorer view, right-click and select Import..., then select General -> Existing Projects into Workspace. Hit Next.
  4. Choose Select archive file: then Browse... for Build_Workshop/Solution02.zip in your workspace.
  5. Hit Finish.

Step B: Search & replace template variables

  1. Rename org.eclipse._PROJECTNAMESPACE_.releng to org.eclipse.jet.releng.
  2. Next, clean up the template so it will work for JET.
    1. Find and rename all files with _SHORTNAME_ in their name, using the project's shortname
      • promoteToEclipse._SHORTNAME_.properties
      • templateFiles/_SHORTNAME_.map.template
      • maps/_SHORTNAME_.map
    2. Find and replace all occurrences in all files of the string "_PARENTPROJECTNAME_" with your parent project's name.
    3. Find and replace all occurrences in all files of the string "_SHORTNAME_" with your project's shortname.
    4. Find and replace all occurrences in all files of the string "_PROJECTNAMESPACE_" with your project's namespace. For JET, this is the same as shortname, that is
        org.eclipse._PROJECTNAMESPACE_ -> org.eclipse.jet
    
  3. Finally, go through the files looking for TODO markers, and update the scripts as per those instructions (as applicable).

Step C: Customize template

Next, you need to customize the template for your project's specific needs. Many of the steps below will only require your review, but no actual changes.

  1. Edit promoteToEclipse.*.properties. Enter the correct projectName / subprojectName, then name / email address:
  2. projectName=m2t
    subprojectName=jet
      ...
    newsgroupPublisherEmail="My Name <me@mydomain.com>"
    
  3. Edit buildAll.xml
    1. Ensure that if you are properly configured for the JDK you require (1.4, 5.0) (see TODO markers in files). JET 0.9.0 requires JDK 5.0.
    2. If necessary, you can manually copy files from the SDK into the other zips (see TODO).
    3. If necessary, you should remove 3rd party jars used at build time from the zips (see TODO)
    4. Additional changes may be required. For examples, see these projects:
  4. Edit builder/*/build.properties to ensure they are configured for the correct JDK version (see TODO)
  5. Edit builder/*/customTargets.xml:
  6. Ensure all requirements are downloaded and unpacked as needed (see TODO)
  7. Edit builder/tests/configs/local/customTest.xml to ensure all requirements are downloaded and unpacked as needed (see TODO)
  8. Edit builder/tests/configs/local/testing.properties to ensure proper JDK and vmflags are set (see TODOs)
  9. Edit builder/tests/scripts/test.xml:
    1. ensure all requirements are downloaded and unpacked as needed (see TODO)
    2. ensure if your test plugin is jarred you (un)comment out the appropriate lines (see TODOs)

Step D: Creating a new zip bundle

JET publishes an SDK and runtime, but also a separate zip for the JET Editor. In this step, you'll add a new builder for that feature & its zip.

  1. Copy the two files in org.eclipse.jet.releng/builder/sdk/* into a new folder called org.eclipse.jet.releng/builder/editor. Replace occurences of "SDK" with "editor".
  2. Add a new task to buildAll.xml to call this builder. Order is not crucial, but in the solution this is done after examples and before tests.

Step E: Verify your solution

To see the completed solution:

  1. In the Package Explorer view, right-click and select Import..., then select Team -> Team Project Set. Hit Next.
  2. Click Browse... to select the solution_02.psf file in this directory. Hit OK, then Finish.
  3. Cheat If you prefer, you can instead use Import... -> General -> Existing Projects into Workspace, then Browse... for the Build_Workshop/Solution02_BuildRelengProject/org.eclipse.jet.releng folder, as in Step A: Method 2.
  • In the Package Explorer, select both your org.eclipse.jet.releng and the new org.eclipse.jet.releng_SOLUTION project, then right-click and select Compare With -> Each Other. Note any differences.

  • Using Beyond Compare 3 beta (aka "Cirrus") to show file/folder differences


    Summary

    You have learned how to create a releng project. Now it's time to take a look at how to run a build.