Skip to content

Commit 92bd0e7

Browse files
committed
Migrating Category wiki page
Moves an improved version of https://wiki.eclipse.org/Tycho/category.xml to the Tycho documentation See eclipse-tycho#2564
1 parent d76d71c commit 92bd0e7

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

src/site/markdown/Category.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Category
2+
3+
A category.xml file can be used to define which content is placed into a p2 repository.
4+
It can also specify how to display the content in the p2 installation dialog.
5+
For Tycho to use it, it must to be placed into the root of an project with the packaging type 'eclipse-repository'.
6+
7+
The 'category.xml' format was originally defined by the Eclipse PDE project.
8+
There are extensions to the format only supported by p2 and Tycho.
9+
10+
The following listing is a simple category file listing only one feature and one plug-in.
11+
12+
13+
```
14+
<?xml version="1.0" encoding="UTF-8"?>
15+
<site>
16+
<feature id="com.example.feature">
17+
<category name="com.example.category.update"/>
18+
</feature>
19+
<category-def name="com.example.category.update" label="Example update site"/>
20+
</site>
21+
```
22+
The following is an example, demonstrating a complex category definition.
23+
24+
```
25+
<?xml version="1.0" encoding="UTF-8"?>
26+
<site>
27+
<!-- Include features -->
28+
<feature id="feature.id" version="1.4.100.v2009"/>
29+
<!-- Since Tycho 1.1.0 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=407273#c18), features can declare platform-specific compatibility for multi-platform builds -->
30+
<!-- Examples: https://github.com/mickaelistria/org.eclipse.simrel.build/blob/master/categories/category.xml#L581 -->
31+
<feature id="linux.specific.feature.id" version="0.0.0" os="linux"/>
32+
33+
<!-- Directly include bundles, without a feature -->
34+
<bundle id="bundle.id" version="1.3.1.v2023"/>
35+
<!-- Directly include any iu -->
36+
<iu id="unit.id"/>
37+
<!-- Include all IUs matching an expression -->
38+
<iu>
39+
<query>
40+
<expression type="match">
41+
<![CDATA[
42+
id == $0
43+
]]>
44+
</expression>
45+
<param>another.unit.id</param>
46+
</query>
47+
</iu>
48+
49+
<!-- Categories -->
50+
<feature id="feature.in.category">
51+
<category name="category.id"/>
52+
</feature>
53+
<category-def name="category.id" label="Category Label">
54+
<description>Details on the category</description>
55+
</category-def>
56+
57+
<!-- example for a dynamic category -->
58+
<category-def name="javax" label="Bundles starting with javax."/>
59+
<iu>
60+
<category name="javax"/>
61+
<query><expression type="match">id ~= /javax.*/</expression></query>
62+
</iu>
63+
</site>
64+
```

src/site/site.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<item name="Packaging Types" href="PackagingTypes.html" />
99
<item name="Testing Bundles" href="TestingBundles.html" />
1010
<item name="Tycho CI Friendly Versions" href="TychoCiFriendly.html" />
11+
<item name="Creating update sites using category.xml" href="Category.html" />
1112
<item name="Target Platform Configuration" href="target-platform-configuration/plugin-info.html" />
1213
<item name="Compiler Plugin" href="tycho-compiler-plugin/plugin-info.html" />
1314
<item name="Declarative Services Plugin" href="tycho-ds-plugin/plugin-info.html" />

0 commit comments

Comments
 (0)