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/UI/SourceReferences"

< PDE‎ | UI
(Implementation)
(Generating Source Reference Headers (PDE/Build))
Line 19: Line 19:
 
[[Image:Repo-import-3.png]]
 
[[Image:Repo-import-3.png]]
  
== Generating Source Reference Headers (PDE/Build) ==
+
== Extensibility: Generating and Importing Source Reference Headers ==
  
 
PDE build optionally generates source reference headers during a build. This feature is turned on by specifying the following property:
 
PDE build optionally generates source reference headers during a build. This feature is turned on by specifying the following property:
Line 28: Line 28:
  
 
For example, the CVS fetch factory implementation sets a {key, value} pair in the map for each project being fetched, like:
 
For example, the CVS fetch factory implementation sets a {key, value} pair in the map for each project being fetched, like:
 +
 +
<code>{"sourceReferences", "Eclipse-SourceReferences: scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.debug.core;tag=v20100427"}</code>
 +
 +
PDE provides two new '''experimental / internal''' extension points to support import operations in the SDK:
 +
 +
* org.eclipse.pde.core.bundleImporters
 +
* org.eclipse.pde.ui.bundleImportPages

Revision as of 16:25, 5 May 2010

Eclipse Source Reference Headers

During 3.6, PDE introduced the Eclipse-SourceReferences header to bundle manifests. The header provides a list of SCMURLs that reference the source code associated with a binary bundle. PDE build has extensible support for generating headers and tooling in the IDE provides support to import projects into the workspace corresponding to binary bundles. Often a bundle has only one SCMURL associated with it. For example, following is a header included in the "org.eclipse.debug.ui" bundle from the 3.6 M7 build:

Eclipse-SourceReferences: scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.debug.core;tag=v20100427

Importing Projects from CVS

The SCMURLs generated in the Eclipse SDK refer to projects in the Eclipse CVS repository. To import projects from CVS use PDE's import wizard (use the File > Import action and select Plug-in Development > Plug-ins and Fragments on the first page of the import wizard). For this example, we'll import from the active target platform. Choose the Projects from a repository radio button at the bottom of the wizard page and press Next.

Repo-import-1.png

All bundles with published SCMURLs will be available for importing. Select the bundles you want to import, and press Next. For this example, I have selected bundles related to the debug platform.

Repo-import-2.png

The last page of the wizard allows you to import the specific versions of the projects that were used in the build or from HEAD. For this example, I will choose HEAD. Pressing Finish imports the projects into the workspace.

Repo-import-3.png

Extensibility: Generating and Importing Source Reference Headers

PDE build optionally generates source reference headers during a build. This feature is turned on by specifying the following property:

generateSourceReferences = true

The headers themselves are generated by fetch factories. PDE build uses fetch factories to fetch source code from repositories (there is an org.eclipse.pde.build.fetchFactories extension point). Each repository (CVS, etc.), provides a specific implementation of an IFetchFactory. To include source reference headers a fetch factory must provide a KEY_SOURCE_REFERENCES property when parsing a map file entry, in the implementation of parseMapFileEntry(String, Properties, Map).

For example, the CVS fetch factory implementation sets a {key, value} pair in the map for each project being fetched, like:

{"sourceReferences", "Eclipse-SourceReferences: scm:cvs:pserver:dev.eclipse.org:/cvsroot/eclipse:org.eclipse.debug.core;tag=v20100427"}

PDE provides two new experimental / internal extension points to support import operations in the SDK:

  • org.eclipse.pde.core.bundleImporters
  • org.eclipse.pde.ui.bundleImportPages

Copyright © Eclipse Foundation, Inc. All Rights Reserved.