Difference between revisions of "Orbit Source Bundles"

From Eclipsepedia

Jump to: navigation, search
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Created from [https://bugs.eclipse.org/bugs/show_bug.cgi?id=184026 bug 184026].
+
Originally created from [https://bugs.eclipse.org/bugs/show_bug.cgi?id=184026 bug 184026] and then updated to describe the changes for JAR'd source bundles as per [https://bugs.eclipse.org/bugs/show_bug.cgi?id=206596 bug 206596].
 +
 
 +
===What you need to do===
 +
If you have bundles in Orbit and you would like to have source bundles automatically generated for you, here are the things that you have to do:
 +
  * put your bundles in the structure below
 +
  * add a map file entry for your source bundle
 +
 
 +
===Bundle structure===
 +
In order to leverage the automatic infrastructure, avoid the profusion of projects in CVS and simplify management, it is recommended that you store the source bundles in the same project than its binary counter part. This is achieved by creating a sub-folder called "source-bundle" in the project. This folder will be setup like any other bundle with a manifest.mf, build.properties, etc...  
  
Bundle structure:
 
 
<pre>
 
<pre>
 
{plugin_root}
 
{plugin_root}
 +
about_files/
 
META-INF/MANIFEST.MF
 
META-INF/MANIFEST.MF
plugin.xml
+
about.html
plugin.properties
+
 
build.properties
 
build.properties
 +
plugin.properties
 
{class_files}
 
{class_files}
 +
...
 
source-bundle/
 
source-bundle/
 +
about_files/
 
META-INF/MANIFEST.MF
 
META-INF/MANIFEST.MF
plugin.xml
+
about.html
 
build.properties
 
build.properties
customCallbacks.xml
+
plugin.properties
src/{plugin_id}_{version}/src.zip
+
...
 +
{source_files}
 
</pre>
 
</pre>
  
customCallbacks.xml
+
Example for javax.servlet 2.4
 +
 
 
<pre>
 
<pre>
<?xml version="1.0" encoding="UTF-8"?>
+
javax.servlet
<project name="customCallbacks" default="post.gather.bin.parts" basedir=".">
+
about_files/
<target name="post.gather.bin.parts">
+
META-INF/MANIFEST.MF
<echo message="${target.folder}" />
+
about.html
<echo message="${build.result.folder}" />
+
build.properties
<pathconvert property="binaryBundleId">
+
javax/servlet/{dot_class_files}
<path>
+
plugin.properties
<fileset dir="${target.folder}/src" includes="**" />
+
source-bundle/
</path>
+
about_files/
<regexpmapper from=".*\\(.*)_(.*)\\.*" to="\1" />
+
META-INF/MANIFEST.MF
</pathconvert>
+
about.html
<pathconvert property="sourceFolderVersion">
+
build.properties
<path>
+
plugin.properties
<fileset dir="${target.folder}/src" includes="**" />
+
javax/servlet/{dot_java_files}
</path>
+
<regexpmapper from=".*\\(.*_.*)\\.*" to="\1" />
+
</pathconvert>
+
<move todir="${target.folder}/src/${binaryBundleId}_${bundleVersion}">
+
<fileset dir="${target.folder}/src/${sourceFolderVersion}" includes="**" />
+
</move>
+
</target>
+
</project>
+
 
</pre>
 
</pre>
  
build.properties
+
===MANIFEST.MF===
 +
In the old Eclipse method, source bundles were contributed to Eclipse by using an extension point. In the new method, you will need to add a new bundle header to your bundle manifest to tell Eclipse that your bundle is a source bundle and to specify the id and version of the host bundle.  
 
<pre>
 
<pre>
customBuildCallbacks=customCallbacks.xml
+
Eclipse-SourceBundle: my.bundle.id;version="1.0.0.qualifier"
customBuildCallbacks.inheritall=true             
+
 
</pre>
 
</pre>
 +
This is the format for the most common case; where the bundle source is unzipped at the root of the source bundle.
 +
 +
====Multiple Roots====
 +
If you have multiple folders in your source bundle which specify source, then you must tell Eclipse that there are multiple roots. This can be the case for instance if you ship an un-JAR'd bundle with multiple source zip files that you don't want to merge into a single directory structure.
 +
<pre>
 +
Eclipse-SourceBundle: my.bundle.id;version="1.0.0.qualifier";roots:="folder1,folder2"
 +
</pre>
 +
 +
===build.properties===
 +
The build.properties file for the source bundle is pretty simple, just include all the files you want in your bundle. For instance:
 +
<pre>
 +
bin.includes = about.html,\
 +
              about_files/,\
 +
              plugin.properties,\
 +
              META-INF/,\
 +
              javax/
 +
</pre>
 +
 +
 
[[Category : Orbit]]
 
[[Category : Orbit]]

Latest revision as of 14:13, 29 February 2008

Originally created from bug 184026 and then updated to describe the changes for JAR'd source bundles as per bug 206596.

Contents

[edit] What you need to do

If you have bundles in Orbit and you would like to have source bundles automatically generated for you, here are the things that you have to do:

 * put your bundles in the structure below
 * add a map file entry for your source bundle

[edit] Bundle structure

In order to leverage the automatic infrastructure, avoid the profusion of projects in CVS and simplify management, it is recommended that you store the source bundles in the same project than its binary counter part. This is achieved by creating a sub-folder called "source-bundle" in the project. This folder will be setup like any other bundle with a manifest.mf, build.properties, etc...

{plugin_root}
	about_files/
	META-INF/MANIFEST.MF
	about.html
	build.properties
	plugin.properties
	{class_files}
	...
	source-bundle/
		about_files/
		META-INF/MANIFEST.MF
		about.html
		build.properties
		plugin.properties
		...
		{source_files}

Example for javax.servlet 2.4

javax.servlet
	about_files/
	META-INF/MANIFEST.MF
	about.html
	build.properties
	javax/servlet/{dot_class_files}
	plugin.properties
	source-bundle/
		about_files/
		META-INF/MANIFEST.MF
		about.html
		build.properties
		plugin.properties
		javax/servlet/{dot_java_files}

[edit] MANIFEST.MF

In the old Eclipse method, source bundles were contributed to Eclipse by using an extension point. In the new method, you will need to add a new bundle header to your bundle manifest to tell Eclipse that your bundle is a source bundle and to specify the id and version of the host bundle.

Eclipse-SourceBundle: my.bundle.id;version="1.0.0.qualifier"

This is the format for the most common case; where the bundle source is unzipped at the root of the source bundle.

[edit] Multiple Roots

If you have multiple folders in your source bundle which specify source, then you must tell Eclipse that there are multiple roots. This can be the case for instance if you ship an un-JAR'd bundle with multiple source zip files that you don't want to merge into a single directory structure.

Eclipse-SourceBundle: my.bundle.id;version="1.0.0.qualifier";roots:="folder1,folder2"

[edit] build.properties

The build.properties file for the source bundle is pretty simple, just include all the files you want in your bundle. For instance:

bin.includes = about.html,\
               about_files/,\
               plugin.properties,\
               META-INF/,\
               javax/