[tycho] Make additional changes to get Tycho building bootstrapped.

Roland Grunberg rgrunber at fedoraproject.org
Mon Nov 19 18:56:01 UTC 2012


commit aba279566561430fd0fdbf1941851b24e612d58b
Author: Roland Grunberg <rgrunber at redhat.com>
Date:   Sat Nov 17 13:04:34 2012 -0500

    Make additional changes to get Tycho building bootstrapped.

 depmap.xml                      |   18 ++++++
 tycho-fix-bootstrap-build.patch |  112 +++++++++++++++++++++++++++++++++++++++
 tycho.spec                      |   16 ++++--
 3 files changed, 142 insertions(+), 4 deletions(-)
---
diff --git a/depmap.xml b/depmap.xml
index ce74541..1a44a4d 100644
--- a/depmap.xml
+++ b/depmap.xml
@@ -11,4 +11,22 @@
         <version>3.0.3</version>
     </jpp>
 </dependency>
+<!--
+     The first bootstrap build of Tycho provides the osgi bundle under the
+     same gid:aid as Eclipse. When building non-bootstrapped we should
+     explicitly depend upon Eclipse's osgi bundle, even if Tycho has
+     one available.
+-->
+<dependency>
+    <maven>
+        <groupId>org.eclipse.tycho</groupId>
+        <artifactId>org.eclipse.osgi</artifactId>
+        <version>0</version>
+    </maven>
+    <jpp>
+        <groupId>JPP/eclipse</groupId>
+        <artifactId>osgi</artifactId>
+        <version>0</version>
+    </jpp>
+</dependency>
 </dependencies>
