| <HTML> |
| <HEAD> |
| <TITLE>Automating Product Builds with PDE BUILD</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> |
| </HEAD> |
| |
| <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> |
| <P><FONT SIZE="+3"> Automating Builds with PDE BUILD</FONT><BR></P><P>Last Updated: |
| June16, 2005</P><P><FONT SIZE="+1"><A HREF="#intro">Introduction</A></FONT></P><P><FONT SIZE="+1"><A HREF="#preparation">Preparing |
| the infrastrucure</A></FONT></P><UL><LI><A HREF="#commit">Commit feature and plug-in |
| projects to CVS repository</A></LI><LI><A HREF="#createmap">Create map file project</A></LI><LI><A HREF="#gensource">Set |
| up auto-generation of source features and plug-ins</A></LI></UL><P><FONT SIZE="+1"><A HREF="#buildconfigfiles">Preparing |
| Build Configuration Files</A> </FONT></P><UL> <LI><A HREF="#build.properties">Write |
| build.properties</A></LI><LI><A HREF="#customTargets.xml">Write customTargets.xml</A></LI></UL><P><FONT SIZE="+1"><A HREF="#buildexec"> |
| Build Execution</A></FONT></P><UL> <LI><A HREF="#buildmachinesetup">Set up build |
| machine</A></LI><LI><A HREF="#runbuild">Running the build</A></LI></UL><P> </P><HR><P><FONT SIZE="+2"><B><A NAME="intro"></A>Introduction</B></FONT></P><P>This |
| document describes how to automate the building of Eclipse-based features and |
| their plug-ins using script generators in the org.eclipse.pde.build plug-in in |
| Eclipse 3.2 stream SDK.<BR> </P><P>Either an existing Eclipse 3.2 stream SDK or |
| the org.eclipse.releng.basebuilder project on dev.eclipse.org:/home/eclipse can |
| be used in this automated build process. The org.eclipse.releng.basebuilder project |
| contains the minimal set of plug-ins extracted from the latest stable Eclipse |
| 3.2 stream SDK build (a milestone or release) needed to run applications and custom |
| Ant tasks in org.eclipse.ant.core, org.eclipse.pde.build, org.eclipse.pde, and |
| org.eclipse.help.base. This project is used by the Eclipse release engineering |
| team to build Eclipse itself. <P>It is assumed the reader is starting with a set |
| of pre-existing features and plug-ins, their build.properties, and has a working |
| knowledge of Apache Ant. In this document, features, plug-ins and fragments are |
| also referred to as "elements". The word "distribution" is |
| used to describe the end result of building a feature, a functional unit comprised |
| of one or more groupings of plug-ins. The result of building a feature results |
| in a zip or tar.gz file which contains the binary version of the feature and it's |
| plug-ins. If the feature contains nested features (i.e. <includes> elements), |
| the nested features will be built recursively and included in the distribution.<br> |
| <br> For example, the Eclipse SDK distributions are built from the <a href="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.sdk-feature/feature.xml?rev=1.7" target="extra">org.eclipse.sdk |
| feature</a> which is comprised of features org.eclipse.rcp, org.eclipse.rcp.source, |
| org.eclipse.platform, org.eclipse.platform.source, org.eclipse.jdt, org.eclipse.jdt.source, |
| org.eclipse.pde, org.eclipse.pde.source and the org.eclipse.sdk plug-in. The distribution |
| built from the org.eclipse.sdk feature will therefore contain the binary version |
| of the org.eclipse.sdk feature and its one plug-in plus the binary versions of |
| its eight nested features and all their plug-ins.<br> <br> <HR><P><FONT SIZE="+2"><B><A NAME="preparation"></A>Preparing |
| the infrastructure</B></FONT></P><P><B><FONT SIZE="+1" COLOR="#000000"><A NAME="commit"></A>Commit |
| feature and plug-in projects to CVS repository</FONT></B></P><P>Since Eclipse |
| 3.0, PDE Build allows a very flexible organization of feature, plug-in and fragment |
| projects in a CVS repository where:</P><UL> <LI> the directory containing the |
| source for an element can exist as a root level CVS module or in any subdirectory |
| in the repository.</LI><LI>the directory name containing the element's source |
| does not have to match the id attribute in it's manifest (feature.xml, plugin.xml, |
| fragment.xml).</LI></UL><P>This flexibility was not present for the Eclipse process |
| prior to version 3.0 which is one reason for the very flat organization of projects |
| in the dev.eclipse.org:/home/eclipse repository. It is recommended that this flat |
| structure <B>not</B> be used as an example. Rather, using a structure similar |
| to the one used for the <A HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.equinox/?cvsroot=Technology_Project" target="extra">Equinox</A> |
| or <A HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.stellation/?cvsroot=Technology_Project" target="extra" >Stellation</A> |
| project should be considered where all files and directories for a given product |
| are stored under a single directory or module at the cvs root level:<BR><BR><cvs |
| root><BR><BR> /org.eclipse.equinox<BR><BR> /plugins<BR><BR> /all |
| plug-ins at this level<BR> </P><P>Once |
| the source for all elements is committed to a repository, the next step consists |
| of recording the location and access method for each feature, plug-in and fragment |
| in one or more <A HREF="#createmap">map files</A>.</P><P> </P><P><B><FONT SIZE="+1"><A NAME="createmap"></A>Create |
| map file project</FONT></B></P><P>A .map file is a java property file which contains |
| mappings of elements to their CVS locations and access methods. Map files are |
| used by PDE Build early in the build process to generate Ant scripts which use |
| the Ant <cvs> task to export source to a directory. This is described further |
| <A HREF="#getmaps">below</A>.<BR> <BR>Map file entries use the following format:<BR><BR> |
| <B>feature|fragment|plugin@element.Id=<cvs tag>,<access method>:<cvs |
| user>@<cvs repository>,<cvs password>[,<repository path> |
| (no starting slash) ]</B><BR> </P><P>The <repository path> is only required |
| when the module (or directory) containing the source for the element does not |
| match the element.Id or if the directory is not at the root of the repository.<BR> |
| <BR>A map file entry must exist for each feature being built, it's <plugin> |
| elements and it's <includes> elements (ie. nested features and their plug-ins). |
| Adding a plug-in or fragment to a feature therefore requires updating the map |
| files with the new element.<BR><BR><BR><B>Map File Entry Examples</B></P><UL><LI>The |
| org.eclipse.platform plug-in source is located at the root of the <A HREF="http://dev.eclipse.org/viewcvs/" target="extra">dev.eclipse.org:/home/eclipse</A> |
| repository. It is contained in a directory with the name "org.eclipse.platform". |
| The resulting map file entry for this plug-in is:<BR><BR>plugin@org.eclipse.platform=v20031121,:pserver:anonymous@dev.eclipse.org:/home/eclipse,<BR><BR></LI><LI>The |
| org.eclipse.platform feature source is located at the root of the <A HREF="http://dev.eclipse.org/viewcvs/" target="extra">dev.eclipse.org:/home/eclipse</A> |
| repository in a directory with the name "org.eclipse.platform-feature". |
| The resulting map file entry for this feature is:<BR><BR>feature@org.eclipse.platform=v20031128,:pserver:anonymous@dev.eclipse.org:/home/eclipse,,org.eclipse.platform-feature<BR><BR></LI><LI>The |
| org.eclipse.gef.sdk feature source is located in directory in the <A HREF="http://dev.eclipse.org/viewcvs/?cvsroot=Tools_Project" target="extra">dev.eclipse.org:/home/tools</A> |
| repository in a subdirectory called "org.eclipse.gef.sdk" of "org.eclipse-gef |
| feature". The resulting map file entry for this feature is:<BR><BR>feature@org.eclipse.gef.sdk=I_20031117, |
| :pserver:anonymous@dev.eclipse.org:/home/tools,,org.eclipse.gef-feature/org.eclipse.gef.sdk<BR></LI></UL><P>One |
| or more map files can be used to list the elements. The map files can be kept |
| under version control. Some examples of map file projects include <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/">org.eclipse.releng</A>, |
| <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gef.releng/?cvsroot=Tools_Project">org.eclipse.gef.releng</A>, |
| <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ve.releng/?cvsroot=Tools_Project">org.eclipse.ve.releng</A>.<BR> |
| <BR></P><P><B><FONT SIZE="+1"><A NAME="gensource"></A>Generating source features |
| and plug-ins at build time</FONT></B></P><P>Source features and plug-ins can be |
| generated at build time by PDE Build. Source features and associated source plug-ins |
| are typically generated for a development kit distributions (i.e. SDK). It is |
| also possible to generate a source plug-in only. This is typically the case for |
| example features or JUnit testing features.<BR> <BR>To generate a <B>source feature |
| and associated source plug-in</B> at build time, you will need to do the following:</P><OL> |
| <LI> Add an entry to the build.properties file in the feature project for which |
| you wish to include the source feature and plug-in. The generated source feature |
| should also be listed in the feature.xml as an <includes> element.<BR> <BR> |
| The build.properties entry should use the following format:<BR> <BR> generate.feature@<source.feature.id |
| to generate>=<feature.id from which to which to collect source>, plugin@<plugin.id><BR> |
| <BR> Example taken from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.sdk-feature/build.properties?rev=1.4">org.eclipse.sdk-feature/build.properties</A>: |
| <BR> generate.feature@org.eclipse.jdt.source=org.eclipse.jdt, |
| plugin@org.eclipse.jdt.doc.isv<BR> <BR> In this example, a source feature and |
| a plug-in, both with id "org.eclipse.jdt.source" will be generated and |
| will contain source from plug-ins listed in the org.eclipse.jdt feature and will |
| also include the plug-in org.eclipse.jdt.doc.isv. The generated org.eclipse.jdt.source |
| plug-in will be automatically listed in the org.eclipse.jdt.source feature.xml. |
| <BR> <BR> <BR> </LI><LI>In the feature project from which the source feature will |
| be generated, a directory called "<B>sourceTemplateFeature</B>" and |
| a directory called "<B>sourceTemplatePlugin</B>" will be required. These |
| directories should contain the files that are included in the root of the generated |
| source feature and plug-in. The feature.xml and plugin.xml files are not required |
| since these are generated. A build.properties is required in the sourceTemplatePlugin |
| directory. This should contain a "bin.includes" setting as well as the |
| entry "sourcePlugin = true". The plugin.xml file and src/ directory |
| should be listed in the bin.includes.<BR> <BR> See <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt-feature/">org.eclipse.jdt-feature</A> |
| and <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.platform-feature/">org.eclipse.platform-feature</A> |
| for examples.<BR> <BR> </LI></OL><P>To generate a <B>source plug-in only</B> at |
| build time, you will need to do the following:</P><OL> <LI> Add an entry to the |
| build.properties file in the feature project for which you wish to include the |
| source plug-in. The generated source plug-in should also be listed in the feature.xml |
| as a <plugin> element.. <BR> <BR> The build.properties entry should use |
| the following format:<BR> <BR> generate.plugin@<source.plugin.id to generate>=<feature.id |
| from which to which to collect source>, plugin@<plugin.id><BR> <BR> Example |
| taken from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.ve.tests-feature/build.properties?rev=1.2&cvsroot=Tools_Project">org.eclipse.ve.tests-feature/build.properties</A>: |
| <BR> generate.plugin@org.eclipse.ve.tests.source=org.eclipse.ve.tests<BR> |
| <BR> <BR> </LI><LI>In the runtime feature project from which the source plug-in |
| will be generated, create a directory called "sourceTemplatePlugin" |
| which must contain a build.properties with a "bin.includes" setting |
| and "sourcePlugin=true". The plugin.xml file and src/ directory should |
| be listed in the bin.includes.<BR> <BR> See <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ve.examples-feature/sourceTemplatePlugin/?cvsroot=Tools_Project">org.eclipse.ve.examples-feature/sourceTemplatePlugin</A> |
| for an example.<BR> </LI></OL><HR><P><FONT SIZE="+2"><A NAME="buildconfigfiles"></A><B>Preparing |
| Build Configuration Files</B></FONT></P><P>The distilled build process consists |
| of the following four steps:</P><OL><LI>build environment setup</LI><LI>check |
| out source from one or more CVS repositories</LI><LI>compilation</LI><LI> assembly |
| of distribution<BR></LI></OL><P>The script which controls the build sequence is |
| the build.xml Ant script in org.eclipse.pde.build. However this script requires |
| two user-implemented build configuration files,<A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.pde.build/templates/build.properties?rev=HEAD&content-type=text/vnd.viewcvs-markup">build.properties</A> |
| and <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.pde.build/templates/customTargets.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup">customTargets.xml</A>. |
| These two files provide the information on the "where and how" to build |
| specific elements. </P><P>Templates of these files are provided in the <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.pde.build/templates/">org.eclipse.pde.build/templates</A> |
| directory and examples are available in <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng.eclipsebuilder/">org.eclipse.releng.eclipsebuilder</A>, |
| <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng.gefbuilder/?cvsroot=Tools_Project">org.eclipse.releng.gefbuilder</A> |
| and <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ve.releng.builder/?cvsroot=Tools_Project">org.eclipse.ve.releng.builder</A> |
| for building Eclipse, GEF and VE runtimes, respectively.</P><P><B><FONT SIZE="+1"><A NAME="build.properties"></A>build.properties</FONT></B></P><P>The |
| build.properties file defines a number of properties that are used as Ant properties |
| at build time and as arguments to script generators in org.eclipse.pde.build to |
| describe how and where to execute the build. The values for properties listed |
| in this file override any values set in the generated build.xml files. See "Generating |
| Ant scripts from the command line" in the PDE Guide in Eclipse 3.2 stream |
| Help for a description of required and optional properties.</P><P><B><FONT SIZE="+1"><A NAME="customTargets.xml"></A>customTargets.xml</FONT></B></P><P>customTargets.xml |
| is an Ant script containing targets called by PDE Build scripts to provide the |
| following information:</P><OL><LI>the list of elements for which to generate scripts</LI><LI>instruction |
| on retrieval of map file projects</LI><LI>steps to execute before and after the |
| following: retrieving map files, checking out source, generating build.xml scripts, |
| executing build.xml scripts, and assembling the binary distributions.</LI><LI>instruction |
| on things to do after the build is done.</LI></OL><P>The table below lists the |
| targets that are used to provide this information.<BR><BR></P><TABLE WIDTH="100%" BORDER="1"><TR><TD WIDTH="24%">Target</TD><TD WIDTH="76%">Description</TD></TR><TR><TD WIDTH="24%">allElements</TD><TD WIDTH="76%"><P>This |
| target lists all features that will be packaged into a binary distribution where |
| each listing comes in the form of an <ant> call to org.eclipse.pde.build/scripts/genericTargets.xml:<BR><BR><B><ant |
| antfile="${genericTargets}" target="${target}" ><BR> <property |
| name="type" value="feature" /><BR> <property |
| name="id" value="<element.id>" /><BR> </ant><BR></B><BR> |
| The user is only required to specify a value for properties "type" and |
| id (the value for the id attribute in the feature.xml) for each listing. At this |
| time, only the type "feature" is supported.<BR></P><P>Example from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.releng.eclipsebuilder/jdt/customTargets.xml?rev=HEAD&content-type=text/xml">org.eclipse.releng.eclipsebuilder/jdt/customTargets.xml</A>:</P><P><B><target |
| name="allElements"><BR> <ant antfile="${genericTargets}" |
| target="${target}" ><BR> <property |
| name="type" value="feature" /><BR> <property |
| name="id" value="org.eclipse.jdt" /><BR> </ant><BR></target></B></P><P>The |
| <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.pde.build/scripts/genericTargets.xml?rev=HEAD&content-type=text/xml">genericTargets.xml |
| </A>script is an Ant script in the org.eclipse.pde.build plug-in containing targets |
| which call PDE Build custom Ant tasks to generate scripts for the specified elements |
| at various stages of the build. This script also executes the generated scripts |
| at various build stages. The target property is set by it's calling script, org.eclipse.pde.build/scripts/build.xml.<BR><BR>For |
| example, the fetch target in the build.xml calls allElements and sets the target |
| to property to "fetchElement":<BR><BR> <ant antfile="${customTargets}" |
| target="allElements"><BR> <property |
| name="target" value="fetchElement" /><BR> </ant><BR><BR>The |
| result of this is that the fetchElement target in genericTargets.xml is executed |
| using arguments type and id set in allElements.<BR></P></TD></TR><TR><TD WIDTH="24%">assemble.<element.id>[.config.spec]</TD><TD WIDTH="76%"><P>For |
| every configuration specified in the build.properties for the distribution (see |
| <A HREF="#configs">configs</A> above), a target named "assemble.<element.id>.<config.spec>" |
| is required. If the distribution is not platform-specific, the ".<config.spec>" |
| section of the target name is not required. </P><P>Providing the target name should |
| be all that is required unless you wish to give the produced binary distributable |
| file a name different from the default "<elment-id>-<buildid>-<config.spec>.zip". |
| In this case, an explicit value for the property "archiveName" should |
| be specified at the beginning of the target.<BR><BR>Example from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.releng.eclipsebuilder/jdt/customTargets.xml?rev=HEAD&content-type=text/xml">org.eclipse.releng.eclipsebuilder/jdt/customTargets.xml</A>:<BR><BR> |
| Since two configurations for building the org.eclipse.jdt distribution are specified |
| in it's build.properties "configs=*,*,* & macosx,carbon,ppc", the |
| following two targets are provided in the customTargets.xml script.</P><P><FONT COLOR="#000000"><B><target |
| name="assemble.org.eclipse.jdt"><BR> <property |
| name="archiveName" value="eclipse-JDT-${buildId}.zip"/><BR> |
| <ant antfile="${assembleScriptName}"/><BR></target></B></FONT></P><P><B><FONT COLOR="#000000"><target |
| name="assemble.org.eclipse.jdt.macosx.carbon.ppc"><BR> <property |
| name="archiveName" value="eclipse-JDT-${buildId}-macosx-carbon.tar.gz"/><BR> |
| <ant antfile="${assembleScriptName}"/><BR></target></FONT></B><BR></P></TD></TR><TR><TD WIDTH="24%"><A NAME="getmaps"></A>getMapFiles</TD><TD WIDTH="76%"><P>The |
| result of executing this target should be to place *.map files in any directory |
| or subdirectory under ${buildDirectory}/maps. All .map files found here are concatenated |
| into a single file ${buildDirectory}/directory.txt. Map file projects are typically |
| kept under version control in a CVS repository. <BR><BR>In the following example |
| from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.releng.eclipsebuilder/sdk/customTargets.xml?rev=HEAD&content-type=text/xml">org.eclipse.releng.eclipsebuilder/sdk/customTargets.xml</A>, |
| the implementation of this target and it's helper targets are provided to illustrate |
| how map files for Eclipse builds are checked out from a CVS repository and then |
| tagged with the build timestamp to capture the versions of all projects used in |
| the build.<BR><BR><B><target name="getMapFiles" depends="checkLocal" |
| unless="mapsLocal"><BR> <property |
| name="mapCvsRoot" value=":pserver:anonymous@dev.eclipse.org:/home/eclipse" |
| /><BR> <property name="mapVersionTag" |
| value="HEAD" /><BR> <cvs cvsRoot="${mapCvsRoot}"<BR> |
| package="org.eclipse.releng"<BR> |
| dest="${buildDirectory}/maps"<BR> |
| tag="${mapVersionTag}"<BR> |
| /><BR> <antcall target="tagMapFiles" |
| /><BR></target></B></P><P><B><FONT COLOR="#008000"><!--helper targets---></FONT><BR></B><B><BR><target |
| name="checkLocal"><BR> <available |
| property="mapsLocal" file="${buildDirectory}/maps/org.eclipse.releng" |
| /><BR></target><BR></B></P><P><B><target name="tagMapFiles" |
| if="tagMaps"><BR> <cvs dest="${buildDirectory}/maps/org.eclipse.releng" |
| command="tag v${timestamp}" /><BR></target></B><BR><BR></P></TD></TR><TR><TD WIDTH="24%" HEIGHT="24">preSetup |
| and postSetup</TD><TD WIDTH="76%" HEIGHT="24"><P>Used to run operations before |
| and after retrieving the map files.<BR><BR>Example from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.releng.gefbuilder/sdk/customTargets.xml?rev=HEAD&content-type=text/xml&cvsroot=Tools_Project">org.eclipse.releng.gefbuilder/sdk</A>. |
| This example demonstrates how the postSetup target (and a helper target) is used |
| to download and install an Eclipse SDK to compile against.</P><P><B><target |
| name="postSetup"><BR> <available |
| file="${buildDirectory}/../eclipse-SDK.zip" property="baseExists" |
| /> <BR> <antcall target="getBaseEclipse" |
| /> <BR> </target><BR></B></P><P><B><target name="getBaseEclipse" |
| unless="baseExists"></B></P><P><B><FONT COLOR="#008000"> <!--this |
| task definition is available in org.eclipse.releng.basebuilder/plugins/org.eclipse.build.tools. |
| It removes the _ <version> |
| from all directories specified as a value for the directory attribute. </FONT></B><FONT COLOR="#008000"><B>Not |
| really necessary, but helpful in this |
| case to avoid having/needing hard-coded versions in GEF javadoc scripts.--></B></FONT><B></B><B><BR></B><B> <taskdef |
| name="stripVersions" classname="org.eclipse.releng.VersionNumberStripper" |
| /> <BR> <BR><FONT COLOR="#008000"> <!--this |
| property file contains the values for ${eclipseURL} and ${eclipseBuildID}--></FONT><BR> <property |
| file="${buildDirectory}/maps/org.eclipse.gef.releng/maps/build.cfg" |
| /> <BR> <get src="${eclipseURL}/eclipse-SDK-${eclipseBuildID}-win32.zip" |
| dest="${buildDirectory}/../eclipse-SDK.zip" /> <BR> <exec |
| dir="${buildDirectory}/.." executable="unzip"><BR> <arg |
| line="-o -qq eclipse-SDK.zip" /> <BR> </exec><BR> |
| <BR> <stripVersions |
| directory="${buildDirectory}/plugins" /> <BR><BR><FONT COLOR="#008000"> <!-- |
| Extract doc.zip so we can create links in GEF java doc --> </FONT><BR> <exec |
| dir="${buildDirectory}/plugins/org.eclipse.platform.doc.isv" executable="unzip"><BR> |
| <arg line="-o |
| -qq doc.zip" /> <BR> </exec><BR> </target></B><BR><BR></P></TD></TR><TR><TD WIDTH="24%">preFetch |
| and postFetch </TD><TD WIDTH="76%"><P>Used to run operations before and after |
| fetching source for the build.<BR></P><P>Example from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.releng.gefbuilder/sdk/customTargets.xml?rev=HEAD&content-type=text/xml&cvsroot=Tools_Project">org.eclipse.releng.gefbuilder/sdk</A>. |
| This example demonstrates how the postFetch target can be used to set the build |
| timestamp as a value for "0" in about.mappings files.<BR><BR><B><target |
| name="postFetch"><BR> <replace dir="${buildDirectory}/plugins" |
| value="${timestamp}" token="@buildid@"><BR> <include |
| name="**/about.mappings" /> <BR> </replace><BR> |
| </target></B></P></TD></TR><TR><TD WIDTH="24%">preGenerate and postGenerate</TD><TD WIDTH="76%"><P>Used |
| to run operations before and after generating build.xml files for features, plug-ins |
| and fragments.<BR><BR>Example from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.releng.gefbuilder/sdk/customTargets.xml?rev=HEAD&content-type=text/xml&cvsroot=Tools_Project">org.eclipse.releng.gefbuilder/sdk</A>. |
| This example demonstrates how the postGenerate target (and a helper target) is |
| used to run the build.xml scripts to clean the source of any stale, pre-compiled |
| jars that might exist in the source directories. jars are not recompiled if they |
| already exist in plug-in or fragment directories.<BR></P><P> <B><target name="postGenerate"><BR> |
| <antcall target="clean" /> <BR> |
| </target></B></P><P><B><target name="clean" unless="noclean"><BR> <antcall |
| target="allElements"><BR> <param |
| name="target" value="cleanElement" /> <BR> </antcall><BR> |
| </target><BR></B></P></TD></TR><TR><TD WIDTH="24%">preProcess and postProcess</TD><TD WIDTH="76%"> |
| Used to run operations before and after compiling the source.</TD></TR><TR><TD WIDTH="24%">preAssemble |
| and postAssemble</TD><TD WIDTH="76%">Used to run operations before and after assembling |
| the binary distributables.</TD></TR><TR><TD WIDTH="24%">postBuild</TD><TD WIDTH="76%"><P>Used |
| to run operations at the end of the build.<BR></P><P>Example from <A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.releng.gefbuilder/sdk/customTargets.xml?rev=HEAD&content-type=text/xml&cvsroot=Tools_Project">org.eclipse.releng.gefbuilder/sdk</A>. |
| This example demonstrates how the postBuild target (and a helper target) is used |
| to gather and place the compile logs in the ${buildLabel} directory. These files |
| are used in the publishing of the GEF build (see below under Publishing the Build |
| section).<BR></P><P><B><target name="postBuild"><BR> <antcall |
| target="gatherLogs" /> <BR> </target><BR><BR><target name="gatherLogs"><BR> |
| <mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" |
| /> <BR> <antcall |
| target="allElements"><BR> <param |
| name="target" value="gatherLogs" /> <BR> </antcall><BR> <unzip |
| dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true"><BR> <fileset |
| dir="${buildDirectory}/features/org.eclipse.gef.sdk"><BR> <include |
| name="*.log.zip" /> <BR> </fileset><BR> |
| </unzip><BR> </target></B><BR><BR></P></TD></TR></TABLE><P> </P><HR><P><BR><FONT SIZE="+2"><B><A NAME="buildexec"></A>Build |
| Execution </B></FONT></P><P><FONT SIZE="+1"><A NAME="buildmachinesetup"></A><B>Build |
| machine setup</B></FONT><BR><BR>This build process can be executed on any of the |
| <A target="extra" HREF="http://www.eclipse.org/eclipse/development/eclipse_project_plan_3_2.html#TargetOperatingEnvironments">Eclipse |
| 3.2 Reference Platforms</A> plus the following:</P><UL><LI><A target="extra" HREF="http://www.cvshome.org/">CVS</A> |
| client version 1.10 or higher on system path. </LI><LI><A target="extra" HREF="http://www.info-zip.org/pub/infozip/">Info-Zip</A> |
| zip and unzip executables on system path.</LI><LI><A target="extra" HREF="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng.basebuilder/">org.eclipse.releng.basebuilder</A> |
| from dev.eclipse.org or any Eclipse 3.2 stream SDK install. Please note that the |
| Mailer java class in this project require a j2ee.jar on the classpath to compile |
| and run. This class is not used in the mechanism described in this document.</LI></UL><P>The |
| cvs, zip and unzip executables should be placed on the system path.</P><P> On |
| Windows systems, the HOME environement variable should be set to "c:" |
| (no slash) for CVS operations.</P><P>The org.eclipse.releng.basebuilder project |
| can be placed in any directory.</P><P><BR><B><FONT SIZE="+1"><A NAME="runbuild"></A>Running |
| the Build</FONT></B></P><P>To run the build, execute the following command from |
| ../plugins/org.eclipse.pde.build/scripts to <B>build a single distribution</B>:<BR><BR><B>java |
| -jar <path>/startup.jar -application org.eclipse.ant.core.antRunner [-buildfile |
| build.xml] -Dbuilder=<path to directory containing build.properties and customTargets.xml> |
| [Ant property settings to override those in <A HREF="#build.properties" TARGET="_blank">build.properties</A>]</B><B><BR></B></P><P> </P> |
| </BODY> |
| </HTML> |