2012-06-12 15:06:31 +00:00
|
|
|
From b67b6a5ab67eea4cb69d259fb7140a54355df61d Mon Sep 17 00:00:00 2001
|
|
|
|
From: Roland Grunberg <rgrunber@redhat.com>
|
|
|
|
Date: Tue, 12 Jun 2012 09:56:38 -0400
|
|
|
|
Subject: [PATCH 1/4] Fix the Tycho build to work on Fedora.
|
|
|
|
|
|
|
|
Minor fixes of limited scope needed to have Tycho building on Fedora.
|
|
|
|
|
|
|
|
As of Fedora 17, the default JRE is JDK 1.7. This does not support
|
|
|
|
JSR14. Many Eclipse OSGi bundles use JSR14 for a build target but since
|
|
|
|
JDK 1.7 ignores certain information (eg. generics) we must be careful
|
|
|
|
when using those libraries.
|
|
|
|
|
|
|
|
Change-Id: Ic8c0514c1fa10ee53580d2654ac6a363ccd66814
|
|
|
|
---
|
|
|
|
pom.xml | 5 -----
|
|
|
|
tycho-bundles/tycho-bundles-target/tycho.target | 2 --
|
|
|
|
tycho-compiler-jdt/pom.xml | 4 ----
|
|
|
|
.../java/org/eclipse/tycho/core/osgitools/OsgiManifest.java | 12 ++++++------
|
|
|
|
.../tycho/core/osgitools/StandalonePluginConverterTest.java | 8 ++++----
|
|
|
|
.../org/eclipse/tycho/testing/EmptyLifecycleExecutor.java | 8 ++++++++
|
|
|
|
6 files changed, 18 insertions(+), 21 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/pom.xml b/pom.xml
|
|
|
|
index 69e68c6..7cfb0cf 100644
|
|
|
|
--- a/pom.xml
|
|
|
|
+++ b/pom.xml
|
|
|
|
@@ -221,11 +221,6 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
|
|
|
|
<version>${jdtVersion}</version>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
- <groupId>org.eclipse.tycho</groupId>
|
|
|
|
- <artifactId>org.eclipse.jdt.compiler.apt</artifactId>
|
|
|
|
- <version>${jdtAptVersion}</version>
|
|
|
|
- </dependency>
|
|
|
|
- <dependency>
|
|
|
|
<groupId>org.apache.maven.surefire</groupId>
|
|
|
|
<artifactId>surefire-booter</artifactId>
|
|
|
|
<version>2.10</version>
|
|
|
|
diff --git a/tycho-bundles/tycho-bundles-target/tycho.target b/tycho-bundles/tycho-bundles-target/tycho.target
|
|
|
|
index 1cd9a7b..48eb53a 100644
|
|
|
|
--- a/tycho-bundles/tycho-bundles-target/tycho.target
|
|
|
|
+++ b/tycho-bundles/tycho-bundles-target/tycho.target
|
|
|
|
@@ -4,8 +4,6 @@
|
|
|
|
<target name="Target platform for Tycho's bundles" sequenceNumber="2">
|
|
|
|
<locations>
|
|
|
|
<location includeAllPlatforms="false" includeMode="slicer" includeSource="false" type="InstallableUnit">
|
|
|
|
-<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.0.v20120426-1529-7P7OFvNFLWUl7UmDUz0O8_a2"/>
|
|
|
|
-<unit id="org.eclipse.sdk.ide" version="4.2.0.I20120503-1800"/>
|
|
|
|
<repository location="http://download.eclipse.org/eclipse/updates/4.2milestones/"/>
|
|
|
|
</location>
|
|
|
|
</locations>
|
|
|
|
diff --git a/tycho-compiler-jdt/pom.xml b/tycho-compiler-jdt/pom.xml
|
|
|
|
index 9f7bdd7..6a1102b 100644
|
|
|
|
--- a/tycho-compiler-jdt/pom.xml
|
|
|
|
+++ b/tycho-compiler-jdt/pom.xml
|
|
|
|
@@ -38,10 +38,6 @@
|
|
|
|
<artifactId>org.eclipse.jdt.core</artifactId>
|
|
|
|
</dependency>
|
|
|
|
<dependency>
|
|
|
|
- <groupId>org.eclipse.tycho</groupId>
|
|
|
|
- <artifactId>org.eclipse.jdt.compiler.apt</artifactId>
|
|
|
|
- </dependency>
|
|
|
|
- <dependency>
|
|
|
|
<groupId>org.codehaus.plexus</groupId>
|
|
|
|
<artifactId>plexus-compiler-api</artifactId>
|
|
|
|
</dependency>
|
|
|
|
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 2859ab7..993cc58 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 {
|
2012-02-16 18:34:39 +00:00
|
|
|
private static final ExecutionEnvironment[] EMPTY_EXEC_ENV = new ExecutionEnvironment[0];
|
|
|
|
|
|
|
|
private String location;
|
|
|
|
- private Headers<String, String> headers;
|
|
|
|
+ private Headers headers;
|
|
|
|
|
|
|
|
// cache for parsed values of commonly used headers
|
|
|
|
private String bundleSymbolicName;
|
2012-06-12 15:06:31 +00:00
|
|
|
@@ -78,7 +78,7 @@ public class OsgiManifest {
|
2012-02-16 18:34:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
|
|
|
}
|
2012-06-12 15:06:31 +00:00
|
|
|
@@ -100,12 +100,12 @@ public class OsgiManifest {
|
2012-02-16 18:34:39 +00:00
|
|
|
&& "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() {
|
2012-06-12 15:06:31 +00:00
|
|
|
@@ -141,7 +141,7 @@ public class OsgiManifest {
|
2012-02-16 18:34:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private ManifestElement[] parseHeader(String key) {
|
|
|
|
- String value = headers.get(key);
|
|
|
|
+ String value = (String)headers.get(key);
|
|
|
|
if (value == null) {
|
|
|
|
return null;
|
|
|
|
}
|
2012-06-12 15:06:31 +00:00
|
|
|
@@ -154,7 +154,7 @@ public class OsgiManifest {
|
2012-02-16 18:34:39 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2012-06-12 15:06:31 +00:00
|
|
|
diff --git a/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverterTest.java b/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverterTest.java
|
|
|
|
index 42db7f6..a145c57 100644
|
|
|
|
--- a/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverterTest.java
|
|
|
|
+++ b/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverterTest.java
|
|
|
|
@@ -36,7 +36,7 @@ public class StandalonePluginConverterTest {
|
|
|
|
converter.convertManifest(new File("src/test/resources/targetplatforms/pre-3.0/plugins/testjar_1.0.0.jar"), mf,
|
|
|
|
false, "3.2", true, null);
|
|
|
|
Assert.assertTrue(mf.isFile());
|
|
|
|
- Headers<String, String> headers = Headers.parseManifest(new FileInputStream(mf));
|
|
|
|
+ Headers headers = Headers.parseManifest(new FileInputStream(mf));
|
|
|
|
Assert.assertEquals("testjar", headers.get("Bundle-SymbolicName"));
|
|
|
|
}
|
2012-05-04 19:28:57 +00:00
|
|
|
|
2012-06-12 15:06:31 +00:00
|
|
|
@@ -44,14 +44,14 @@ public class StandalonePluginConverterTest {
|
|
|
|
public void testWriteManifest() throws PluginConversionException, BundleException, IOException {
|
|
|
|
File tmpManifestFile = folder.newFile("testManifest");
|
|
|
|
Hashtable<String, String> manifestToWrite = new Hashtable<String, String>();
|
|
|
|
- Headers<String, String> originalManifest = Headers.parseManifest(getClass().getResourceAsStream(
|
|
|
|
+ Headers originalManifest = Headers.parseManifest(getClass().getResourceAsStream(
|
|
|
|
"/manifests/valid.mf"));
|
|
|
|
for (Enumeration<String> keys = originalManifest.keys(); keys.hasMoreElements();) {
|
|
|
|
String key = keys.nextElement();
|
|
|
|
- manifestToWrite.put(key, originalManifest.get(key));
|
|
|
|
+ manifestToWrite.put(key, (String)originalManifest.get(key));
|
2012-05-04 19:28:57 +00:00
|
|
|
}
|
2012-06-12 15:06:31 +00:00
|
|
|
converter.writeManifest(tmpManifestFile, manifestToWrite, false);
|
|
|
|
- Headers<String, String> writtenManifest = Headers.parseManifest(new FileInputStream(tmpManifestFile));
|
|
|
|
+ Headers writtenManifest = Headers.parseManifest(new FileInputStream(tmpManifestFile));
|
|
|
|
assertEquals(originalManifest.size(), writtenManifest.size());
|
|
|
|
for (Enumeration<String> keys = writtenManifest.keys(); keys.hasMoreElements();) {
|
|
|
|
String key = keys.nextElement();
|
|
|
|
diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/EmptyLifecycleExecutor.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/EmptyLifecycleExecutor.java
|
|
|
|
index a9d80d3..3ddbe9c 100644
|
|
|
|
--- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/EmptyLifecycleExecutor.java
|
|
|
|
+++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/testing/EmptyLifecycleExecutor.java
|
|
|
|
@@ -37,6 +37,14 @@ public class EmptyLifecycleExecutor implements LifecycleExecutor {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public MavenExecutionPlan calculateExecutionPlan(MavenSession session, boolean bool, String... tasks)
|
|
|
|
+ throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
|
|
|
|
+ MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
|
|
|
|
+ PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
|
|
|
|
+ PluginVersionResolutionException {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
public MavenExecutionPlan calculateExecutionPlan(MavenSession session, String... tasks)
|
|
|
|
throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
|
|
|
|
MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
|
|
|
|
--
|
|
|
|
1.7.11.2
|
|
|
|
|