Community
Participate
Working Groups
I20080401-0851 When I export plug-ins I get a p2repo in the export with content.xml and artifacts.xml (and plugins). However, I cannot install any plug-ins from the "Software Updates..." UI. According to Pascal, the repo is created with the correct metadata, but the UI is only showing groups (features). If we can't import from the repo we should not create it... however, I would rather see the repo created with the appropriate metadata such that we *could* install from it. This feels like a good story for the common scenario of running with the latest plug-ins.
Andrew, currently we set the following properties during the plug-in export. Is there something else we have to set in order to create an appropriate feature/group to support the install? fAntBuildProperties.put("generate.p2.metadata", "true"); fAntBuildProperties.put("p2.flavor", "tooling"); fAntBuildProperties.put("p2.publish.artifacts", "true"); try { fAntBuildProperties.put("p2.metadata.repo", new File(fInfo.destinationDirectory, "p2repo").toURL().toString()); fAntBuildProperties.put("p2.artifact.repo", new File(fInfo.destinationDirectory, "p2repo").toURL().toString()); } catch (MalformedURLException e) { PDECore.log(e); }
For the UI to present it as an available IU, it needs to have IInstallableUnit.PROP_TYPE_GROUP ("org.eclipse.equinox.p2.type.group") set to true.
PDE.Build generates 2 kinds of assemble/package scripts: package.<feature>.all.xml package.<feature>.<config>.xml The integration with p2 occurs in both these script, the package.<feature>.<config>.xml will call p2 to generate IUs for bundles as well as configuration CUs. The package.<feature>.all.xml contains a final call to p2 to generate a top level root or product IU containing everything that was built. PDE.UI calls the assemble.<feature>.<config>.xml scripts directly and does not go through the .all.xml script so the final top level IU is missing. UI will need to make an additional runScript call to invoke the "generate.p2.metadata" target in the package.<feature>.all.xml script.
After adding a call to the generate.p2.metadata target in the script, I still do not get a group/feature to import. The call to the script completes successfully, no errors, all the needed properties are set. However, none of the exported files get modified. Any suggestions?
Created attachment 95730 [details] Change to PDE UI to call second script Quick patch that adds the call to the second script.
Simply calling the second script is not satisfactory. The script does not have the necessary information (state). PDE-Build/p2 is looking into it.
Sorry, I thought I wrote a comment here on friday, but it looks like I neglected to hit the commit button. Problem stems from how the AntRunner uses class loaders. As well, the way that separate platforms are built independently of each other means that the final p2 call to create the container really needs to happen after all the platforms are built.
I have released changes to HEAD for pde.build and p2.metadata.generator. For feature and plugin exports for a single platform, PDE/UI needs to set "p2.root.name" and "p2.root.version" properties to give a name and version to the top level root IU for the export. I'm not sure where you should get values for these, some new UI might be necessary. For products, name and version come from the .product file, see bug 218672. For multiplatform exports, this final call to p2 needs to happen after all platforms are done.
We decided that export will only do p2 generation for products. For p2 generation for product export, pde.build needs to generate a script UI can call to do the final IU generation (due to the independent builds for each platform). This final call will be equivalent to the final p2 call in the package all script. The root.name and version properties remain in place for use during a headless build.
Renaming to reflect new priority.
Created attachment 96524 [details] example changes PDE.Build changes are done. See attached patch for beginnings of how to use these changes.
Created attachment 96931 [details] Fix for PDE Core This patch adds support to PDE Core to generate p2 metadata. Everything seems fine and well in my testing, but it would be awesome if others could test the patch before it gets committed.
cc'ing Chris, as he knows more about testing product export.
Will test after the 4/22 i-build. Looks clean for now.
btw, Thanks for your hard work on this Curtis
I will review this on the plane more in depth before I feel comfortable. A long plane ride is enough time to test some scenarios ;)
I don't like the user experience of this at all... I'm thinking a preference to "Include generated repository" as an option that is off by default. The fact that we generate duplicates of everything is really confusing for users. Will investigate tomorrow further.
done. > 20080428 Added a preference that is off by default for this option. We can revisit how to make this a smoother experience in 3.5... I would really prefer that metadata generation be done via the Update Site mechanism in Eclipse... versus this way.
Created attachment 97761 [details] mylyn/context/zip