Difference between revisions of "Common Build Infrastructure/Getting Started/Build In Eclipse"

From Eclipsepedia

Jump to: navigation, search
(Run a build)
 
(42 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The process to run a build in Eclipse is getting ever easier.
+
{{:DocumentationGuidelines/DraftHeader}}
  
=== Fetch Required Workspace Projects ===
+
To run a build with Athena, you need to do four things:
1. Download a .psf file, such as [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.commonbuilder.releng/psf/gef.psf?root=Technology_Project&view=co gef.psf]
+
  
2. Open Eclipse, and do <code>File > Import > Team > Team Project Set</code>. Browse for the .psf file you downloaded above, and import it. You should end up with three new workspace projects.
+
# Fetch required basebuilder & Athena projects into your workspace, then close the org.eclipse.releng.basebuilder project.
 +
# Fetch your releng project (if already created) or create it as a copy of the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.myproject.releng/?root=Technology_Project template project].
 +
# Configure your releng project to define what to build, how to build, how to test, and how to publish.
 +
# Run build.xml
  
org.eclipse.releng.basebuilder
+
=== Fetch basebuilder & Athena projects ===
org.eclipse.dash.common.releng
+
org.eclipse.gef.releng
+
  
3. Download [http://downloads.sourceforge.net/ant-contrib/ant-contrib-1.0b2-bin.zip ant-contrib.jar 1.0b2] '''''(NOT 1.0b3!)''''' and put it into <code>org.eclipse.dash.common.releng/lib/ant-contrib.jar</code>.
+
You need these two projects:
  
=== Configure build.properties ===
+
* org.eclipse.releng.basebuilder (contains Eclipse Platform, PDE + tools/scripts needed to build)
 +
* org.eclipse.dash.common.releng (contains tools/scripts to communicate & extend PDE)
  
4. Open <code>org.eclipse.gef.releng/build.properties</code> and edit to suit your needs.
+
====By Hand====
  
==== Required Settings ====
+
* Download [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.common.releng/psfs/athena.cvs.psf?revision=1.1&root=Technology_Project athena.cvs.psf]
  
The following properties must be set:
+
* <code>File > Import > Team > Team Project Set > browse for athena.psf</code>
  
 +
* Close the <code>org.eclipse.releng.basebuilder</code> project to hide the compilation errors. These can be safely ignored.
 +
 +
====Automatically====
 +
 +
Use [[Common_Build_Infrastructure/Getting_Started/Build_In_Hudson/Bootstrapping | bootstrap.xml]]
 +
 +
=== Fetch or create releng project ===
 +
<table style="float:right; border: 1px dashed #000080">
 +
<tr><th>Sample Athena Releng Projects</th><tr>
 +
<tr><td>
 +
CVS Source
 +
* [http://dev.eclipse.org/viewcvs/index.cgi/pde/visualization/org.eclipse.pde.visualization.releng/ Eclipse - PDE - Visualization]
 +
 +
* [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org.eclipse.emf.ecoretools/releng/?root=Modeling_Project Eclipse Modeling - EMF - Ecore Tools]
 +
* [http://dev.eclipse.org/svnroot/modeling/org.eclipse.gmt.modisco/releng/trunk/org.eclipse.gmt.modisco.releng/ Eclipse Modeling - GMT - MoDisco]
 +
 +
* [http://dev.eclipse.org/viewcvs/index.cgi/sourceediting/development/athena/org.eclipse.wst.xsl.releng/?root=WebTools_Project Eclipse Web Tools - XSL Tools]
 +
 +
* [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/?root=Technology_Project Eclipse Tools - GEF]
 +
 +
SVN Source
 +
* [http://dev.eclipse.org/svnroot/technology/org.eclipse.linuxtools/releng/trunk/org.eclipse.linuxtools.releng/ Eclipse Technology - Linux Tools]
 +
 +
* [http://anonsvn.jboss.org/repos/jbosstools/trunk/jmx/releng/ JBoss Tools - JMX Console]
 +
* [http://anonsvn.jboss.org/repos/jbosstools/trunk/bpel/releng/ JBoss Tools - BPEL Editor]
 +
* [http://anonsvn.jboss.org/repos/jbosstools/trunk/jbpm/releng/ JBoss Tools - jBPM Tools]
 +
</td></tr></table>
 +
 +
To fetch your project's releng folder, you will need to know where it is located in CVS or SVN.
 +
 +
To create a new one, you can copy from the [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.myproject.releng/?root=Technology_Project sample project] then configure using the examples at right:
 +
 +
Note that some projects include a <code>psfs/</code> folder within their releng project to facilitate checking out sources, as in step 1 above.
 +
 +
=== Configure your .releng project ===
 +
 +
==== Required settings ====
 +
 +
The following properties must be set:
 +
<table><tr><td>
 
  projectid=technology.foo
 
  projectid=technology.foo
  zipPrefix=GEF
+
  zipPrefix=MyFoo
 
  version=0.5.0
 
  version=0.5.0
 
  buildType=N
 
  buildType=N
Line 27: Line 68:
 
  testFeatureToBuildID=org.eclipse.foo.test
 
  testFeatureToBuildID=org.eclipse.foo.test
  
  # if project is incubating, insert "-incubation" string into all generated zip file names
+
  # if project is incubating, insert "-incubation" into
 +
# generated zip file names; otherwise omit
 
  incubation=-incubation
 
  incubation=-incubation
# if not incubating, set null string
 
#incubation=
 
  
  # set path and version of JVM to use; for 1.4, use JAVA14_HOME, for 6.0, use JAVA60_HOME
+
  # set path and version of JVM to use; must set a variable for  
  JAVA_HOME=/opt/public/common/ibm-java2-ppc-50
+
# each Bundle-RequiredExecutionEnvironment (BREE) used in plugins
  JAVA50_HOME=/opt/public/common/ibm-java2-ppc-50
+
# Or just use the default value provided by Eclipse, JAVA_HOME
  dependencyURLs=http://download.eclipse.org/eclipse/downloads/drops/S-3.5M6-200903130100/eclipse-SDK-3.5M6-linux-gtk-ppc.tar.gz,http://path/to/other/required.zip
+
  JAVA14_HOME=${JAVA_HOME}
 +
  JAVA50_HOME=${JAVA_HOME}
 +
  JAVA60_HOME=${JAVA_HOME}
 +
</td></tr></table>
  
  #what steps should we do? default: build.steps=buildUpdate,buildZips,buildTests,generateDigests,test,publish,cleanup
+
Define binary dependencies using <code>dependencyURLs</code> and/or <code>repositoryURLs</code>. For more examples, see [[Common_Build_Infrastructure/Defining_Binary_Dependencies|Defining Binary Dependencies]]:
  build.steps=buildUpdate,buildTests,generateDigests,test,publish,cleanup
+
<table><tr><td>
 +
  repositoryURLs=\
 +
  http://download.eclipse.org/athena/repos/eclipse-Update-3.5.2-201002111343.zip
 +
  IUsToInstall=\
 +
  org.eclipse.sdk.feature.group+org.eclipse.sdk.ide
 +
 +
dependencyURLs=\
 +
  http://path/to/some/required-SDK.zip
 +
</td></tr></table>
  
If you require SVN or do not have the test framework plugins in your map file, you will need this property too, or to perform the equivalent set up manually.
+
Define what steps to perform. To run tests w/o building first, see [[Common_Build_Infrastructure/Testing|Testing]]:
 +
<table><tr><td>
 +
#default: buildUpdate,buildTests,generateDigests,testLocal,publish,cleanup
 +
build.steps=buildUpdate
 +
</td></tr></table>
  
 +
If you require SVN or do not have the test framework plugins in your map file, you will need this property too, or to perform the equivalent set up manually.
 +
<table><tr><td>
 
  # To permit automatic downloads of non-EPL compatible code, set this to property to "I accept"
 
  # To permit automatic downloads of non-EPL compatible code, set this to property to "I accept"
  #thirdPartyDownloadLicenseAcceptance="I accept"
+
  thirdPartyDownloadLicenseAcceptance="I accept"
 +
</td></tr></table>
  
==== Optional Settings ====
+
==== Optional settings ====
  
 
You can also set other [http://dev.eclipse.org/viewcvs/index.cgi/pde/build/org.eclipse.pde.build/templates/headless-build/build.properties?view=markup PDE variables and compiler settings] in your releng project's build.properties:
 
You can also set other [http://dev.eclipse.org/viewcvs/index.cgi/pde/build/org.eclipse.pde.build/templates/headless-build/build.properties?view=markup PDE variables and compiler settings] in your releng project's build.properties:
 
+
<table><tr><td>
 
  compilerArg=-enableJavadoc -encoding ISO-8859-1
 
  compilerArg=-enableJavadoc -encoding ISO-8859-1
 
  flattenDependencies=true
 
  flattenDependencies=true
 
  parallelCompilation=true
 
  parallelCompilation=true
 
  generateFeatureVersionSuffix=true
 
  generateFeatureVersionSuffix=true
 +
</td></tr></table>
  
=== Run A Build ===
+
=== Run a build ===
  
5. Select <code>org.eclipse.gef.releng/build.xml</code>, then <code>Run As > Ant Build</code>.
+
Select <code>your.project.releng/build.xml</code>, then <code>Run As > Ant Build</code>. (Or from your releng project folder, simply run <code>ant</code>)
 +
* Ensure you have CVS or SVN installed on your machine.
 +
* If the compiler fails with errors like "Cannot find Object", make sure you have a JAVA_HOME for every BREE in your manifests.  Please see the [[Common Build Infrastructure/Getting Started/FAQ]].
  
6. A log of the build will appear as <code>org.eclipse.gef.releng/buildlog.latest.txt</code>.
+
A log of the build will may appear as <code>your.project.releng/buildlog.latest.txt</code>, if you have configured a launch configuration to do so. Otherwise a complete buildlog.txt should appear in the destination folder where the build is created, eg., <code>/tmp/build/N201001282334/buildlog.txt</code>.
 +
* If you do not yet have tests available in your repository (or have not linked them from your map file(s), you may receive errors running the "test" or "testLocal" step.
  
=== See also ===
+
==== Troubleshooting / server setup ====
 +
 
 +
If needs be, you may find additional information related to troubleshooting or server configuration here.
  
 
* [[Common Build Infrastructure/Virtual Server Setup/Fedora]]
 
* [[Common Build Infrastructure/Virtual Server Setup/Fedora]]
Line 66: Line 130:
 
* [[Common Build Infrastructure/Virtual Server Setup/WinXP]]
 
* [[Common Build Infrastructure/Virtual Server Setup/WinXP]]
  
[[Category:Dash Project]]
+
===Next Steps===
[[Category:Eclipse Technology Project]]
+
 
[[Category:Common Builder]]
+
Once you can build in Eclipse, you might want to [[Common_Build_Infrastructure/Getting_Started/Build_In_Hudson|get a job added to Hudson]] so you can run continuous integrations or nightlies, then start [[Common_Build_Infrastructure/Publishing|publishing to download.eclipse.org]].
 +
 
 +
[[Category:Athena Common Build]]
 
[[Category:Releng]]
 
[[Category:Releng]]
 +
[[Category:Draft_Documentation]]

Latest revision as of 16:14, 15 April 2010

Warning2.png
Draft Content
This page is currently under construction. Community members are encouraged to maintain the page, and make sure the information is accurate.


To run a build with Athena, you need to do four things:

  1. Fetch required basebuilder & Athena projects into your workspace, then close the org.eclipse.releng.basebuilder project.
  2. Fetch your releng project (if already created) or create it as a copy of the template project.
  3. Configure your releng project to define what to build, how to build, how to test, and how to publish.
  4. Run build.xml

Contents

[edit] Fetch basebuilder & Athena projects

You need these two projects:

  • org.eclipse.releng.basebuilder (contains Eclipse Platform, PDE + tools/scripts needed to build)
  • org.eclipse.dash.common.releng (contains tools/scripts to communicate & extend PDE)

[edit] By Hand

  • File > Import > Team > Team Project Set > browse for athena.psf
  • Close the org.eclipse.releng.basebuilder project to hide the compilation errors. These can be safely ignored.

[edit] Automatically

Use bootstrap.xml

[edit] Fetch or create releng project

Sample Athena Releng Projects

CVS Source

SVN Source

To fetch your project's releng folder, you will need to know where it is located in CVS or SVN.

To create a new one, you can copy from the sample project then configure using the examples at right:

Note that some projects include a psfs/ folder within their releng project to facilitate checking out sources, as in step 1 above.

[edit] Configure your .releng project

[edit] Required settings

The following properties must be set:

projectid=technology.foo
zipPrefix=MyFoo
version=0.5.0
buildType=N
mainFeatureToBuildID=org.eclipse.foo.all
testFeatureToBuildID=org.eclipse.foo.test
# if project is incubating, insert "-incubation" into
# generated zip file names; otherwise omit
incubation=-incubation
# set path and version of JVM to use; must set a variable for 
# each Bundle-RequiredExecutionEnvironment (BREE) used in plugins
# Or just use the default value provided by Eclipse, JAVA_HOME
JAVA14_HOME=${JAVA_HOME}
JAVA50_HOME=${JAVA_HOME}
JAVA60_HOME=${JAVA_HOME}

Define binary dependencies using dependencyURLs and/or repositoryURLs. For more examples, see Defining Binary Dependencies:

repositoryURLs=\
 http://download.eclipse.org/athena/repos/eclipse-Update-3.5.2-201002111343.zip
IUsToInstall=\
 org.eclipse.sdk.feature.group+org.eclipse.sdk.ide

dependencyURLs=\
 http://path/to/some/required-SDK.zip

Define what steps to perform. To run tests w/o building first, see Testing:

#default: buildUpdate,buildTests,generateDigests,testLocal,publish,cleanup
build.steps=buildUpdate

If you require SVN or do not have the test framework plugins in your map file, you will need this property too, or to perform the equivalent set up manually.

# To permit automatic downloads of non-EPL compatible code, set this to property to "I accept"
thirdPartyDownloadLicenseAcceptance="I accept"

[edit] Optional settings

You can also set other PDE variables and compiler settings in your releng project's build.properties:

compilerArg=-enableJavadoc -encoding ISO-8859-1
flattenDependencies=true
parallelCompilation=true
generateFeatureVersionSuffix=true

[edit] Run a build

Select your.project.releng/build.xml, then Run As > Ant Build. (Or from your releng project folder, simply run ant)

  • Ensure you have CVS or SVN installed on your machine.
  • If the compiler fails with errors like "Cannot find Object", make sure you have a JAVA_HOME for every BREE in your manifests. Please see the Common Build Infrastructure/Getting Started/FAQ.

A log of the build will may appear as your.project.releng/buildlog.latest.txt, if you have configured a launch configuration to do so. Otherwise a complete buildlog.txt should appear in the destination folder where the build is created, eg., /tmp/build/N201001282334/buildlog.txt.

  • If you do not yet have tests available in your repository (or have not linked them from your map file(s), you may receive errors running the "test" or "testLocal" step.

[edit] Troubleshooting / server setup

If needs be, you may find additional information related to troubleshooting or server configuration here.

[edit] Next Steps

Once you can build in Eclipse, you might want to get a job added to Hudson so you can run continuous integrations or nightlies, then start publishing to download.eclipse.org.