• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Building a p2 update site using Buckminster
 

Building a p2 update site using Buckminster

on

  • 7,649 views

 

Statistics

Views

Total Views
7,649
Views on SlideShare
7,584
Embed Views
65

Actions

Likes
2
Downloads
67
Comments
0

1 Embed 65

http://www.slideshare.net 65

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Building a p2 update site using Buckminster Building a p2 update site using Buckminster Presentation Transcript

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