Community
Participate
Working Groups
Build Identifier: 20100917-0705 I built an additional actor for p2 site rebuilding. It starts the same routine as antRunner target "p2.process.artifacts". My reason was, that I needed recomputed MD5 sums in the artifacts.xml. Maybe other targets from p2_repositorytasks could also be helpful. (http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_repositorytasks.htm) I will attach my current quick-and-dirty plugin which registers a "p2SiteRebuilder" actor. Reproducible: Always
Created attachment 203773 [details] Plugin which registers "p2SiteRebuilder"
I think this could be useful. I've also written a cspex extension for several features at work that calls the p2.composite.repository task to add the latest 'site.p2' output of a feature to a feature composite repository. That way the composite repo contains all versions of my feature e.g. feature.a/ feature.a_1.0.0/ feature.a_1.1.0/ feature.a_2.0.0/ compositeArtifacts.jar compositeContents.jar It might be nice to have this as a built-in task...
Sounds great to me! Would be very useful for us. Could you supply a little snippet or even a zipped plugin project? Thanks in advance, R.O. (In reply to comment #2) > I think this could be useful. I've also written a cspex extension for several > features at work that calls the p2.composite.repository task to add the latest > 'site.p2' output of a feature to a feature composite repository. That way the > composite repo contains all versions of my feature e.g. > feature.a/ > feature.a_1.0.0/ > feature.a_1.1.0/ > feature.a_2.0.0/ > compositeArtifacts.jar > compositeContents.jar > > It might be nice to have this as a built-in task...
Looks very useful to me too. In order to add this actor we go through some bureaucracy to satisfy the Eclipse EMO. I need you to change the source with respect to the following: 1. All source must have a header that contains something similar to this: /**************************************************************************** * Copyright (c) 2011, <your company name> * The code, documentation and other materials contained herein have been * licensed under the Eclipse Public License - v 1.0 by the copyright holder * listed above, as the Initial Contributor under such license. The text of * such license is available at www.eclipse.org. * * Contributors: * <your name> - initial API and implementation ***************************************************************************/ 2. The source must be moved to a bundle named 'org.eclipse.buckminster.xxx'. I suggest that 'xxx' in this case should be 'p2.actor'. 3. Use 'Eclipse Buckminster Project' as the Bundle-Vendor (we are responsible for maintaining this bundle and might also decide to add more actors in the future). 4. The package must be renamed in accordance with the bundle name. 5. Please remove the bundle Activator (can't see that it's used anywhere) and all depenedencies to org.eclipse.ui. It's important that Buckminster can run headless without being polluted by large amount of bundles that a ui dependency brings in. I also need a statement from you (as a comment in this bugzilla) with a text similar to "I hereby declare that I have authored the code, that I have the rights to donate the code to Eclipse, and that I am submitting the code for inclusion in future Eclipse releases under the Eclipse Public License"
Oh, and I almost forgot. You need to provide some text explaining how to use this actor that we can add to the Buckminster documentation.
Created attachment 208807 [details] EPL conform bundle version (with untested "p2 mirror task") here we go, an EPL conform version, sorry for the delay
And now my declaration concenring the attached source bundle (org.eclipse.buckminster.p2.actor): I hereby declare that I have authored the code, that I have the rights to donate the code to Eclipse, and that I am submitting the code for inclusion in future Eclipse releases under the Eclipse Public License.
At last, some uncertainties/thoughts: - I am still not quite sure, if the name "site rebuilder" is that senseful... - The used Classes/Methods are p2 "internal" classes. Could get broken on future versions - I have added a first try for a "p2 mirror" actor. Yet untested. We still use the regular ant target. But I will come back with my results. Ok, now some short words on usage: Simply use the actor in a public target and provide the affected repository as "site" alias. The following example should work. But Attention! The affected repo is NOT copied, instead the routine directly works on the given site and recomputes checksums, removes missing IUs, etc. <public name="site.rebuilt.p2" actor="p2SiteRebuilder"> <prerequisites> <attribute name="site.p2" alias="site"/> </prerequisites> <products base="${buckminster.output}/site.p2/" upToDatePolicy="ACTOR" /> </public> Mirror actor uses the "output path" as the target repo for the mirror task.
Created attachment 208841 [details] EPL conform bundle version (with working "p2 mirror task") Forgot to register an extension for the new mirror actor. Fixed some copy/paste issues.
Usage for mirror actor (as a sequel to the "rebuild" actor example): <public name="site.mirror.p2" actor="p2SiteMirror"> <prerequisites> <attribute name="site.rebuilt.p2" alias="site"/> </prerequisites> <products base="${buckminster.output}/../../../merged-update-site" upToDatePolicy="ACTOR" /> </public> Result is: A update-site containing all of the previous bundles, features and products, as well as the new ones from the "site.rebuilt.p2" p2-update-site. Main advantage over composite p2 site is: The new products are merged into the existing repo, avoiding identical 3rd party bundles to be redundantly copied for every single merged p2 repo. This way all identical (3rd party) bundles are shared by all products/features in the resulting p2 site. Have fun with it!
Created attachment 208845 [details] EPL conform bundle version (with working "p2 mirror" and "p2 director" actor) Ok. Meanwhile I have additionally added the "p2Director" actor. All properties are routed to p2 director, as long as they are valid ones. Prerequisite with alias "repository" or "repositories" is put into the property map as the source repo(s). When p2.os, p2.ws or p2.arch are not set BUT are available as global properties "target.os/ws/arch" then they are also put into property map accordingly. Empty values (as in "roaming") are omitted. Only the key is then taken into property list that is given to p2 director. Output path of product definition is taken as destination for the p2 installation. An example cspex entry: <public name="create.product" actor="p2Director"> <properties> <property key="profile" value="OptiTax" /> <property key="profileProperties" value="org.eclipse.update.install.features=true" /> <property key="installIU" value="com.hsp.optitax.product" /> <!-- property key="p2.os" value="win32" /--> <!-- property key="p2.ws" value="win32" /--> <!-- property key="p2.arch" value="x86" /--> <property key="roaming" value="" /> <property key="purgeHistory" value="" /> </properties> <prerequisites> <attribute name="mirror.p2.site.rebuild" alias="repository"/> </prerequisites> <products base="${buckminster.output}"> <path path="optitax.sealed.${target.ws}.${target.os}.${target.arch}/" /> </products> </public>
Created attachment 208847 [details] EPL conform bundle version (with working "p2 mirror" and "p2 director" actor) BugFixed case sensitivity issue in p2 director actor.