From 920242e853449e5f8c75d522155f006d15d1fa4a Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Fri, 28 Mar 2014 16:33:16 -0400 Subject: [PATCH] Update to Eclipse Luna (4.4) dependencies. Change-Id: Iacad3ab85e0f2fc03c18e1a204f3cb6dba6b1af1 --- pom.xml | 5 ++ .../DefaultEquinoxInstallationDescription.java | 4 +- .../tycho-bundles-external.product | 1 + tycho-core/pom.xml | 5 ++ .../tycho/core/ee/CustomExecutionEnvironment.java | 3 +- .../tycho/core/ee/ExecutionEnvironmentUtils.java | 11 ++-- .../tycho/core/locking/FileLockServiceImpl.java | 5 +- .../tycho/core/osgitools/DefaultBundleReader.java | 27 +--------- .../tycho/core/osgitools/EquinoxResolver.java | 15 +++--- .../tycho/core/osgitools/OsgiBundleProject.java | 6 +-- .../core/osgitools/StandalonePluginConverter.java | 32 ----------- .../targetplatform/EclipseInstallationLayout.java | 5 +- .../osgitools/StandalonePluginConverterTest.java | 62 ---------------------- .../tycho/pomgenerator/GeneratePomsMojo.java | 2 +- .../java/org/eclipse/tycho/surefire/TestMojo.java | 4 +- .../ProvisionedInstallationDescription.java | 12 ++--- 16 files changed, 48 insertions(+), 151 deletions(-) delete mode 100644 tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverter.java delete mode 100644 tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverterTest.java diff --git a/pom.xml b/pom.xml index 685cce7..2e4d738 100644 --- a/pom.xml +++ b/pom.xml @@ -238,6 +238,11 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \ ${equinoxVersion} + org.eclipse.osgi + org.eclipse.osgi.compatibility.state + ${equinoxVersion} + + org.eclipse.tycho org.eclipse.jdt.core ${jdtVersion} diff --git a/sisu-equinox/sisu-equinox-launching/src/main/java/org/eclipse/sisu/equinox/launching/DefaultEquinoxInstallationDescription.java b/sisu-equinox/sisu-equinox-launching/src/main/java/org/eclipse/sisu/equinox/launching/DefaultEquinoxInstallationDescription.java index 6eff61f..c4f39cc 100644 --- a/sisu-equinox/sisu-equinox-launching/src/main/java/org/eclipse/sisu/equinox/launching/DefaultEquinoxInstallationDescription.java +++ b/sisu-equinox/sisu-equinox-launching/src/main/java/org/eclipse/sisu/equinox/launching/DefaultEquinoxInstallationDescription.java @@ -18,7 +18,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor; +import org.eclipse.osgi.internal.framework.EquinoxContainer; import org.eclipse.tycho.ArtifactDescriptor; import org.eclipse.tycho.ArtifactKey; import org.eclipse.tycho.core.osgitools.targetplatform.DefaultTargetPlatform; @@ -69,7 +69,7 @@ public class DefaultEquinoxInstallationDescription implements EquinoxInstallatio public ArtifactDescriptor getSystemBundle() { return bundles.getArtifact(org.eclipse.tycho.ArtifactKey.TYPE_ECLIPSE_PLUGIN, - FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, null); + EquinoxContainer.NAME, null); } public void addBundle(ArtifactDescriptor artifact) { diff --git a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product index aaba0d3..c0ce143 100644 --- a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product +++ b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product @@ -70,6 +70,7 @@ + diff --git a/tycho-core/pom.xml b/tycho-core/pom.xml index c811801..4513056 100644 --- a/tycho-core/pom.xml +++ b/tycho-core/pom.xml @@ -127,6 +127,11 @@ org.eclipse.osgi + org.eclipse.osgi + org.eclipse.osgi.compatibility.state + + + org.eclipse.tycho sisu-equinox-embedder ${project.version} diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java index df17e87..8c16e38 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/CustomExecutionEnvironment.java @@ -19,6 +19,7 @@ import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; import org.eclipse.tycho.core.ee.shared.SystemCapability; import org.eclipse.tycho.core.ee.shared.SystemCapability.Type; @@ -41,7 +42,7 @@ public class CustomExecutionEnvironment implements ExecutionEnvironment { setOsgiSystemCapabilities(systemCapabilities); // osgi.java.profile.name is not needed at runtime AFAIK but let's make it explicit that this is a custom profile - properties.setProperty(org.eclipse.osgi.framework.internal.core.Constants.OSGI_JAVA_PROFILE_NAME, profileName); + properties.setProperty(EquinoxConfiguration.PROP_OSGI_JAVA_PROFILE_NAME, profileName); } private void setSystemPackages(List systemCapabilities) { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java index 49797f6..18b2ebe 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/ee/ExecutionEnvironmentUtils.java @@ -17,7 +17,8 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; -import org.eclipse.osgi.framework.internal.core.Constants; +import org.osgi.framework.Constants; +import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment; import org.osgi.framework.BundleActivator; @@ -90,20 +91,20 @@ public class ExecutionEnvironmentUtils { properties.put(Constants.FRAMEWORK_SYSTEMPACKAGES, systemExports); } // set the org.osgi.framework.bootdelegation property according to the java profile - String type = properties.getProperty(Constants.OSGI_JAVA_PROFILE_BOOTDELEGATION); // a null value means ignore + String type = properties.getProperty(EquinoxConfiguration.PROP_OSGI_JAVA_PROFILE_BOOTDELEGATION); // a null value means ignore String profileBootDelegation = profileProps.getProperty(Constants.FRAMEWORK_BOOTDELEGATION); - if (Constants.OSGI_BOOTDELEGATION_OVERRIDE.equals(type)) { + if (EquinoxConfiguration.PROP_OSGI_BOOTDELEGATION_OVERRIDE.equals(type)) { if (profileBootDelegation == null) properties.remove(Constants.FRAMEWORK_BOOTDELEGATION); // override with a null value else properties.put(Constants.FRAMEWORK_BOOTDELEGATION, profileBootDelegation); // override with the profile value - } else if (Constants.OSGI_BOOTDELEGATION_NONE.equals(type)) + } else if (EquinoxConfiguration.PROP_OSGI_BOOTDELEGATION_NONE.equals(type)) properties.remove(Constants.FRAMEWORK_BOOTDELEGATION); // remove the bootdelegation property in case it was set // set the org.osgi.framework.executionenvironment property according to the java profile if (properties.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT) == null) { // get the ee from the java profile; if no ee is defined then try the java profile name String ee = profileProps.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, - profileProps.getProperty(Constants.OSGI_JAVA_PROFILE_NAME)); + profileProps.getProperty(EquinoxConfiguration.PROP_OSGI_JAVA_PROFILE_NAME)); if (ee != null) properties.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, ee); } diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockServiceImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockServiceImpl.java index e83660e..a939a4c 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockServiceImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/locking/FileLockServiceImpl.java @@ -14,7 +14,8 @@ package org.eclipse.tycho.core.locking; import java.io.File; import org.codehaus.plexus.component.annotations.Component; -import org.eclipse.core.runtime.internal.adaptor.BasicLocation; +import org.eclipse.osgi.internal.framework.EquinoxContainer; +import org.eclipse.osgi.internal.location.BasicLocation; import org.eclipse.osgi.service.datalocation.Location; import org.eclipse.tycho.locking.facade.FileLockService; import org.eclipse.tycho.locking.facade.FileLocker; @@ -25,7 +26,7 @@ public class FileLockServiceImpl implements FileLockService { private Location anyLocation; public FileLockServiceImpl() { - anyLocation = new BasicLocation(null, null, false, null); + anyLocation = new BasicLocation(null, null, false, null, new EquinoxContainer(null).getConfiguration()); } /* diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java index 0f3eac8..c7875e0 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/DefaultBundleReader.java @@ -108,31 +108,8 @@ public class DefaultBundleReader extends AbstractLogEnabled implements BundleRea } private File convertPluginManifest(File bundleLocation) throws OsgiManifestParserException { - PluginConverter converter = new StandalonePluginConverter(); - String name = bundleLocation.getName(); - if (name.endsWith(".jar")) { - name = name.substring(0, name.length() - 4); - } - File manifestFile = new File(cacheDir, name + "/META-INF/MANIFEST.MF"); - manifestFile.getParentFile().mkdirs(); - try { - converter.convertManifest(bundleLocation, manifestFile, false /* compatibility */, "3.2" /* - * target - * version - */, true /* - * analyse - * jars - * to - * set - * export - * - - * package - */, - null /* devProperties */); - } catch (PluginConversionException e) { - throw new OsgiManifestParserException(bundleLocation.getAbsolutePath(), e); - } - return manifestFile; + throw new OsgiManifestParserException(bundleLocation.getAbsolutePath(), + "The bundle does not provide a Manifest, and support for plugin conversion is disabled."); } public void setLocationRepository(File basedir) { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java index 49caccf..a3dd643 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EquinoxResolver.java @@ -24,6 +24,7 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; +import org.eclipse.osgi.internal.resolver.StateImpl; import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.osgi.service.resolver.BundleSpecification; import org.eclipse.osgi.service.resolver.HostSpecification; @@ -141,8 +142,8 @@ public class EquinoxResolver { // Put Equinox OSGi resolver into development mode. // See http://www.nabble.com/Re:-resolving-partially-p18449054.html - properties.put(org.eclipse.osgi.framework.internal.core.Constants.OSGI_RESOLVER_MODE, - org.eclipse.osgi.framework.internal.core.Constants.DEVELOPMENT_MODE); + properties.put(StateImpl.OSGI_RESOLVER_MODE, + StateImpl.DEVELOPMENT_MODE); return properties; } @@ -188,7 +189,7 @@ public class EquinoxResolver { // force our system.bundle Hashtable platformProperties = new Hashtable(properties); - platformProperties.put(org.eclipse.osgi.framework.internal.core.Constants.STATE_SYSTEM_BUNDLE, + platformProperties.put(StateImpl.STATE_SYSTEM_BUNDLE, state.getBundle(SYSTEM_BUNDLE_ID).getSymbolicName()); state.setPlatformProperties(platformProperties); @@ -253,12 +254,12 @@ public class EquinoxResolver { String systemPackages = properties.getProperty(org.osgi.framework.Constants.FRAMEWORK_SYSTEMPACKAGES); Dictionary systemBundleManifest = new Hashtable(); - systemBundleManifest.put(org.eclipse.osgi.framework.internal.core.Constants.BUNDLE_SYMBOLICNAME, + systemBundleManifest.put(Constants.BUNDLE_SYMBOLICNAME, SYSTEM_BUNDLE_SYMBOLIC_NAME); - systemBundleManifest.put(org.eclipse.osgi.framework.internal.core.Constants.BUNDLE_VERSION, "0.0.0"); - systemBundleManifest.put(org.eclipse.osgi.framework.internal.core.Constants.BUNDLE_MANIFESTVERSION, "2"); + systemBundleManifest.put(Constants.BUNDLE_VERSION, "0.0.0"); + systemBundleManifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); if (systemPackages != null && systemPackages.trim().length() > 0) { - systemBundleManifest.put(org.eclipse.osgi.framework.internal.core.Constants.EXPORT_PACKAGE, systemPackages); + systemBundleManifest.put(Constants.EXPORT_PACKAGE, systemPackages); } else { logger.warn("Undefined or empty org.osgi.framework.system.packages system property, system.bundle does not export any packages."); } diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java index 62518f6..9d64ebf 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java @@ -29,8 +29,8 @@ import org.apache.maven.execution.MavenSession; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; -import org.eclipse.osgi.framework.internal.core.Constants; -import org.eclipse.osgi.framework.internal.core.FilterImpl; +import org.eclipse.osgi.internal.framework.FilterImpl; +import org.eclipse.osgi.internal.resolver.StateImpl; import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.osgi.service.resolver.State; import org.eclipse.tycho.ArtifactDescriptor; @@ -441,7 +441,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro @Override public TargetEnvironment getImplicitTargetEnvironment(MavenProject project) { - String filterStr = getManifestValue(Constants.ECLIPSE_PLATFORMFILTER, project); + String filterStr = getManifestValue(StateImpl.ECLIPSE_PLATFORMFILTER, project); if (filterStr != null) { try { diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverter.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverter.java deleted file mode 100644 index ecfafcf..0000000 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverter.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.eclipse.tycho.core.osgitools; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import org.eclipse.core.runtime.internal.adaptor.PluginConverterImpl; -import org.osgi.framework.BundleContext; - -/** - * {@link PluginConverterImpl} which can be used without a running OSGi framework. - */ -public class StandalonePluginConverter extends PluginConverterImpl { - - public StandalonePluginConverter() { - super(null, createDummyContext()); - } - - /** - * create a dummy BundleContext. This workaround allows us to reuse {@link PluginConverterImpl} - * outside a running OSGi framework - */ - private static BundleContext createDummyContext() { - return (BundleContext) Proxy.newProxyInstance(BundleContext.class.getClassLoader(), - new Class[] { BundleContext.class }, new InvocationHandler() { - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - return null; - } - }); - } - -} diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java index b067a84..9e4c816 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/targetplatform/EclipseInstallationLayout.java @@ -31,7 +31,6 @@ import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.util.xml.XmlStreamReader; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.util.xml.Xpp3DomBuilder; -import org.eclipse.core.runtime.internal.adaptor.PluginConverterImpl; /** * Finds bundles in Eclipse installation. @@ -118,8 +117,8 @@ public class EclipseInstallationLayout extends AbstractLogEnabled { private boolean isDirectoryPlugin(File plugin) { return new File(plugin, "META-INF/MANIFEST.MF").canRead() - || new File(plugin, PluginConverterImpl.PLUGIN_MANIFEST).canRead() - || new File(plugin, PluginConverterImpl.FRAGMENT_MANIFEST).canRead(); + || new File(plugin, "plugin.xml").canRead() + || new File(plugin, "fragment.xml").canRead(); } public Set getSites() { 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 deleted file mode 100644 index 42db7f6..0000000 --- a/tycho-core/src/test/java/org/eclipse/tycho/core/osgitools/StandalonePluginConverterTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.eclipse.tycho.core.osgitools; - -import static org.junit.Assert.assertEquals; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Hashtable; - -import org.eclipse.osgi.framework.util.Headers; -import org.eclipse.osgi.service.pluginconversion.PluginConversionException; -import org.eclipse.osgi.service.pluginconversion.PluginConverter; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.osgi.framework.BundleException; - -public class StandalonePluginConverterTest { - - @Rule - public TemporaryFolder folder = new TemporaryFolder(); - private PluginConverter converter; - - @Before - public void setup() { - converter = new StandalonePluginConverter(); - } - - @Test - public void testConvertPre30Manifest() throws PluginConversionException, FileNotFoundException, BundleException { - File mf = new File(folder.getRoot(), "MANIFEST"); - 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)); - Assert.assertEquals("testjar", headers.get("Bundle-SymbolicName")); - } - - @Test - public void testWriteManifest() throws PluginConversionException, BundleException, IOException { - File tmpManifestFile = folder.newFile("testManifest"); - Hashtable manifestToWrite = new Hashtable(); - 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)); - } - converter.writeManifest(tmpManifestFile, manifestToWrite, false); - Headers writtenManifest = Headers.parseManifest(new FileInputStream(tmpManifestFile)); - assertEquals(originalManifest.size(), writtenManifest.size()); - for (Enumeration keys = writtenManifest.keys(); keys.hasMoreElements();) { - String key = keys.nextElement(); - assertEquals(originalManifest.get(key), writtenManifest.get(key)); - } - } - -} diff --git a/tycho-pomgenerator-plugin/src/main/java/org/eclipse/tycho/pomgenerator/GeneratePomsMojo.java b/tycho-pomgenerator-plugin/src/main/java/org/eclipse/tycho/pomgenerator/GeneratePomsMojo.java index 66fa357..f277c0b 100644 --- a/tycho-pomgenerator-plugin/src/main/java/org/eclipse/tycho/pomgenerator/GeneratePomsMojo.java +++ b/tycho-pomgenerator-plugin/src/main/java/org/eclipse/tycho/pomgenerator/GeneratePomsMojo.java @@ -43,7 +43,7 @@ import org.codehaus.plexus.util.xml.XmlStreamReader; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.codehaus.plexus.util.xml.Xpp3DomBuilder; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import org.eclipse.osgi.framework.adaptor.FilePath; +import org.eclipse.osgi.framework.util.FilePath; import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.osgi.service.resolver.State; import org.eclipse.tycho.ArtifactDescriptor; diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java index 4554384..b2af8be 100644 --- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java +++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java @@ -42,7 +42,7 @@ import org.apache.maven.toolchain.Toolchain; import org.apache.maven.toolchain.ToolchainManager; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.cli.CommandLineUtils; -import org.eclipse.osgi.framework.internal.core.Constants; +import org.eclipse.osgi.internal.framework.EquinoxConfiguration; import org.eclipse.sisu.equinox.launching.BundleStartLevel; import org.eclipse.sisu.equinox.launching.DefaultEquinoxInstallationDescription; import org.eclipse.sisu.equinox.launching.EquinoxInstallation; @@ -1052,7 +1052,7 @@ public class TestMojo extends AbstractMojo { File profileFile = new File(new File(project.getBuild().getDirectory()), "custom.profile"); storeProperties(customProfileProps, profileFile); try { - cli.addVMArguments("-D" + Constants.OSGI_JAVA_PROFILE + "=" + profileFile.toURL()); + cli.addVMArguments("-D" + EquinoxConfiguration.PROP_OSGI_JAVA_PROFILE + "=" + profileFile.toURL()); } catch (MalformedURLException e) { // should not happen throw new RuntimeException(e); diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provisioning/ProvisionedInstallationDescription.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provisioning/ProvisionedInstallationDescription.java index 2cd05ed..52cc879 100644 --- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provisioning/ProvisionedInstallationDescription.java +++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provisioning/ProvisionedInstallationDescription.java @@ -10,7 +10,7 @@ ******************************************************************************/ package org.eclipse.tycho.surefire.provisioning; -import static org.eclipse.osgi.framework.adaptor.FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME; +import static org.eclipse.osgi.internal.framework.EquinoxContainer.NAME; import static org.eclipse.tycho.ArtifactKey.TYPE_ECLIPSE_PLUGIN; import java.io.File; @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor; +import org.eclipse.osgi.internal.framework.EquinoxContainer; import org.eclipse.sisu.equinox.launching.BundleStartLevel; import org.eclipse.sisu.equinox.launching.EquinoxInstallationDescription; import org.eclipse.tycho.ArtifactDescriptor; @@ -51,21 +51,21 @@ public class ProvisionedInstallationDescription implements EquinoxInstallationDe File pluginsDir = new File(location, "plugins"); File[] systemBundles = pluginsDir.listFiles(new FileFilter() { public boolean accept(File file) { - return file.isFile() && file.getName().startsWith(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME + "_"); + return file.isFile() && file.getName().startsWith(EquinoxContainer.NAME + "_"); } }); File systemBundle; if (systemBundles.length == 0) { - throw new IllegalArgumentException("No framework bundle " + FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME + throw new IllegalArgumentException("No framework bundle " + EquinoxContainer.NAME + " found in " + pluginsDir); } else if (systemBundles.length > 1) { throw new IllegalArgumentException("Multiple versions of the framework bundle " - + FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME + " found in " + pluginsDir); + + EquinoxContainer.NAME + " found in " + pluginsDir); } else { systemBundle = systemBundles[0]; } String version = bundleReader.loadManifest(systemBundle).getBundleVersion(); - ArtifactKey systemBundleKey = new DefaultArtifactKey(TYPE_ECLIPSE_PLUGIN, FRAMEWORK_SYMBOLICNAME, version); + ArtifactKey systemBundleKey = new DefaultArtifactKey(TYPE_ECLIPSE_PLUGIN, NAME, version); systemBundleDescriptor = new DefaultArtifactDescriptor(systemBundleKey, systemBundle, null, null, null); return systemBundleDescriptor; } -- 1.9.0