Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "PDE/Build"

< PDE
(Building from a subversion repository)
(Documentation)
 
(9 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
{{PDE}}
 +
 
PDE/Build builds plug-ins.  It is used behind the scenes during export, and it is used for automated headless builds.  The purpose of this page is to answer some of the common questions that arise.
 
PDE/Build builds plug-ins.  It is used behind the scenes during export, and it is used for automated headless builds.  The purpose of this page is to answer some of the common questions that arise.
  
A lot of documentation was written for PDE/Build in 3.2.  Reading the docs will be useful, start [http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tasks/pde_feature_build.htm here].
+
==Documentation==
 
+
There is a significant amount of documentation in the Eclipse Help system under "Plug-in Development Environment Guide > Tasks > PDE Build". The latest version of Eclipse Help is always available online at [http://help.eclipse.org help.eclipse.org]. Helios documentation for PDE/Build starts [http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_feature_build.htm here].  
==Java source level problems during Export==
+
*I set my compliance levels, why doesn't it work?
+
*How do I Compile against arbitrary JDKs?
+
*java.lang.UnsupportedClassVersionError
+
 
+
PDE/UI performs the export by using PDE/Build to generate build scripts.  PDE/Build does not know anything about the Java Builder settings in your workspace or on your project.  Your plug-in's manifest.mf and build.properties files are the input to PDE/Build. See [http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tasks/pde_compilation_env.htm this page] for specifics on controlling the compilation environment for your plug-in.
+
 
+
The properties specifying the locations of the JDKs to compile against are automatically set during export by PDE/UI based on your installed JREs: Preferences->Java->Installed JREs->Execution Environment.
+
 
+
So, to set your compilation environment:
+
#Setup your installed JREs in your preferences.
+
#Set your Bundle-RequiredExecutionEnvironment in your manifest.
+
#or set <tt>jre.compilation.profile</tt> in your build.properties
+
#or set <tt>javacSource</tt>, <tt>javacTarget</tt> in your build.properties
+
 
+
Bugs: If you are using .qualifier in your bundle's version, see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=153778 bug 153778].
+
 
+
==Including files in the root of my build==
+
Files can be included in the root of your build by using a Feature.  See [http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.pde.doc.user/reference/pde_feature_generating_build.htm this page] for the root properties to set in your feature's build.properties file.
+
 
+
If you are doing a product build using productBuild.xml and a .product file instead of a normal feature driven build, then you must somehow include your feature containing the root files.  There are two possibilities for doing this:
+
#Have your .product file based on features, and include your root feature.  If your root feature does not containg the <tt>bin.includes</tt> property, then it will not be included in the final build results, but the root files will be.
+
#If your .product file is based on plug-ins, you need to get your feature to be included in the generated container feature that is driving the product build.  The feature generator allows you to specify a list of additional features and plug-ins to be included.  Use the featureList property to add your root feature.  Note that in 3.2, the productBuild.xml script did not pass this property to the feature generator ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=158761 bug 158761]).  You will need to add it to the productBuild.xml:
+
<code>
+
<target name="generateFeature">
+
    <eclipse.generateFeature
+
      featureId="org.eclipse.pde.build.container.feature"
+
      buildDirectory="${buildDirectory}"
+
      baseLocation="${baseLocation}"
+
      productFile="${product}"
+
      verify="${verify}"
+
      pluginPath="${pluginPath}"
+
      configInfo="${configs}"
+
      pluginList="${pluginList}"
+
      featureList="${featureList}"
+
    />
+
</target>
+
</code>
+
+
==Fetching the .product file in a product build==
+
When using the productBuild.xml and a .product file to build your product, the feature or plug-in that contains the .product file must exist on disk before the fetch phase of the build.  This is because we need to generate the container feature first so that we know what we need to fetch.
+
 
+
You can fetch the feature/plug-in containing the .product file using a custom step earlier on in the build. Use customTargets.xml, in the postSetup target, call ${genericTargets}/fetchElement. Something like:
+
<code>
+
  <ant antfile="${genericTargets}" target="fetchElement">
+
    <property name="type" value="feature"/>
+
    <property name="id" value="org.feature.containing.product.file" />
+
  </ant>
+
</code>
+
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=159128 bug 159128].
+
 
+
==Problems parsing feature file in a product build==
+
Error is something like:
+
org.eclipse.pde.build_3.2.0.v20060601\scripts\productBuild\productBuild.xml:45:
+
Problems parsing the feature file:/build/features/org.eclipse.pde.build.container.feature/feature.xml.
+
or:
+
[eclipse.generateFeature] Could not read:
+
file:/tmp/builder/build/tempbuild/features/org.eclipse.pde.build.container.feature/feature.xml
+
 
+
This is [https://bugs.eclipse.org/bugs/show_bug.cgi?id=152577 bug 152577].  The workaround is to modify the productBuild.xml to delete the feature before its regeneration in the generateFeature target:
+
  <target name="generateFeature">
+
    <delete dir="${buildDirectory}/features/org.eclipse.pde.build.container.feature"/>
+
    <eclipse.generateFeature
+
        featureId="org.eclipse.pde.build.container.feature"
+
        buildDirectory="${buildDirectory}"
+
        baseLocation="${baseLocation}"
+
        productFile="${product}"
+
        verify="${verify}"
+
        pluginPath="${pluginPath}"
+
        configInfo="${configs}"
+
    />
+
  </target>
+
 
+
 
+
==Building from a subversion repository==
+
Out of the box, PDE Build does not have the ability to fetch code from a subversion repository. Some discussion have started to make Subversive Fetch tasl part of the BaseBuilder, see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=276662]
+
 
+
Subversive provides an SVN fetch task. The corresponding plugin can be downloaded from [http://download.eclipse.org/technology/subversive/0.7/pde-update-site/], and some documentation can be found on [[Subversive PDE Fetch | dedicated wiki page]].
+
 
+
Before that, Chris Vines from the community created a plug-in adding this support. It can be found at [http://sourceforge.net/projects/svn-pde-build/]. Any specific problem with this plug-in must be reported there too.
+
 
+
==Setting up a workspace to test builds==
+
* Start a runtime workbench
+
* File -> New -> Project
+
* Name it "Builder"
+
* Finish
+
* File -> New -> Folder -> Builder/features
+
* File -> New -> Folder -> Builder/plugins
+
* Put your feature inside the Builder/features directory
+
* From the PDE/Build plug-in in your install, <em>copy allElements.xml</em>, <em>build.properties</em> and <em>customTargets.xml</em> to the Builder project.
+
* Edit Builder/build.properties
+
** Set <em>buildDirectory</em> to be the file-system path of your workspace project. (e.g. d:/temp/workspace/Builder)
+
** Set <em>baseLocation</em> to the file-system path of the target that you are building against (e.g. d:/R32/eclipse)
+
* In your dev, create a new Eclipse Application
+
** Set the application to be <em>org.eclipse.ant.core.antRunner</em>
+
** Set the arguments to be <em>-buildfile ${resource_loc:/org.eclipse.pde.build/scripts/build.xml} -Dbuilder=d:/temp/workspace/Builder -nosplash</em>
+
* Run the launch config.
+
 
+
==Platform Specific fragments in Multi-Platform Product or Feature Export==
+
When exporting a feature, or a product based on features you get an error like:
+
<pre>
+
Unable to find plugin: org.eclipse.filesystem.win32.x86_1.1.0
+
</pre>
+
or
+
<pre>
+
Bundle org.eclipse.swt.gtk.linux.x86_0.0.0 failed to resolve.
+
</pre>
+
  
This is caused by a missing ws/os/arch filter on the fragment's inclusion in the feature.xml. This can easily be set in the Plug-ins Tab of the feature editor by selecting the fragment on the left and specifying the Operating System, Window System and Architecture on the right. Or it can be set directly in the feature.xml :
+
Some of the advanced topics covered in the help system include:
<pre> 
+
* Customizing the build [http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_customization.htm]
<plugin id="org.eclipse.swt.gtk.linux.x86" os="linux" ws="gtk" arch="x86"
+
* Fetching source from repositories [http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_fetch_phase.htm]
        version="0.0.0" fragment="true" unpack="false"/>
+
* Controlling compiler specific settings [http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_compilation_env.htm]
</pre>
+
* Generating source bundles [http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/tasks/pde_individual_source.htm]
 +
* Building for p2 [http://help.eclipse.org/helios/index.jsp?nav=/4_2_2]
  
  
The feature lists everything that needs to be present for the export to succeed.  Platform specific fragments will not resolve, and hence not be available, on platforms that do not match their Eclipse-PlatformFilter.  In order to let export know that it is ok that this fragment is not available on this platform, a similar platform filter is needed in the feature.xml.
+
===FAQ===
 +
See [[PDE/Build/FAQ]].
  
  
[[Category:FAQ]]
+
[[Category:PDE|Build]] [[Category:PDE/Build]]

Latest revision as of 15:24, 8 June 2010

PDE
Website
Download
Community
Mailing ListForumsIRCmattermost
Issues
OpenHelp WantedBug Day
Contribute
Browse SourceProject Set File

PDE/Build builds plug-ins. It is used behind the scenes during export, and it is used for automated headless builds. The purpose of this page is to answer some of the common questions that arise.

Documentation

There is a significant amount of documentation in the Eclipse Help system under "Plug-in Development Environment Guide > Tasks > PDE Build". The latest version of Eclipse Help is always available online at help.eclipse.org. Helios documentation for PDE/Build starts here.

Some of the advanced topics covered in the help system include:

  • Customizing the build [1]
  • Fetching source from repositories [2]
  • Controlling compiler specific settings [3]
  • Generating source bundles [4]
  • Building for p2 [5]


FAQ

See PDE/Build/FAQ.

Back to the top