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:
- Learn how to use a releng project template to quickly get started running headless builds
- Create and configure a releng project to build 18 plugins and features
- Package those plugins and features into a set of zips
Required Materials
- Eclipse 3.4M5
- Eclipse Modeling Framework (EMF) 2.4M5
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
- Switch to the
Plug-in Development perspective, if not already there.
- Select Window
-> Open Perspective -> Other... -> Plug-in Development.
- 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.
- 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
- Switch to the
Plug-in Development perspective, if not already there.
- Select Window
-> Open Perspective -> Other... -> Plug-in Development.
Use the cheat sheet to copy the sources into the Build_Workshop project.
- In the Package Explorer view, right-click and select Import...,
then select General -> Existing Projects into Workspace. Hit Next.
- Choose Select archive file: then Browse... for Build_Workshop/Solution02.zip in your workspace.
- Hit Finish.
Step B: Search & replace template variables
- Rename org.eclipse.
_PROJECTNAMESPACE_.releng to org.eclipse.jet.releng.
- Next, clean up the template so it will work for JET.
- 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
- Find and replace all occurrences in all files of the string "
_PARENTPROJECTNAME_" with your parent project's name.
- Find and replace all occurrences in all files of the string "
_SHORTNAME_" with your project's shortname.
- 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
- 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.
- Edit promoteToEclipse.*.properties. Enter the correct projectName / subprojectName, then name / email address:
projectName=m2t
subprojectName=jet
...
newsgroupPublisherEmail="My Name <me@mydomain.com>"
- Edit buildAll.xml
- 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.
- If necessary, you can manually copy files from the SDK into the other zips (see TODO).
- If necessary, you should remove 3rd party jars used at build time from the zips (see TODO)
- Additional changes may be required. For examples, see these projects:
- Edit builder/*/build.properties to ensure they are configured for the correct JDK version (see TODO)
- Edit builder/*/customTargets.xml:
- Ensure all requirements are downloaded and unpacked as needed (see TODO)
- Edit builder/tests/configs/local/customTest.xml to ensure all requirements are downloaded and unpacked as needed (see TODO)
- Edit builder/tests/configs/local/testing.properties to ensure proper JDK and vmflags are set (see TODOs)
- Edit builder/tests/scripts/test.xml:
- ensure all requirements are downloaded and unpacked as needed (see TODO)
- 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.
- 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".
- 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:
- In the Package Explorer view, right-click and select Import...,
then select Team -> Team Project Set. Hit Next.
- Click Browse... to select the solution_02.psf file in this directory.
Hit OK, then Finish.
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.
