From b67b6a5ab67eea4cb69d259fb7140a54355df61d Mon Sep 17 00:00:00 2001 From: Roland Grunberg 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 \ ${jdtVersion} - org.eclipse.tycho - org.eclipse.jdt.compiler.apt - ${jdtAptVersion} - - org.apache.maven.surefire surefire-booter 2.10 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 @@ - - 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 @@ org.eclipse.jdt.core - org.eclipse.tycho - org.eclipse.jdt.compiler.apt - - org.codehaus.plexus plexus-compiler-api 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 { private static final ExecutionEnvironment[] EMPTY_EXEC_ENV = new ExecutionEnvironment[0]; private String location; - private Headers 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 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-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 headers = Headers.parseManifest(new FileInputStream(mf)); + Headers headers = Headers.parseManifest(new FileInputStream(mf)); Assert.assertEquals("testjar", headers.get("Bundle-SymbolicName")); } @@ -44,14 +44,14 @@ public class StandalonePluginConverterTest { public void testWriteManifest() throws PluginConversionException, BundleException, IOException { File tmpManifestFile = folder.newFile("testManifest"); Hashtable manifestToWrite = new Hashtable(); - Headers originalManifest = Headers.parseManifest(getClass().getResourceAsStream( + Headers originalManifest = Headers.parseManifest(getClass().getResourceAsStream( "/manifests/valid.mf")); for (Enumeration keys = originalManifest.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); - manifestToWrite.put(key, originalManifest.get(key)); + manifestToWrite.put(key, (String)originalManifest.get(key)); } converter.writeManifest(tmpManifestFile, manifestToWrite, false); - Headers writtenManifest = Headers.parseManifest(new FileInputStream(tmpManifestFile)); + Headers writtenManifest = Headers.parseManifest(new FileInputStream(tmpManifestFile)); assertEquals(originalManifest.size(), writtenManifest.size()); for (Enumeration 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