Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 6059e28

Browse files
authored
Merge pull request #77 from kwin/feature/p2updatesite
Feature/p2updatesite
2 parents 922a4d0 + 36170f1 commit 6059e28

File tree

18 files changed

+505
-16
lines changed

18 files changed

+505
-16
lines changed

com.googlecode.cppcheclipse.core.tests/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: cppcheclipse Core Tests
44
Bundle-SymbolicName: com.googlecode.cppcheclipse.core.tests
5-
Bundle-Version: 1.0.1.qualifier
5+
Bundle-Version: 1.1.0.qualifier
66
Bundle-Vendor: Konrad Windszus
77
Fragment-Host: com.googlecode.cppcheclipse.core;bundle-version="0.9.8"
88
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

com.googlecode.cppcheclipse.core.tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>com.googlecode.cppcheclipse.parent</artifactId>
88
<groupId>com.googlecode.cppcheclipse</groupId>
9-
<version>1.0.1-SNAPSHOT</version>
9+
<version>1.1.0-SNAPSHOT</version>
1010
<relativePath>../com.googlecode.cppcheclipse.parent/pom.xml</relativePath>
1111
</parent>
1212
<artifactId>com.googlecode.cppcheclipse.core.tests</artifactId>

com.googlecode.cppcheclipse.core/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: cppcheclipse Core
44
Bundle-SymbolicName: com.googlecode.cppcheclipse.core;singleton:=true
5-
Bundle-Version: 1.0.1.qualifier
5+
Bundle-Version: 1.1.0.qualifier
66
Bundle-Activator: com.googlecode.cppcheclipse.core.CppcheclipsePlugin
77
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
88
org.eclipse.ui;bundle-version="3.5.0",

com.googlecode.cppcheclipse.core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>com.googlecode.cppcheclipse.parent</artifactId>
88
<groupId>com.googlecode.cppcheclipse</groupId>
9-
<version>1.0.1-SNAPSHOT</version>
9+
<version>1.1.0-SNAPSHOT</version>
1010
<relativePath>../com.googlecode.cppcheclipse.parent/pom.xml</relativePath>
1111
</parent>
1212
<artifactId>com.googlecode.cppcheclipse.core</artifactId>

com.googlecode.cppcheclipse.feature/feature.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<feature
33
id="com.googlecode.cppcheclipse.feature"
44
label="cppcheclipse"
5-
version="1.0.1.qualifier"
5+
version="1.1.0.qualifier"
66
provider-name="Konrad Windszus"
77
plugin="com.googlecode.cppcheclipse.core">
88

com.googlecode.cppcheclipse.feature/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>com.googlecode.cppcheclipse.parent</artifactId>
88
<groupId>com.googlecode.cppcheclipse</groupId>
9-
<version>1.0.1-SNAPSHOT</version>
9+
<version>1.1.0-SNAPSHOT</version>
1010
<relativePath>../com.googlecode.cppcheclipse.parent/pom.xml</relativePath>
1111
</parent>
1212
<artifactId>com.googlecode.cppcheclipse.feature</artifactId>

com.googlecode.cppcheclipse.parent/pom.xml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.googlecode.cppcheclipse</groupId>
77
<artifactId>com.googlecode.cppcheclipse.parent</artifactId>
8-
<version>1.0.1-SNAPSHOT</version>
8+
<version>1.1.0-SNAPSHOT</version>
99
<packaging>pom</packaging>
1010

1111
<!-- tycho requires maven >= 3.0 -->
@@ -16,6 +16,7 @@
1616
<properties>
1717
<tycho-version>0.24.0</tycho-version>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>
1920
</properties>
2021

2122
<build>
@@ -85,6 +86,51 @@
8586
</execution>
8687
</executions>
8788
</plugin>
89+
<!--
90+
<plugin>
91+
<groupId>org.eclipse.tycho.extras</groupId>
92+
<artifactId>tycho-source-feature-plugin</artifactId>
93+
<version>${tycho-version}</version>
94+
<executions>
95+
<execution>
96+
<id>source-feature</id>
97+
<phase>package</phase>
98+
<goals>
99+
<goal>source-feature</goal>
100+
</goals>
101+
</execution>
102+
</executions>
103+
</plugin>-->
104+
<plugin>
105+
<groupId>org.eclipse.tycho</groupId>
106+
<artifactId>tycho-p2-plugin</artifactId>
107+
<version>${tycho-version}</version>
108+
<executions>
109+
<execution>
110+
<id>attach-p2-metadata</id>
111+
<phase>package</phase>
112+
<goals>
113+
<goal>p2-metadata</goal>
114+
</goals>
115+
</execution>
116+
</executions>
117+
</plugin>
118+
119+
<!-- generate qualifier -->
120+
<plugin>
121+
<groupId>org.eclipse.tycho</groupId>
122+
<artifactId>tycho-packaging-plugin</artifactId>
123+
<version>${tycho-version}</version>
124+
<configuration>
125+
<format>'v'yyyyMMdd'-'HHmm</format>
126+
</configuration>
127+
</plugin>
128+
129+
<plugin>
130+
<groupId>org.eclipse.tycho</groupId>
131+
<artifactId>tycho-versions-plugin</artifactId>
132+
<version>${tycho-version}</version>
133+
</plugin>
88134
</plugins>
89135
</build>
90136

