From 2d1e009c256c26c8b1bf66dace56bb7a8436c236 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. Remove org.eclipse.equinox.concurrent until present in Fedora Eclipse. Fix API issues with org.objectweb.asm (Need 4.0 but only have 3.0). Change-Id: Ic8c0514c1fa10ee53580d2654ac6a363ccd66814 --- pom.xml | 5 ----- tycho-artifactcomparator/pom.xml | 6 +++--- .../tycho/zipcomparator/internal/ClassfileComparator.java | 2 +- .../tycho-bundles-external/tycho-bundles-external.product | 1 - tycho-bundles/tycho-bundles-target/tycho.target | 4 ---- .../tycho-standalone-p2-director/p2 Director.product | 1 - tycho-compiler-jdt/pom.xml | 4 ---- .../java/org/eclipse/tycho/core/osgitools/OsgiManifest.java | 12 ++++++------ .../tycho/core/osgitools/StandalonePluginConverterTest.java | 8 ++++---- .../org/eclipse/tycho/test/AbstractTychoIntegrationTest.java | 11 +++++------ .../org/eclipse/tycho/testing/EmptyLifecycleExecutor.java | 8 ++++++++ 11 files changed, 27 insertions(+), 35 deletions(-) diff --git a/pom.xml b/pom.xml index dc7c1f5..1868f9a 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-artifactcomparator/pom.xml b/tycho-artifactcomparator/pom.xml index 775107a..a6ff6f7 100644 --- a/tycho-artifactcomparator/pom.xml +++ b/tycho-artifactcomparator/pom.xml @@ -23,8 +23,8 @@ - org.ow2.asm - asm-debug-all + asm + asm-all 4.0 @@ -54,4 +54,4 @@ - \ No newline at end of file + diff --git a/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/zipcomparator/internal/ClassfileComparator.java b/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/zipcomparator/internal/ClassfileComparator.java index 6944b03..a3a9825 100644 --- a/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/zipcomparator/internal/ClassfileComparator.java +++ b/tycho-artifactcomparator/src/main/java/org/eclipse/tycho/zipcomparator/internal/ClassfileComparator.java @@ -61,7 +61,7 @@ public class ClassfileComparator implements ContentsComparator { private String disassemble(byte[] bytes) { ClassReader reader = new ClassReader(bytes); ClassNode clazz = new ClassNode(); - reader.accept(clazz, Opcodes.ASM4 | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); + reader.accept(clazz, (4 << 16 | 0 << 8 | 0) | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); // inner class list gets reordered during pack200 normalization if (clazz.innerClasses != null) { diff --git a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product index 3e584f5..8b54310 100644 --- a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product +++ b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product @@ -41,7 +41,6 @@ - diff --git a/tycho-bundles/tycho-bundles-target/tycho.target b/tycho-bundles/tycho-bundles-target/tycho.target index d23b885..1437dbd 100644 --- a/tycho-bundles/tycho-bundles-target/tycho.target +++ b/tycho-bundles/tycho-bundles-target/tycho.target @@ -4,10 +4,6 @@ - - - - diff --git a/tycho-bundles/tycho-standalone-p2-director/p2 Director.product b/tycho-bundles/tycho-standalone-p2-director/p2 Director.product index dd80b5e..797b4ba 100644 --- a/tycho-bundles/tycho-standalone-p2-director/p2 Director.product +++ b/tycho-bundles/tycho-standalone-p2-director/p2 Director.product @@ -41,7 +41,6 @@ - diff --git a/tycho-compiler-jdt/pom.xml b/tycho-compiler-jdt/pom.xml index 01b9a9e..c373e6a 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/test/AbstractTychoIntegrationTest.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java index 5c4dcb3..9830aee 100644 --- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java +++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java @@ -97,12 +97,11 @@ public abstract class AbstractTychoIntegrationTest { verifier.getCliOptions().add(customOptions); } - if (System.getProperty(SYSPROP_STATELOCATION) != null) { - verifier.setForkJvm(false); - String m2eresolver = System.getProperty("tychodev-maven.ext.class.path"); // XXX - if (m2eresolver != null) { - verifier.addCliOption("-Dmaven.ext.class.path=" + m2eresolver); - } + String m2eState = System.getProperty("m2eclipse.workspace.state"); + String m2eResolver = System.getProperty("m2eclipse.workspace.resolver"); + + if (m2eState != null && m2eResolver != null) { + verifier.getVerifierProperties().put("m2eclipse.workspace.state", m2eState); } return verifier; 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