Buckminster Building it all with Buckminster and p2 Eclipse Con, March 2009 Henrik Lindberg, Cloudsmith Inc
AGENDA <ul><li>Overview of Buckminster </li></ul><ul><li>Show how easy it is to use Buckminster to materialize  and build ...
AT A GLANCE <ul><li>Buckminster: </li></ul><ul><li>Materializes components to a location (e.g. workspace) </li></ul><ul><l...
TRANSITIVE MATERIALIZATION <ul><li>When working on A, components B and C are also needed, and they need D, and E, and … </...
WHERE DOES BUCKMINSTER  GET COMPONENTS? RMAP B F G A H C D E
WHERE DOES BUCKMINSTER  MATERIALIZE COMPONENTS? using p2 in 3.5  –  UM in earlier B F G A H C D E workspace “ eclipse” tar...
Give me A. HOW DO YOU TELL BUCKMINSTER WHAT YOU WANT? Component QUERY
AT BUCKY BURGER Give me A. ok
BUCKY DELICATESSEN source or binary? mutable or not? for here or for to go? we are out of binaries  –  do you want the sou...
Give me A. TO SUMMARIZE … B F G A H C D E
COMPONENT  –  WHAT IS IT? <ul><li>Buckminster: </li></ul><ul><li>A “Component Reader” gets existing meta data from compone...
META DATA UNDERSTOOD BY BUCKMINSTER The meta data translation  can be decorated/extended with the use of a Component Speci...
ORGANIZING THE MAPS PB-MAP RMAP B F G A H C D E RMAP RMAP
ROUTING B F G A H C D E
DEPENDENCIES AND VERSIONS <ul><li>Describes; if a component is needed which version (or range of versions) is acceptable <...
OMNI VERSION <ul><li>A “universal” canonical format </li></ul><ul><li>Backwards compatible with Buckminster < 3.5  –  the ...
ATTRIBUTES & ACTIONS <ul><li>Attributes represents artifact groups </li></ul><ul><li>Can have pre-requisites on other attr...
ATTRIBUTES & ACTIONS <ul><li>Action attributes produce artifacts </li></ul><ul><ul><li>Eclipse builds </li></ul></ul><ul><...
BUILT IN ACTIONS <ul><li>Buckminster includes a set of actions immediately available for bundles, features and products. <...
LOOK MA, NO HEAD ! <ul><li>Makes interactive and headless builds the same ! </li></ul><ul><li>Runs exactly the same builde...
Build me A product BUCKMINSTER IN ONE SLIDE Thank you! B F G A H C D E
Demo Build the “RCP mailapp” with support for p2 self management Tutorial projects ( org.eclipse.buckminster.tutorial.*)  ...
Demo Projects Overview projects: org.eclipse.buckminster.tutorial...  The “mailapp” example RCP app - but .product broken ...
Materialize releng
Build the site with everything product.feature
Properties <ul><li># Where all the output should go </li></ul><ul><li>buckminster.output.root =${user.home}/bmturorial </l...
Install and Update <ul><li>We now have a p2 update site on our disk (under output root): </li></ul><ul><li>o.e.b.tutorial....
Installer properties <ul><li>In a properties file (mailapp_install.properties): </li></ul><ul><li>eclipse.p2.metadata =  f...
Adding categories <ul><li>Define categories in the projects build properties. </li></ul><ul><li>Define the category “maila...
The RMAP <ul><li>Search path entries – for RELEASE, N, I, and M builds, and Galileo </li></ul><ul><li><searchPath name= &q...
The RMAP - TBD <ul><li>My project – built from source </li></ul><ul><li><searchPath name= &quot;org.eclipse.buckminster” >...
The RMAP <ul><li>Specify the default type of build to use </li></ul><ul><li><property key=&quot;useBuild&quot; value= &quo...
A headless build <ul><li>Create   and   populate   the   workspace </li></ul><ul><li>buckminster import <path/url to cquer...
Update <ul><li>Modify the version of the rcpp2 feature </li></ul><ul><li>Build ”site.p2” again </li></ul><ul><li>Run the a...
TO RUN THE DEMO <ul><li>You need Eclipse 3.5 >= “N 0318” </li></ul><ul><li>Install Buckminster  –  follow instructions at ...
Build me A product BUCKMINSTER IN ONE SLIDE Thank you! B F G A H C D E
VISIT US AT http://www.eclipse.org/buckminster http://wiki.eclipse.org/Buckminster_Project
More Links <ul><li>How to make RCP app self managed :  http://wiki.eclipse.org/Equinox/p2/Adding_Self-Update_to_an_RCP_App...
Upcoming SlideShare
Loading in …5
×

