Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 260582

Summary: Provide a utility that extracts a repo in simili runnable form
Product: [Eclipse Project] PDE Reporter: Pascal Rapicault <pascal>
Component: BuildAssignee: DJ Houghton <dj.houghton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, curtis.windatt.public, darin.eclipse, jeffmcaffer, john.arthorne, tjwatson
Version: 3.5   
Target Milestone: 3.5 M5   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Using the transformer into the build
none
New patch using the newly renamed task none

Description Pascal Rapicault CLA 2009-01-09 14:31:03 EST
In order to address build issues, we need to have a utility mostly targeted at PDE Build, that will take a repo and create a format that can be compiled against.
Comment 1 DJ Houghton CLA 2009-01-15 17:24:00 EST
I have a class (can be called from Java, as an Eclipse application, or from an Ant task) which does the following:

Input: 
- source artifact repo URI
- source metadata repo URI OR list of IUs
- destination artifact repo - where to publish the artifacts
- destination metadata repo (optional - if specified we publish the metadata here)

Output:
- The artifacts in the destination will have been processed to be in a runnable/compilable form. That is, directory-based bundles will be extracted into folders and packed JARs will be un-packed.
- There will be a content.xml file with the metadata for the IUs, if requested

Is there anything else that we need from the transformer?

Originally I wrote this to be part of PDE/Build but I have since moved it into its own bundle. I'm not sure where it should live. I almost want to say in the p2.tools bundle but I think it will be used often enough that we shouldn't label it as an "extra tool which is nice to have".


Comment 2 Andrew Niefer CLA 2009-01-16 11:30:52 EST
>- source metadata repo URI OR list of IUs

Should it not be possible to specify both?
If we specify a destination metadata repo, then we need a source metadata repo.  But we could still only want a list of IUs out of that repo and not the whole thing.

Perhaps this is possible already and I'm just misreading your comment.
Comment 3 Pascal Rapicault CLA 2009-01-16 16:09:58 EST
> - destination metadata repo (optional - if specified we publish the metadata here)
  By default the metadata should be kept.
Comment 4 DJ Houghton CLA 2009-01-19 16:47:45 EST
(In reply to comment #2)
> >- source metadata repo URI OR list of IUs
> 
> Should it not be possible to specify both?
> If we specify a destination metadata repo, then we need a source metadata repo.
>  But we could still only want a list of IUs out of that repo and not the whole
> thing.
> 
> Perhaps this is possible already and I'm just misreading your comment.
> 

I believe if you are specifying the list of IUs to process (instances of IInstallableUnit) then you don't need the metadata repository... you already have everything you need to populate the destination metadata repository.

If we decide to allow a list of IUs via the command-line or from the Ant task (currently it is only available through Java APIs) then we will have to decide how to pass that info (String ID and String Version pairs?) in which case we would have to have access to a source repository to do the initial look-up.

Re: comment #3 - I will make this change to the default behaviour

Comment 5 DJ Houghton CLA 2009-01-19 17:20:17 EST
Added Jeff to the CC for comment. Perhaps the code should live in the publisher?
Comment 6 Jeff McAffer CLA 2009-01-19 20:05:57 EST
this feels a lot like a variation on the mirroring app.  Something along the lines of the one that we were trying to do in the tools bundle some time ago.
Comment 7 DJ Houghton CLA 2009-01-20 09:49:23 EST
Yes I was thinking the same thing but the problem is that bundles in the SDK will be using this tool and the p2.tools bundle isn't currently shipped with the SDK. I don't think we should add it to the SDK so that's why I'm looking for a new home... unless we want to ship p2.tools?

Comment 8 Pascal Rapicault CLA 2009-01-21 17:32:42 EST
Created attachment 123304 [details]
Using the transformer into the build

This is an initial attempt at adding automatic transformation of repositories as part of PDE Build. 
A few things to review for:
 - the name of the variables and targets
 - the preProcess target uses subant setting buildpath to .
 - do we want to "hide" the transformedRepoLocation variable instead of exposing it directly in the scripts
 - the syntax for the p2.transform task is not final and so genericTargets.xml may need updating.
Comment 9 Pascal Rapicault CLA 2009-01-23 11:44:16 EST
Created attachment 123553 [details]
New patch using the newly renamed task

Andrew could you please take a look and release for the next I build.
Comment 10 DJ Houghton CLA 2009-01-23 11:45:11 EST
After long discussions about where to put this application (publisher,
pde.build, new bundle) we have decided to put it into a new bundle. 

bundle: org.eclipse.equinox.p2.repository.tools
application.id: org.eclipse.equinox.p2.repository.repo2runnable
ant task: p2.repo2runnable

We decided that the function of the tool is to convert a repository to runnable
form, so that's why we named it that. No its not great, and any suggestions for
better names will be entertained.

Map files, project set files, features, have all been updated.

Leaving this bug open until the changes in PDE/Build are addressed.
Comment 11 Andrew Niefer CLA 2009-01-23 17:23:20 EST
Released with the following small changes:
- added an optional dependency on org.eclipse.equinox.p2.repository.tools
- added inheritAll="true" to the subant calls

transformedRepoLocation may need its own attribute in the future instead of going on pluginPath, build will need to pass repo locations to publisher.  The other option is to try and check all pluginPath entries to see if they are a repo.

see bug 262253 for the packager