diff --git a/tycho-fix-bootstrap-build.patch b/tycho-fix-bootstrap-build.patch
new file mode 100644
index 0000000..a0669e8
--- /dev/null
+++ b/tycho-fix-bootstrap-build.patch
@@ -0,0 +1,112 @@
+From 354a8a3e10fac409b9d0115d1cb377ee711d2025 Mon Sep 17 00:00:00 2001
+From: Roland Grunberg <rgrunber at redhat.com>
+Date: Mon, 19 Nov 2012 10:33:43 -0500
+Subject: [PATCH] Minor fixes of limited scope to get a Tycho bootstrapped
+ build.
+
+Eclipse p2 repositories can change subtly (disappear, become composites)
+causing bizare failures in resolving from the reactor cache so we must
+keep the URLs up to date.
+
+When doing a bootstrap build, we're using upstream jars with class files
+compiled as 'jsr14' (Allows running on 1.4 JDK and can compile against
+1.5 sources). JDK 1.7 is not backwards compatible (eg. info on generics
+is ignored in these jars).
+---
+ tycho-bundles/tycho-bundles-target/tycho.target              | 10 +++++-----
+ .../java/org/eclipse/tycho/core/osgitools/OsgiManifest.java  | 12 ++++++------
+ tycho-surefire/pom.xml                                       |  2 +-
+ 3 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/tycho-bundles/tycho-bundles-target/tycho.target b/tycho-bundles/tycho-bundles-target/tycho.target
+index 3436ba6..67ba8c6 100644
+--- a/tycho-bundles/tycho-bundles-target/tycho.target
++++ b/tycho-bundles/tycho-bundles-target/tycho.target
+@@ -2,11 +2,11 @@
+ <?pde version="3.8"?><target name="Target platform for Tycho's bundles" sequenceNumber="8">
+ <locations>
+ <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="slicer" includeSource="false" type="InstallableUnit">
+-<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.0.v20120913-142258-7P7OG2BFLWUl7Unz-8OO8IEVz-8"/>
+-<unit id="org.eclipse.sdk.ide" version="4.3.0.I20121002-0800"/>
+-<unit id="org.eclipse.equinox.core.sdk.feature.group" version="3.8.0.v20120913-170722-84FAgGhRFnbPjaFro9s2VXtitW"/>
+-<unit id="org.eclipse.equinox.p2.sdk.feature.group" version="3.8.0.v20120524-0542-9N8BHpPGMMn84SxoTtoj_mfujQDR"/>
+-<repository location="http://download.eclipse.org/eclipse/updates/4.3-I-builds/I20121002-0800"/>
++<unit id="org.eclipse.equinox.executable.feature.group"/>
++<unit id="org.eclipse.sdk.ide"/>
++<unit id="org.eclipse.equinox.core.sdk.feature.group"/>
++<unit id="org.eclipse.equinox.p2.sdk.feature.group"/>
++<repository location="http://download.eclipse.org/eclipse/updates/4.3-I-builds/I20121113-0800"/>
+ </location>
+ </locations>
+ </target>
+diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiManifest.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiManifest.java
+index 37ce827..4cc7644 100644
+--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiManifest.java
++++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiManifest.java
+@@ -25,7 +25,7 @@ public class OsgiManifest {
+     private static final StandardExecutionEnvironment[] EMPTY_EXEC_ENV = new StandardExecutionEnvironment[0];
+ 
+     private String location;
+-    private Headers<String, String> headers;
++    private Headers headers;
+ 
+     // cache for parsed values of commonly used headers
+     private String bundleSymbolicName;
+@@ -78,7 +78,7 @@ public class OsgiManifest {
+     }
+ 
+     private String parseMandatoryFirstValue(String headerKey) throws InvalidOSGiManifestException {
+-        String value = headers.get(headerKey);
++        String value = (String) headers.get(headerKey);
+         if (value == null) {
+             throw new InvalidOSGiManifestException(location, "MANIFEST header '" + headerKey + "' not found");
+         }
+@@ -100,12 +100,12 @@ public class OsgiManifest {
+                 && "dir".equals(bundleShapeElements[0].getValue());
+     }
+ 
+-    public Headers<String, String> getHeaders() {
++    public Headers getHeaders() {
+         return headers;
+     }
+ 
+     public String getValue(String key) {
+-        return headers.get(key);
++        return (String) headers.get(key);
+     }
+ 
+     public String getBundleSymbolicName() {
+@@ -141,7 +141,7 @@ public class OsgiManifest {
+     }
+ 
+     private ManifestElement[] parseHeader(String key) {
+-        String value = headers.get(key);
++        String value = (String) headers.get(key);
+         if (value == null) {
+             return null;
+         }
+@@ -154,7 +154,7 @@ public class OsgiManifest {
+ 
+     public ManifestElement[] getManifestElements(String key) throws OsgiManifestParserException {
+         try {
+-            return ManifestElement.parseHeader(key, headers.get(key));
++            return ManifestElement.parseHeader(key, (String) headers.get(key));
+         } catch (BundleException e) {
+             throw new OsgiManifestParserException(location, e);
+         }
+diff --git a/tycho-surefire/pom.xml b/tycho-surefire/pom.xml
+index eab06be..6622176 100644
+--- a/tycho-surefire/pom.xml
++++ b/tycho-surefire/pom.xml
+@@ -41,7 +41,7 @@
+ 		<repository>
+ 			<id>eclipse</id>
+ 			<layout>p2</layout>
+-			<url>http://download.eclipse.org/releases/indigo</url>
++			<url>http://download.eclipse.org/releases/indigo/201202240900</url>
+ 		</repository>
+ 	</repositories>
+ 
+-- 
+1.7.11.7
+
diff --git a/tycho.spec b/tycho.spec
index 4c071ab..da21470 100644
--- a/tycho.spec
+++ b/tycho.spec
@@ -8,7 +8,7 @@
 
 Name:           tycho
 Version:        0.16.0
-Release:        16%{?dist}
+Release:        17%{?dist}
 Summary:        Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
 
 Group:          Development/Libraries
@@ -41,7 +41,10 @@ Patch4:         %{name}-bootstrap.patch
 # Maven local mode will look in reactor cache for exact version (path lookup)
 # Set the built intermediary version of Tycho to be found in the reactor cache
 Patch5:         %{name}-set-reactor-cache-version.patch
+# These units cannot be found during a regular build
 Patch6:         %{name}-remove-units.patch
+# Additional changes needed just for bootstrap build
+Patch7:         %{name}-fix-bootstrap-build.patch
 
 BuildArch:      noarch
 
@@ -134,10 +137,12 @@ pushd tycho-maven-plugin/src/main/java/org/fedoraproject
 cp %{SOURCE1} .
 popd
 
-export MAVEN_OPTS="$MAVEN_OPTS -XX:MaxPermSize=256m"
-
+# Bootstrap Build
 %if %{bootstrap}
 tar -xf %{SOURCE4}
+%patch7 -p1
+
+# Non-Bootstrap Build
 %else
 
 %patch6 -p1
@@ -233,7 +238,7 @@ mvn-rpmbuild org.apache.maven.plugins:maven-install-plugin:install-file \
 -DartifactId=org.eclipse.osgi \
 -Dversion=$osgiVer
 
-osgiPomPath=`find ".m2/org/eclipse/tycho/org.eclipse.osgi" -name "org.eclipse.osgi-*.pom"`
+osgiPomPath=`find ".m2/org/eclipse/tycho/org.eclipse.osgi" -name "org.eclipse.osgi-$osgiVer.pom"`
 
 install -pm 644 $osgiPomPath $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-osgi.pom
 install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar
@@ -250,6 +255,9 @@ install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar
 %{_javadocdir}/%{name}
 
 %changelog
+* Mon Nov 19 2012 Roland Grunberg <rgrunber at redhat.com> 0.16.0-17
+- Make additional changes to get Tycho building bootstrapped.
+
 * Mon Nov 5 2012 Roland Grunberg <rgrunber at redhat.com> 0.16.0-16
 - Add capability to build without depending on Tycho or Eclipse.
 


More information about the scm-commits mailing list