Building a p2 update site using Buckminster

6,233 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,233
On SlideShare
0
From Embeds
0
Number of Embeds
68
Actions
Shares
0
Downloads
72
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Building a p2 update site using Buckminster

    1. 1. Buckminster Building it all with Buckminster and p2 Eclipse Con, March 2009 Henrik Lindberg, Cloudsmith Inc
    2. 2. AGENDA <ul><li>Overview of Buckminster </li></ul><ul><li>Show how easy it is to use Buckminster to materialize and build an Eclipse RCP application in the IDE, and Headless. </li></ul>
    3. 3. AT A GLANCE <ul><li>Buckminster: </li></ul><ul><li>Materializes components to a location (e.g. workspace) </li></ul><ul><li>Produces new artifacts inside or outside of the workspace (i.e. ‘build’) </li></ul>A A
    4. 4. TRANSITIVE MATERIALIZATION <ul><li>When working on A, components B and C are also needed, and they need D, and E, and … </li></ul><ul><li>Buckminster materializes all pre-requisite components </li></ul><ul><li>Can take action into account – dependency followed only when needed. </li></ul>A B C D E F G H
    5. 5. WHERE DOES BUCKMINSTER GET COMPONENTS? RMAP B F G A H C D E
    6. 6. WHERE DOES BUCKMINSTER MATERIALIZE COMPONENTS? using p2 in 3.5 – UM in earlier B F G A H C D E workspace “ eclipse” target pl. file system
    7. 7. Give me A. HOW DO YOU TELL BUCKMINSTER WHAT YOU WANT? Component QUERY
    8. 8. AT BUCKY BURGER Give me A. ok
    9. 9. BUCKY DELICATESSEN source or binary? mutable or not? for here or for to go? we are out of binaries – do you want the source instead ? Give me A, hold the mayo! override that broken provolone 2.0 ? 日本語 , or English ?
    10. 10. Give me A. TO SUMMARIZE … B F G A H C D E
    11. 11. COMPONENT – WHAT IS IT? <ul><li>Buckminster: </li></ul><ul><li>A “Component Reader” gets existing meta data from component and translates it “on the fly” to a Component Specification (CSPEC) </li></ul><ul><li>If meta data does not exist – author the CSPEC </li></ul><ul><li>Benefit: </li></ul><ul><li>No roundtrip engineering! </li></ul><ul><li>Everything is maintained in the original format (which is needed for other purposes). </li></ul>requires contains provides includes actions, build requires actions, source binary meta data source documentation
    12. 12. META DATA UNDERSTOOD BY BUCKMINSTER The meta data translation can be decorated/extended with the use of a Component Specification Extension (CSPEX) B A C D E
    13. 13. ORGANIZING THE MAPS PB-MAP RMAP B F G A H C D E RMAP RMAP
    14. 14. ROUTING B F G A H C D E
    15. 15. DEPENDENCIES AND VERSIONS <ul><li>Describes; if a component is needed which version (or range of versions) is acceptable </li></ul><ul><li>Uses “OmniVersion” – a pattern based version descriptor (contributed to p2). </li></ul>1.0 [1.0.0,2.0.0) A B C D E F G H
    16. 16. OMNI VERSION <ul><li>A “universal” canonical format </li></ul><ul><li>Backwards compatible with Buckminster < 3.5 – the version-type simply selects a preconfigured version format. </li></ul><ul><li>OSGi is the default, all other formats must be specified with a predefined or stated format/pattern. </li></ul><ul><li>Learn more at http://wiki.eclipse.org/Equinox/p2/Omni_Version </li></ul>format( n[.n=0;[.n=0;[.S=[a-zA-Z0-9_-];]]] ): 1.0.0.r1234 format( n[.n=0;[.n=0;]][d?S=m;] ): 1.0.0 format( <[n:]a(d?a)*>[-n[dS=!;]] ): 33:1.2.3a-23/i386 osgi triplet rpm
    17. 17. ATTRIBUTES & ACTIONS <ul><li>Attributes represents artifact groups </li></ul><ul><li>Can have pre-requisites on other attributes </li></ul><ul><ul><li>Same or other component </li></ul></ul><ul><li>Attributes are static or computed (the result of actions) </li></ul>A compile B lib headers
    18. 18. ATTRIBUTES & ACTIONS <ul><li>Action attributes produce artifacts </li></ul><ul><ul><li>Eclipse builds </li></ul></ul><ul><ul><li>ANT tasks </li></ul></ul><ul><li>Extension point </li></ul><ul><ul><li>Maven </li></ul></ul><ul><ul><li>Your own </li></ul></ul>A compile B lib headers <<private>> makeLib
    19. 19. BUILT IN ACTIONS <ul><li>Buckminster includes a set of actions immediately available for bundles, features and products. </li></ul><ul><ul><li>builds all binaries </li></ul></ul><ul><ul><li>builds all source features/bundles </li></ul></ul><ul><ul><li>(steps available as separate actions too) </li></ul></ul><ul><li>Build update site </li></ul><ul><ul><li>compiled, signed, pack-200 processed, and packaged as a p2 update site! </li></ul></ul><ul><li>Build complete product </li></ul><ul><ul><li>complete build to p2 update site </li></ul></ul>A site.p2
    20. 20. LOOK MA, NO HEAD ! <ul><li>Makes interactive and headless builds the same ! </li></ul><ul><li>Runs exactly the same builders the same way </li></ul><ul><li>No need to maintain an extra set of build actions </li></ul>
    21. 21. Build me A product BUCKMINSTER IN ONE SLIDE Thank you! B F G A H C D E
    22. 22. Demo Build the “RCP mailapp” with support for p2 self management Tutorial projects ( org.eclipse.buckminster.tutorial.*) are found in Buckminster SVN repository: http://dev.eclipse.org/svnroot/tools/org.eclipse.buckminster/trunk
    23. 23. Demo Projects Overview projects: org.eclipse.buckminster.tutorial... The “mailapp” example RCP app - but .product broken out Contains .product – refers only to this feature. Feature includes mailapp, and rcpp2.feature and everything required. Contains everything needed to make mailapp p2 self managed. A feature containing queries and definitions for Common Build Infrastructure CBI. .product mailapp product.feature rcpp2.feature releng
    24. 24. Materialize releng
    25. 25. Build the site with everything product.feature
    26. 26. Properties <ul><li># Where all the output should go </li></ul><ul><li>buckminster.output.root =${user.home}/bmturorial </li></ul><ul><li># Where the temp files should go </li></ul><ul><li>buckminster.temp.root =${user.home}/tmp/bmtutorial.tmp </li></ul><ul><li># How .qualifier in versions should be replaced </li></ul><ul><li>qualifier.replacement.* =generator:lastRevision </li></ul><ul><li># How the qualifier (last revision) should be formatted </li></ul><ul><li>generator.lastRevision.format =r{0,number,00000} </li></ul><ul><li># If a site should use pack200, turn off for faster build </li></ul><ul><li># site.pack200 =true </li></ul><ul><li># If a site should be signed </li></ul><ul><li># site.signing =true </li></ul><ul><li># If a site should be signed locally, or remotely at Eclipse </li></ul><ul><li># signing.type =eclipse.remote </li></ul><ul><li># Should local signing be performed </li></ul><ul><li># local.sign =true </li></ul><ul><li># Should source bundles be built and included </li></ul><ul><li>cbi.include.source =false </li></ul><ul><li># What platforms should be built, * for &quot;all&quot; </li></ul><ul><li>target.os =* </li></ul><ul><li>target.ws =* </li></ul><ul><li>target.arch =* </li></ul>
    27. 27. Install and Update <ul><li>We now have a p2 update site on our disk (under output root): </li></ul><ul><li>o.e.b.tutorial.mailapp.product.feature_1.0.0-eclipse.feature/site.p2 </li></ul><ul><li>We need to install our mailapp to try it out using one of: </li></ul><ul><ul><li>the p2.installer application (download from RT/provisioning > march 18) </li></ul></ul><ul><ul><li>headless director from buckminster download </li></ul></ul><ul><ul><li>the director.app from the command line (embedded in the IDE) </li></ul></ul><ul><ul><li>a launch configuration in the IDE that runs the director.app </li></ul></ul><ul><li>Install using the p2 installer to try it out </li></ul><ul><li>We need, the installer, and a modified installer.properties file </li></ul>
    28. 28. Installer properties <ul><li>In a properties file (mailapp_install.properties): </li></ul><ul><li>eclipse.p2.metadata = file:<path to p2 site> </li></ul><ul><li>eclipse.p2.artifacts = file:<path to p2 site> </li></ul><ul><li>eclipse.p2.rootId = org.eclipse.buckminster.tutorial.mailapp.product </li></ul><ul><li>eclipse.p2.profileName = Mailapp </li></ul><ul><li>eclipse.p2.launcherName = eclipse </li></ul><ul><li>eclipse.p2.flavor = tooling </li></ul><ul><li>eclipse.p2.autoStart = true </li></ul><ul><li>Make installer use the properites: </li></ul><ul><li>-vmargs </li></ul><ul><li>-Dorg.eclipse.equinox.p2.installDescription= file:<path to properties> </li></ul>
    29. 29. Adding categories <ul><li>Define categories in the projects build properties. </li></ul><ul><li>Define the category “mailapp” </li></ul><ul><li>category.id. mailapp =Mailapp Demo </li></ul><ul><li>List the feature ids (,) that should be in this category </li></ul><ul><li>category.members. mailapp = </li></ul><ul><li>org.eclipse.buckminster.tutorial.mailapp.product.feature </li></ul><ul><li>Add a description </li></ul><ul><li>category.description. mailapp =Mailapp BM build demo </li></ul><ul><li>Use qualified id such as: </li></ul><ul><li>category.id. org.myorg.main =My Main Product </li></ul><ul><li>category.id. org.myorg.options =My Main Product Options </li></ul>
    30. 30. The RMAP <ul><li>Search path entries – for RELEASE, N, I, and M builds, and Galileo </li></ul><ul><li><searchPath name= &quot; org.eclipse.platform.RBUILD &quot; > </li></ul><ul><li><provider readerType= &quot;eclipse.import&quot; componentTypes= &quot;osgi.bundle,eclipse.feature&quot; mutable= &quot;false&quot; source= &quot;false&quot; > </li></ul><ul><li><uri format= &quot;http://download.eclipse.org/eclipse/updates/3.4?importType=binary&quot; /> </li></ul><ul><li></provider> </li></ul><ul><li></searchPath> </li></ul><ul><li>Search path e ntry for Orbit </li></ul><ul><li><searchPath name=&quot;orbit&quot;> </li></ul><ul><li><provider readerType= &quot;eclipse.import&quot; componentTypes= &quot;osgi.bundle&quot; mutable= &quot;false&quot; source= &quot;false&quot; > </li></ul><ul><li><uri format= &quot;http://download.eclipse.org/tools/orbit/downloads/drops/S20090307012903/updateSite?importType=binary&quot; /> </li></ul><ul><li></provider> </li></ul><ul><li></searchPath> </li></ul>
    31. 31. The RMAP - TBD <ul><li>My project – built from source </li></ul><ul><li><searchPath name= &quot;org.eclipse.buckminster” > </li></ul><ul><li><provider readerType= &quot;svn&quot; componentTypes= &quot;osgi.bundle,eclipse.feature,buckminster&quot; mutable= &quot;true” source= &quot;true” > </li></ul><ul><li><uri format= &quot;http://dev.eclipse.org/svnroot/tools/org.eclipse.buckminster/trunk/{0}? moduleAfterTag&amp;moduleAfterBranch&quot; > <bc:propertyRef key= &quot;buckminster.component&quot; /> </li></ul><ul><li></uri> </li></ul><ul><li></provider> </li></ul><ul><li></searchPath> </li></ul><ul><li>Search order </li></ul><ul><li><locator searchPathRef= &quot;org.eclipse.buckminster&quot; pattern= &quot;^org.eclipse.buckminster(..+)?&quot; /> </li></ul><ul><li><locator searchPathRef= &quot;org.eclipse.platform.${useBuild}&quot; failOnError= &quot;false&quot; /> </li></ul><ul><li><locator searchPathRef= &quot;org.eclipse.galileo&quot; failOnError= &quot;false&quot; /> </li></ul><ul><li><locator searchPathRef= &quot;orbit&quot; /> </li></ul>
    32. 32. The RMAP <ul><li>Specify the default type of build to use </li></ul><ul><li><property key=&quot;useBuild&quot; value= &quot;RBUILD&quot; /> </li></ul><ul><li>Override for some components in the query if needed </li></ul>
    33. 33. A headless build <ul><li>Create and populate the workspace </li></ul><ul><li>buckminster import <path/url to cquery> </li></ul><ul><li>Build everything to the p2 update site </li></ul><ul><li>buckminster perform o.e.b .tutorial.mailapp.product.feature#site.p2 --properties <path to properties> </li></ul><ul><li>To use other workspace than “Workspace” in current dir, add: </li></ul><ul><li>--data <path to workspace> </li></ul>
    34. 34. Update <ul><li>Modify the version of the rcpp2 feature </li></ul><ul><li>Build ”site.p2” again </li></ul><ul><li>Run the application – use ”install new software” (bugs in ”update” at the moment). </li></ul><ul><li>You may have to add the local update site as a repo (due to not yet fixed issues with installer). </li></ul><ul><li>See that there is a new version of the feature to install. </li></ul><ul><li>Select it, and the application is updated </li></ul>
    35. 35. TO RUN THE DEMO <ul><li>You need Eclipse 3.5 >= “N 0318” </li></ul><ul><li>Install Buckminster – follow instructions at http://www.eclipse.org/buckminster/downloads.html </li></ul><ul><li>Checkout org.eclipse.buckminster.tutorial.mailapp.releng from http://dev.eclipse.org/svnroot/tools/org.eclipse.buckminster/trunk </li></ul><ul><li>Open the “developer.cquery”, and click “Resolve & Materialize” – this populates your workspace </li></ul><ul><li>Now you have the full set of projects, and what you need to build as described in this presentation. </li></ul>
    36. 36. Build me A product BUCKMINSTER IN ONE SLIDE Thank you! B F G A H C D E
    37. 37. VISIT US AT http://www.eclipse.org/buckminster http://wiki.eclipse.org/Buckminster_Project
    38. 38. More Links <ul><li>How to make RCP app self managed : http://wiki.eclipse.org/Equinox/p2/Adding_Self-Update_to_an_RCP_Application </li></ul><ul><li>Download Buckminster : http://www.eclipse.org/buckminster/downloads.html </li></ul><ul><li>Buckminster wiki: http://wiki.eclipse.org/Buckminster_Project </li></ul>

    ×