com.googlecode.cppcheclipse.parent/release.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ To release version x do the following steps:
22

33
make sure there are no uncommitted changes
44
mvn -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=<version x>
5-
build
6-
copy to p2 update site
5+
refresh category.xml (to point to feature in right version)
6+
mvn clean verify -Prelease-composite (see also http://www.lorenzobettini.it/2016/02/publish-an-eclipse-p2-composite-repository-on-bintray/)
77
tag (from local workspace)
88
mvn -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=<version x+1>-SNAPSHOT
99
afterwards the category.xml has to be updated manually, due to the changed version of the referenced feature
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project name="Handle p2 composite metadata from Bintray" basedir=".">
3+
4+
<!--
5+
These must be set from outside
6+
<property name="bintray.user" value="" />
7+
<property name="bintray.apikey" value="" />
8+
<property name="bintray.repo" value="" />
9+
<property name="bintray.package" value="" />
10+
<property name="bintray.releases.path" value="" />
11+
<property name="bintray.composite.path" value="" />
12+
<property name="bintray.zip.path" value="" />
13+
-->
14+
15+
<property name="bintray.url" value="https://dl.bintray.com/${bintray.owner}/${bintray.repo}" />
16+
<property name="bintray.package.version" value="${unqualifiedVersion}.${buildQualifier}" />
17+
<property name="bintray.releases.target.path" value="${bintray.releases.path}/${bintray.package.version}" />
18+
19+
<property name="main.composite.url" value="${bintray.url}/${bintray.composite.path}" />
20+
<property name="target" value="target" />
21+
<property name="composite.repository.directory" value="composite-child" />
22+
<property name="main.composite.repository.directory" value="composite-main" />
23+
24+
<property name="compositeArtifacts" value="compositeArtifacts.xml" />
25+
<property name="compositeContent" value="compositeContent.xml" />
26+
27+
<property name="local.p2.repository" value="target/repository" />
28+
29+
<target name="getMajorMinorVersion">
30+
<script language="javascript">
31+
<![CDATA[
32+
33+
// getting the value
34+
buildnumber = project.getProperty("unqualifiedVersion");
35+
index = buildnumber.lastIndexOf(".");
36+
counter = buildnumber.substring(0, index);
37+
project.setProperty("majorMinorVersion",counter);
38+
39+
]]>
40+
</script>
41+
</target>
42+
43+
<!-- Take from the remote URL the possible existing metadata -->
44+
<target name="get-composite-metadata" depends="getMajorMinorVersion" >
45+
<get-metadata url="${main.composite.url}" dest="${target}/${main.composite.repository.directory}" />
46+
<get-metadata url="${main.composite.url}/${majorMinorVersion}" dest="${target}/${composite.repository.directory}" />
47+
<antcall target="preprocess-metadata" />
48+
</target>
49+
50+
<macrodef name="get-metadata" description="Retrieve the p2 composite metadata">
51+
<attribute name="url" />
52+
<attribute name="dest" />
53+
<sequential>
54+
<echo message="Creating directory @{dest}..." />
55+
<mkdir dir="@{dest}" />
56+
<get-file file="${compositeArtifacts}" url="@{url}" dest="@{dest}" />
57+
<get-file file="${compositeContent}" url="@{url}" dest="@{dest}" />
58+
</sequential>
59+
</macrodef>
60+
61+
<macrodef name="get-file" description="Use Ant Get task the file">
62+
<attribute name="file" />
63+
<attribute name="url" />
64+
<attribute name="dest" />
65+
<sequential>
66+
<!-- If the remote file does not exist then fail gracefully -->
67+
<echo message="Getting @{file} from @{url} into @{dest}..." />
68+
<get dest="@{dest}" ignoreerrors="true">
69+
<url url="@{url}/@{file}" />
70+
</get>
71+
</sequential>
72+
</macrodef>
73+
74+
<!-- p2.atomic.composite.loading must be set to false otherwise we won't be able
75+
to add a child to the composite repository without having all the children available -->
76+
<target name="preprocess-metadata" description="Preprocess p2 composite metadata">
77+
<replaceregexp byline="true">
78+
<regexp pattern="property name='p2.atomic.composite.loading' value='true'" />
79+
<substitution expression="property name='p2.atomic.composite.loading' value='false'" />
80+
<fileset dir="${target}">
81+
<include name="${composite.repository.directory}/*.xml" />
82+
<include name="${main.composite.repository.directory}/*.xml" />
83+
</fileset>
84+
</replaceregexp>
85+
</target>
86+
87+
<!-- p2.atomic.composite.loading must be set to true
88+
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=356561 -->
89+
<target name="postprocess-metadata" description="Preprocess p2 composite metadata">
90+
<replaceregexp byline="true">
91+
<regexp pattern="property name='p2.atomic.composite.loading' value='false'" />
92+
<substitution expression="property name='p2.atomic.composite.loading' value='true'" />
93+
<fileset dir="${target}">
94+
<include name="${composite.repository.directory}/*.xml" />
95+
<include name="${main.composite.repository.directory}/*.xml" />
96+
</fileset>
97+
</replaceregexp>
98+
</target>
99+
100+
<target name="push-to-bintray" >
101+
<antcall target="postprocess-metadata" />
102+
<antcall target="push-p2-repo-to-bintray" />
103+
<antcall target="push-p2-repo-zipped-to-bintray" />
104+
<antcall target="push-composite-to-bintray" />
105+
<antcall target="push-main-composite-to-bintray" />
106+
</target>
107+
108+
<target name="push-p2-repo-to-bintray">
109+
<apply executable="curl" parallel="false" relative="true" addsourcefile="false">
110+
<arg value="-XPUT" />
111+
<arg value="--verbose" />
112+
<targetfile />
113+
114+
<fileset dir="${local.p2.repository}" />
115+
116+
<compositemapper>
117+
<mergemapper to="-T" />
118+
<globmapper from="*" to="${local.p2.repository}/*" />
119+
<mergemapper to="-u${bintray.user}:${bintray.apikey}" />
120+
<globmapper from="*" to="https://api.bintray.com/content/${bintray.owner}/${bintray.repo}/${bintray.releases.target.path}/*;bt_package=${bintray.package};bt_version=${bintray.package.version};publish=1" />
121+
</compositemapper>
122+
</apply>
123+
</target>
124+
125+
<target name="push-p2-repo-zipped-to-bintray">
126+
<apply executable="curl" parallel="false" relative="true" addsourcefile="false">
127+
<arg value="-XPUT" />
128+
<targetfile />
129+
130+
<fileset dir="${target}" includes="*.zip" />
131+
132+
<compositemapper>
133+
<mergemapper to="-T" />
134+
<globmapper from="*" to="${target}/*" />
135+
<mergemapper to="-u${bintray.user}:${bintray.apikey}" />
136+
<globmapper from="*" to="https://api.bintray.com/content/${bintray.owner}/${bintray.repo}/${bintray.zip.path}/*;bt_package=${bintray.package};bt_version=${bintray.package.version};publish=1" />
137+
</compositemapper>
138+
</apply>
139+
</target>
140+
141+
<target name="push-composite-to-bintray" depends="getMajorMinorVersion" >
142+
<apply executable="curl" parallel="false" relative="true" addsourcefile="false">
143+
<arg value="-XPUT" />
144+
<targetfile />
145+
146+
<fileset dir="${target}/${composite.repository.directory}" />
147+
148+
<compositemapper>
149+
<mergemapper to="-T" />
150+
<globmapper from="*" to="${target}/${composite.repository.directory}/*" />
151+
<mergemapper to="-u${bintray.user}:${bintray.apikey}" />
152+
<globmapper from="*" to="https://api.bintray.com/content/${bintray.owner}/${bintray.repo}/${bintray.composite.path}/${majorMinorVersion}/*;publish=1" />
153+
</compositemapper>
154+
</apply>
155+
</target>
156+
157+
<target name="push-main-composite-to-bintray" >
158+
<apply executable="curl" parallel="false" relative="true" addsourcefile="false">
159+
<arg value="-XPUT" />
160+
<targetfile />
161+
162+
<fileset dir="${target}/${main.composite.repository.directory}" />
163+
164+
<compositemapper>
165+
<mergemapper to="-T" />
166+
<globmapper from="*" to="${target}/${main.composite.repository.directory}/*" />
167+
<mergemapper to="-u${bintray.user}:${bintray.apikey}" />
168+
<globmapper from="*" to="https://api.bintray.com/content/${bintray.owner}/${bintray.repo}/${bintray.composite.path}/*;publish=1" />
169+
</compositemapper>
170+
</apply>
171+
</target>
172+
173+
</project>

com.googlecode.cppcheclipse.repository/category.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<site>
3-
<feature url="features/com.googlecode.cppcheclipse.feature_1.0.1.qualifier.jar" id="com.googlecode.cppcheclipse.feature" version="1.0.1.qualifier">
3+
<feature url="features/com.googlecode.cppcheclipse.feature_1.1.0.qualifier.jar" id="com.googlecode.cppcheclipse.feature" version="1.1.0.qualifier">
44
<category name="cppcheclipse"/>
55
</feature>
66
<category-def name="cppcheclipse" label="cppcheclipse"/>

0 commit comments

Comments
 (0)