Jump to: navigation, search

Difference between revisions of "Orbit Source Bundles"

(Uploaded new SourceGen.zip with Launch Configuration for one-touch source bundle generation)
Line 58: Line 58:
 
To use the utility:
 
To use the utility:
 
* import the archive in your workspace
 
* import the archive in your workspace
* edit the build.xml to refer to the location of the bundle for which source is being generated
+
* import the <tt style="color:DarkGreen">Create Orbit Source Bundle.launch</tt> launch config into your External Tools... menu
* execute the script
+
* select the Orbit bundle project for which you want to create your source bundle
+
* execute the <tt style="color:DarkGreen">Create Orbit Source Bundle</tt> launch configuration
 +
 
 +
The script will automatically append " Source Bundle" to the bundle name in the source bundle's <tt style="color:DarkGreen">plugin.properties</tt>
 +
file and attempt to update your project's <tt style="color:DarkGreen">.classpath</tt> to reference the new location of the source ZIP.
 +
Also, it will attempts to account for the possibility of your original source ZIP having been named something other than
 +
<tt style="color:DarkGreen">src.zip</tt>.
 +
If that doesn't quite work, then just delete the <tt style="color:DarkGreen">&lt;regexpmapper&gt;</tt> element in the appropriate
 +
<tt style="color:DarkGreen">&lt;copy&gt;</tt> task and fix up file names ''post hoc''.
 +
 
 
http://wiki.eclipse.org/index.php/Image:SourceGen.zip
 
http://wiki.eclipse.org/index.php/Image:SourceGen.zip
 
[[Category : Orbit]]
 
[[Category : Orbit]]

Revision as of 10:17, 29 May 2007

Created from bug 184026.

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

We highly recommend the usage of the script attached at the bottom of this page (sourcegen.zip), since it will create the right shape and do almost all the necessary steps.

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... The zip files containing the source should follow a strict structure (see example below) and should be named after the entries specified in the BundleClasspath of the manifest.mf.

{plugin_root}
	META-INF/MANIFEST.MF
	plugin.xml
	plugin.properties
	build.properties
	{class_files}
	...
	source-bundle/
		META-INF/MANIFEST.MF
		plugin.xml
		build.properties
		customCallbacks.xml
		...
		src/{plugin_id}_{version}/src.zip

Example for junit 3.8.2

org.junit
	META-INF/MANIFEST.MF
	plugin.properties
	build.properties
	junit.jar
	source-bundle/
		META-INF/MANIFEST.MF
		plugin.xml
		build.properties
		customCallbacks.xml
		src/org.junit_3.8.2/junitsrc.zip

customCallbacks.xml

Copy the customCallbacks from the sourceGen.zip available at the bottom of this page.

build.properties

Add the following entries to the build.properties of the source bundle.

customBuildCallbacks=customCallbacks.xml
customBuildCallbacks.inheritall=true               


Utility to generate source bundles

Given an orbit bundle loaded in your workspace, the attached script will generate a corresponding source bundle following the shape described above. To use the utility:

  • import the archive in your workspace
  • import the Create Orbit Source Bundle.launch launch config into your External Tools... menu
  • select the Orbit bundle project for which you want to create your source bundle
  • execute the Create Orbit Source Bundle launch configuration

The script will automatically append " Source Bundle" to the bundle name in the source bundle's plugin.properties file and attempt to update your project's .classpath to reference the new location of the source ZIP. Also, it will attempts to account for the possibility of your original source ZIP having been named something other than src.zip. If that doesn't quite work, then just delete the <regexpmapper> element in the appropriate <copy> task and fix up file names post hoc.

http://wiki.eclipse.org/index.php/Image:SourceGen.zip