Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Building an Update Site using Buckminster"
(New page: ==Creating the Update Site Project== #Right click in the Package Explorer and select ''New'' -> ''Project'' #In the ''New Project'' wizard that pops up, open the ''Plug-in Development'' fo...) |
|||
Line 1: | Line 1: | ||
+ | =Using Buckminster for Update Site building= | ||
+ | This is a step by step instruction on how to create an update site using Buckminster. It assumes that you already have some features that you want to include on the site and that you have the Buckminster core and pde support installed in the IDE. | ||
+ | |||
+ | Some names in this example are keywords that has to be entered verbatim. Such names are marked <font color=blue>in blue</font>. | ||
+ | |||
==Creating the Update Site Project== | ==Creating the Update Site Project== | ||
#Right click in the Package Explorer and select ''New'' -> ''Project'' | #Right click in the Package Explorer and select ''New'' -> ''Project'' | ||
#In the ''New Project'' wizard that pops up, open the ''Plug-in Development'' folder | #In the ''New Project'' wizard that pops up, open the ''Plug-in Development'' folder | ||
#Click on ''Update Site Project'' | #Click on ''Update Site Project'' | ||
− | #Give the project a name. | + | #Give the project a name. In this example we use '''org.test.update''' |
#Click on ''Finish'' | #Click on ''Finish'' | ||
Line 12: | Line 17: | ||
==Creating the Component Specification== | ==Creating the Component Specification== | ||
− | + | Buckminster describes all components in terms of CSPECs. The update site is no exception. Here are the steps to create such a CSPEC and enter the needed information: | |
− | + | ||
#Right click on the project and select ''New'' -> ''Other'' | #Right click on the project and select ''New'' -> ''Other'' | ||
#In the ''New'' wizard that pops up, open the ''Buckminster'' folder | #In the ''New'' wizard that pops up, open the ''Buckminster'' folder | ||
Line 19: | Line 23: | ||
#Click on ''Finish'' to accept the default values for ''Container:'' and ''File name:'' | #Click on ''Finish'' to accept the default values for ''Container:'' and ''File name:'' | ||
− | A file named '''buckminster.cspec''' is created in the project and the Buckminster CSPEC editor opens | + | A file named '''buckminster.cspec''' is created in the project and the Buckminster CSPEC editor opens. Do not change the name of this file. |
===Main information=== | ===Main information=== | ||
Line 30: | Line 34: | ||
#Click on the Artifacts tab | #Click on the Artifacts tab | ||
#Click on ''New'' below the Artifacts table | #Click on ''New'' below the Artifacts table | ||
− | #Enter | + | #Enter a name such as '''site.template''' |
#Click on the ''New'' button next to the ''Path'' table | #Click on the ''New'' button next to the ''Path'' table | ||
#Enter the name '''site.xml''' in the dialog that pops up and click ''OK'' | #Enter the name '''site.xml''' in the dialog that pops up and click ''OK'' | ||
Line 49: | Line 53: | ||
##Click ''OK'' | ##Click ''OK'' | ||
− | ===Groups | + | ===Groups=== |
− | + | The build action will expect one prerequisite that lists all the feature jars and one that lists all plugin jars. Luckely for us, Buckminster has already generated CSPEC's for all features with attributes that will provide just that. A feature will always have the two public attributes: | |
− | + | * '''feature.jars''' | |
− | + | :This is the transitive closure of all features (including the feature itself) in jared format. | |
− | + | * '''bundle.jars''' | |
− | + | :This is all the plugins that the transitive closure of all features is referencing in jared format. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | Since we don't have a feature that describes the update site itself, we need to create two new groups. One that group all the feature.jars together, and one that group all the bundle.jars together. | |
− | + | ||
− | + | ||
− | + | ||
#Click on ''New'' just below the Groups table | #Click on ''New'' just below the Groups table | ||
#Enter the name of the group. We call it '''feature.jars''' | #Enter the name of the group. We call it '''feature.jars''' | ||
− | #For each | + | #For each feature that should be included in this group |
##Click on ''New'' just next to the prerequisites table | ##Click on ''New'' just next to the prerequisites table | ||
− | + | ##Select a feature from the drop down menu. | |
− | ##Select | + | ##Enter the name <font color=blue>'''feature.jars'''</font> |
##Click OK | ##Click OK | ||
− | + | Repeat these steps for a group that is called '''bundle.jars''' that references the <font color=blue>'''bundle.jars'''</font> attribute of each feature. | |
− | + | ||
+ | ===Defining Site Categories=== | ||
+ | This step is optional unless you want to categorize the contents of the update site. In order to define a Site Category, you must first create the category in the '''site.xml''' file and then add it as a group in the CSPEC. | ||
+ | |||
+ | In order to create a category in the '''site.xml''' file, do the following: | ||
+ | #Double click on the '''site.xml''' file. The Update Site Editor opens | ||
+ | #On the ''Site Map'' tab, click ''New Category'' | ||
+ | #Give the category a name. In this example we will use '''Basic''' | ||
+ | #Add a label such as '''Basic features''' | ||
+ | |||
+ | Repeat these steps and create an additional categogy named '''Optional''' with label '''Optional features''' | ||
+ | |||
+ | Back to the CSPEC editor: | ||
+ | #Click on the ''Groups'' tab | ||
#Click on ''New'' just below the Groups table | #Click on ''New'' just below the Groups table | ||
− | #Enter the name of the group. | + | #Enter the name of the group, i.e. '''Basic''' |
#For each feature that should be included in this group | #For each feature that should be included in this group | ||
##Click on ''New'' just next to the prerequisites table | ##Click on ''New'' just next to the prerequisites table | ||
##Select a feature from the drop down menu. | ##Select a feature from the drop down menu. | ||
− | ##Enter the name ''' | + | ##Enter the name <font color=blue>'''feature.jars'''</font> |
##Click OK | ##Click OK | ||
− | If you follow the example, you now have four groups, Basic, Optional, feature.jars, and bundle.jars. | + | Repeat these steps for the '''Optional''' group. |
+ | |||
+ | Attributes, Groups, and Actions are all ''Attributes'' in Buckminster terms. A group contains attributes. Subsequently, a group can include other groups. This allows for a simplification of the '''feature.jars''' group that we created earlier. Instead of having that group include all features, it could instead include the two category groups, i.e. instead of having: | ||
+ | <pre> | ||
+ | feature.jars | ||
+ | a[feature.jars] | ||
+ | b[feature.jars] | ||
+ | c[feature.jars] | ||
+ | d[feature.jars] | ||
+ | |||
+ | Basic | ||
+ | a[feature.jars] | ||
+ | b[feature.jars] | ||
+ | |||
+ | Optional | ||
+ | c[feature.jars] | ||
+ | d[feature.jars] | ||
+ | </pre> | ||
+ | we can simplify and do | ||
+ | <pre> | ||
+ | feature.jars | ||
+ | [Basic] | ||
+ | [Optional] | ||
+ | |||
+ | Basic | ||
+ | a[feature.jars] | ||
+ | b[feature.jars] | ||
+ | |||
+ | Optional | ||
+ | c[feature.jars] | ||
+ | d[feature.jars] | ||
+ | </pre> | ||
+ | (the example assumes that a, b, c, and d are features and [xxx] denotes attribute xxx) | ||
+ | |||
+ | If you follow the example (simplification or not), you now have four groups, Basic, Optional, feature.jars, and bundle.jars. | ||
===The Action=== | ===The Action=== | ||
Line 93: | Line 135: | ||
##Enter the name '''build.site''' | ##Enter the name '''build.site''' | ||
##Put a check mark the ''Public'' checkbox | ##Put a check mark the ''Public'' checkbox | ||
− | ##Enter the ''Actor Name:'' '''ant''' | + | ##Enter the ''Actor Name:'' <font color=blue>'''ant'''</font> |
#Adding the site.template prerequisite | #Adding the site.template prerequisite | ||
##Click on the ''New'' button next to the ''Prerequisites'' table | ##Click on the ''New'' button next to the ''Prerequisites'' table | ||
##Leave ''Component'' blank (this means current component) | ##Leave ''Component'' blank (this means current component) | ||
##Select '''site.template''' from the ''Attribute'' combobox | ##Select '''site.template''' from the ''Attribute'' combobox | ||
− | ##Enter the ''Alias'' name '''template''' | + | ##Enter the ''Alias'' name <font color=blue>'''template'''</font> |
##Click OK | ##Click OK | ||
#Adding the rootFiles prerequisite | #Adding the rootFiles prerequisite | ||
Line 104: | Line 146: | ||
##Leave ''Component'' blank | ##Leave ''Component'' blank | ||
##Select '''site.rootFiles''' from the ''Attribute'' combobox | ##Select '''site.rootFiles''' from the ''Attribute'' combobox | ||
− | ##Enter the ''Alias'' name '''rootFiles''' | + | ##Enter the ''Alias'' name <font color=blue>'''rootFiles'''</font> |
##Click OK | ##Click OK | ||
#Adding the features | #Adding the features | ||
Line 110: | Line 152: | ||
##Leave ''Component'' blank | ##Leave ''Component'' blank | ||
##Select '''feature.jars''' from the ''Attribute'' combobox | ##Select '''feature.jars''' from the ''Attribute'' combobox | ||
− | ##Enter the ''Alias'' name '''features''' | + | ##Enter the ''Alias'' name <font color=blue>'''features'''</font> |
##Click OK | ##Click OK | ||
#Adding the plugins | #Adding the plugins | ||
Line 116: | Line 158: | ||
##Leave ''Component'' blank | ##Leave ''Component'' blank | ||
##Select '''bundle.jars''' from the ''Attribute'' combobox | ##Select '''bundle.jars''' from the ''Attribute'' combobox | ||
− | ##Enter the ''Alias'' name '''plugins''' | + | ##Enter the ''Alias'' name <font color=blue>'''plugins'''</font> |
##Click OK | ##Click OK | ||
#Adding general properties. These properties control the general behavior. | #Adding general properties. These properties control the general behavior. | ||
##In the middle pane, click on ''Properties'' | ##In the middle pane, click on ''Properties'' | ||
##Click on ''New'' next to the ''General Properties'' table | ##Click on ''New'' next to the ''General Properties'' table | ||
− | ##Enter ''Key'' '''site.name''' and a value such as '''test.archivedsite''' | + | ##Enter ''Key'' <font color=blue>'''site.name'''</font> and a value such as '''test.archivedsite''' |
##Click OK | ##Click OK | ||
##If you want your site to have some extra suffix such as ''_incubation'' then: | ##If you want your site to have some extra suffix such as ''_incubation'' then: | ||
###Click on ''New'' next to the ''General Properties'' table | ###Click on ''New'' next to the ''General Properties'' table | ||
− | ###Enter ''Key'' '''site.extra.suffix''' and a value such as '''_incubation''' | + | ###Enter ''Key'' <font color=blue>'''site.extra.suffix'''</font> and a value such as '''_incubation''' |
###Click OK | ###Click OK | ||
#Adding actor properties. These properties control behavior specific to an actor. We need two of them. One to specify the ant build script that will be used and another to specify what ant target to call in that file. | #Adding actor properties. These properties control behavior specific to an actor. We need two of them. One to specify the ant build script that will be used and another to specify what ant target to call in that file. | ||
##Click on ''New'' next to the ''Actor Properties'' table | ##Click on ''New'' next to the ''Actor Properties'' table | ||
− | ##Enter ''Key'' '''buildFileId''' and the value '''buckminster.pdetasks''' | + | ##Enter ''Key'' <font color=blue>'''buildFileId'''</font> and the value <font color=blue>'''buckminster.pdetasks'''</font> |
##Click OK | ##Click OK | ||
##Click on ''New'' again | ##Click on ''New'' again | ||
− | ##Enter ''Key'' '''targets''' and the value '''create.site''' | + | ##Enter ''Key'' <font color=blue>'''targets'''</font> and the value <font color=blue>'''create.site'''</font> |
##Click OK | ##Click OK | ||
#Finally, we must specify the product of this action and give it an alias that it passes on to Ant. | #Finally, we must specify the product of this action and give it an alias that it passes on to Ant. | ||
##Click on ''Products'' in the middle pane. | ##Click on ''Products'' in the middle pane. | ||
− | ##Enter the ''Product Alias'' '''action.output''' | + | ##Enter the ''Product Alias'' <font color=blue>'''action.output'''</font> |
##Enter the ''Product Base Path'' '''site/''' | ##Enter the ''Product Base Path'' '''site/''' | ||
Line 145: | Line 187: | ||
The output will end up in ${user.temp}/buckminster by default. You can change this by setting the property '''buckminster.output.root''' in a property file that you reference when you execute the action. You can also specify properties using ''Windows'' -> ''Preferences'' -> ''Run/Debug'' -> ''String substitution''. | The output will end up in ${user.temp}/buckminster by default. You can change this by setting the property '''buckminster.output.root''' in a property file that you reference when you execute the action. You can also specify properties using ''Windows'' -> ''Preferences'' -> ''Run/Debug'' -> ''String substitution''. | ||
+ | |||
+ | ==Headless builds== | ||
+ | The site can also be built from the command line using a headless setup. Simply issue the command: | ||
+ | <pre> | ||
+ | buckminster -d <your workspace> perform org.test.update#build.site | ||
+ | </pre> |
Revision as of 18:52, 9 January 2008
Using Buckminster for Update Site building
This is a step by step instruction on how to create an update site using Buckminster. It assumes that you already have some features that you want to include on the site and that you have the Buckminster core and pde support installed in the IDE.
Some names in this example are keywords that has to be entered verbatim. Such names are marked in blue.
Creating the Update Site Project
- Right click in the Package Explorer and select New -> Project
- In the New Project wizard that pops up, open the Plug-in Development folder
- Click on Update Site Project
- Give the project a name. In this example we use org.test.update
- Click on Finish
The project appears in the workspace and it contains one single file, an empty site.xml. Buckminster will use this as the update site template. This means that you can add site categories to this file but you should not add any features. Buckminster will generate a new site.xml where the features are added.
Creating an index.html file
Just create an empty file for now and call it index.html. You can add content to this file that will be what the user will see if they happen to access your update site with a browser.
Creating the Component Specification
Buckminster describes all components in terms of CSPECs. The update site is no exception. Here are the steps to create such a CSPEC and enter the needed information:
- Right click on the project and select New -> Other
- In the New wizard that pops up, open the Buckminster folder
- Select Component Specification file and click on Next
- Click on Finish to accept the default values for Container: and File name:
A file named buckminster.cspec is created in the project and the Buckminster CSPEC editor opens. Do not change the name of this file.
Main information
- The name of the component is normally the same as the name of the project. This makes it easier to find the component.
- The component type must in our case be set to buckminster.
- The version can be any OSGi compliant version such as 1.0.0
Artifacts
Artifacts denotes files and folders that are present inside of a component. The action that will create the update site needs to know about the site.xml template and other files to copy so we need to add that to our specification:
- Click on the Artifacts tab
- Click on New below the Artifacts table
- Enter a name such as site.template
- Click on the New button next to the Path table
- Enter the name site.xml in the dialog that pops up and click OK
- Click on New below the Artifacts table
- Enter the name site.rootFiles
- Click on the New button next to the Path table
- Enter the name index.html in the dialog that pops up and click OK
We now have two artifacts, each with one path. The separation is necessary in this particular case since the build action will reference the artifacs separately. An artifact may have several paths and you can add as many files and folders as you wish to the site.rootFiles artifact.
Dependencies
We need to define the features that will be included on the update site. Buckminster considers them to be dependencies:
- Click on the Dependencies tab
- For each feature that you want to add, repeat the following:
- Click on New just next to the Dependencies table
- Enter the name of a feature component
- Set the Component Type to eclipse.feature
- Click OK
Groups
The build action will expect one prerequisite that lists all the feature jars and one that lists all plugin jars. Luckely for us, Buckminster has already generated CSPEC's for all features with attributes that will provide just that. A feature will always have the two public attributes:
- feature.jars
- This is the transitive closure of all features (including the feature itself) in jared format.
- bundle.jars
- This is all the plugins that the transitive closure of all features is referencing in jared format.
Since we don't have a feature that describes the update site itself, we need to create two new groups. One that group all the feature.jars together, and one that group all the bundle.jars together.
- Click on New just below the Groups table
- Enter the name of the group. We call it feature.jars
- For each feature that should be included in this group
- Click on New just next to the prerequisites table
- Select a feature from the drop down menu.
- Enter the name feature.jars
- Click OK
Repeat these steps for a group that is called bundle.jars that references the bundle.jars attribute of each feature.
Defining Site Categories
This step is optional unless you want to categorize the contents of the update site. In order to define a Site Category, you must first create the category in the site.xml file and then add it as a group in the CSPEC.
In order to create a category in the site.xml file, do the following:
- Double click on the site.xml file. The Update Site Editor opens
- On the Site Map tab, click New Category
- Give the category a name. In this example we will use Basic
- Add a label such as Basic features
Repeat these steps and create an additional categogy named Optional with label Optional features
Back to the CSPEC editor:
- Click on the Groups tab
- Click on New just below the Groups table
- Enter the name of the group, i.e. Basic
- For each feature that should be included in this group
- Click on New just next to the prerequisites table
- Select a feature from the drop down menu.
- Enter the name feature.jars
- Click OK
Repeat these steps for the Optional group.
Attributes, Groups, and Actions are all Attributes in Buckminster terms. A group contains attributes. Subsequently, a group can include other groups. This allows for a simplification of the feature.jars group that we created earlier. Instead of having that group include all features, it could instead include the two category groups, i.e. instead of having:
feature.jars a[feature.jars] b[feature.jars] c[feature.jars] d[feature.jars] Basic a[feature.jars] b[feature.jars] Optional c[feature.jars] d[feature.jars]
we can simplify and do
feature.jars [Basic] [Optional] Basic a[feature.jars] b[feature.jars] Optional c[feature.jars] d[feature.jars]
(the example assumes that a, b, c, and d are features and [xxx] denotes attribute xxx)
If you follow the example (simplification or not), you now have four groups, Basic, Optional, feature.jars, and bundle.jars.
The Action
The last thing to add to the CSPEC is the Action that will trigger the actual build of the update site.
- Click on the Actions tab
- Adding General action information
- Click on New below the Actions table
- Enter the name build.site
- Put a check mark the Public checkbox
- Enter the Actor Name: ant
- Adding the site.template prerequisite
- Click on the New button next to the Prerequisites table
- Leave Component blank (this means current component)
- Select site.template from the Attribute combobox
- Enter the Alias name template
- Click OK
- Adding the rootFiles prerequisite
- Click on the New button next to the Prerequisites table
- Leave Component blank
- Select site.rootFiles from the Attribute combobox
- Enter the Alias name rootFiles
- Click OK
- Adding the features
- Click on the New button next to the Prerequisites table
- Leave Component blank
- Select feature.jars from the Attribute combobox
- Enter the Alias name features
- Click OK
- Adding the plugins
- Click on the New button next to the Prerequisites table
- Leave Component blank
- Select bundle.jars from the Attribute combobox
- Enter the Alias name plugins
- Click OK
- Adding general properties. These properties control the general behavior.
- In the middle pane, click on Properties
- Click on New next to the General Properties table
- Enter Key site.name and a value such as test.archivedsite
- Click OK
- If you want your site to have some extra suffix such as _incubation then:
- Click on New next to the General Properties table
- Enter Key site.extra.suffix and a value such as _incubation
- Click OK
- Adding actor properties. These properties control behavior specific to an actor. We need two of them. One to specify the ant build script that will be used and another to specify what ant target to call in that file.
- Click on New next to the Actor Properties table
- Enter Key buildFileId and the value buckminster.pdetasks
- Click OK
- Click on New again
- Enter Key targets and the value create.site
- Click OK
- Finally, we must specify the product of this action and give it an alias that it passes on to Ant.
- Click on Products in the middle pane.
- Enter the Product Alias action.output
- Enter the Product Base Path site/
This concludes the CSPEC editing. Save it using CTRL-s or File -> Save
Building the site
Right-click on your project, select Buckminster -> Invoke action -> build.site
The output will end up in ${user.temp}/buckminster by default. You can change this by setting the property buckminster.output.root in a property file that you reference when you execute the action. You can also specify properties using Windows -> Preferences -> Run/Debug -> String substitution.
Headless builds
The site can also be built from the command line using a headless setup. Simply issue the command:
buckminster -d <your workspace> perform org.test.update#build.site