Update to Eclipse Luna (4.4).

This commit is contained in:
Roland Grunberg 2014-03-31 20:24:47 -04:00
parent c0ed3543a1
commit 30d1cba15c
4 changed files with 550 additions and 19 deletions

View File

@ -1,2 +1,2 @@
cdbd828c774f7508e65dcef3324b9d2d tycho-0.20.0.tar.bz2
9ddabf6744eb091413cb8671639521c4 eclipse-bootstrap.tar.xz
b2de7dbdbc54879ec4e39aee1409540e eclipse-bootstrap.tar.xz

View File

@ -55,7 +55,8 @@ osgiLocations=( '/usr/share/java' '/usr/lib/java' '/usr/lib*/eclipse' )
if [ ${eclipse_bootstrap} -eq 1 ]; then
prefix="$(pwd)/bootstrap"
osgiLocations+=( ${osgiLocations[@]/#/${prefix}} )
osgiLocations=( ${osgiLocations[@]/#/${prefix}} )
osgiLocations+=( ${osgiLocations[@]/${prefix}/} )
fi
wantedBundles=`echo $1 | tr ',' ' '`
@ -70,7 +71,7 @@ for loc in ${osgiLocations[@]} ; do
echo ${wantedBundles} | grep -q "${bsn}"
if [ $? -eq 0 ]; then
cp ${jar} "${destDir}/${bsn}_${vers}.jar"
wantedBundles=`echo ${wantedBundles} | sed "s/\(${bsn}\s\|\s${bsn}\s\|\s${bsn}\)/ /"`
wantedBundles=`removeFromList "${wantedBundles}" "${bsn}"`
fi
fi
done
@ -78,12 +79,23 @@ done
}
function removeFromList () {
arr=( ${1} )
for (( i=0; i < ${#arr[@]}; i++ )); do
if [ "${arr[${i}]}" = "$2" ]; then
arr[${i}]=
fi
done
echo ${arr[@]}
}
function isolateProject () {
sed -i '/<parent>/,/<\/parent>/ d' "$1/pom.xml"
sed -i "/<modelVersion>/ a <groupId>org.eclipse.tycho<\/groupId><version>${v}<\/version>" "$1/pom.xml"
sed -i "/<artifactId>org.eclipse.osgi<\/artifactId>/ a <version>${osgiV}</version>" "$1/pom.xml"
sed -i "/<artifactId>org.eclipse.osgi.compatibility.state<\/artifactId>/ a <version>${osgiV}</version>" "$1/pom.xml"
}
function unifyProject () {
@ -134,7 +146,7 @@ echo ${bsn}
eclipse_bootstrap=$1
preV='0.20.0'
v='0.20.0-SNAPSHOT'
osgiV='3.9.1.v20131014-1715'
osgiV='3.10.0.v20140328-1811'
bundles=()
bundles[0]='tycho-bundles/org.eclipse.tycho.embedder.shared'
bundles[1]='tycho-bundles/org.eclipse.tycho.core.shared'
@ -221,7 +233,7 @@ mkdir -p 'eclipse/configuration'
echo '#Product Runtime Configuration File
#Thu Dec 19 21:40:37 EST 2013
osgi.bundles=org.apache.commons.codec,org.apache.commons.logging,org.apache.httpcomponents.httpclient,org.apache.httpcomponents.httpcore,org.eclipse.core.contenttype,org.eclipse.core.jobs,org.eclipse.core.net,org.eclipse.core.runtime@4\:start,org.eclipse.core.runtime.compatibility.registry,org.eclipse.ecf,org.eclipse.ecf.filetransfer,org.eclipse.ecf.identity,org.eclipse.ecf.provider.filetransfer,org.eclipse.ecf.provider.filetransfer.httpclient4,org.eclipse.ecf.provider.filetransfer.httpclient4.ssl,org.eclipse.ecf.provider.filetransfer.ssl,org.eclipse.ecf.ssl,org.eclipse.equinox.app,org.eclipse.equinox.common@2\:start,org.eclipse.equinox.concurrent,org.eclipse.equinox.ds@2\:start,org.eclipse.equinox.frameworkadmin,org.eclipse.equinox.frameworkadmin.equinox,org.eclipse.equinox.launcher,org.eclipse.equinox.p2.artifact.repository,org.eclipse.equinox.p2.core,org.eclipse.equinox.p2.director,org.eclipse.equinox.p2.director.app,org.eclipse.equinox.p2.engine,org.eclipse.equinox.p2.garbagecollector,org.eclipse.equinox.p2.jarprocessor,org.eclipse.equinox.p2.metadata,org.eclipse.equinox.p2.metadata.repository,org.eclipse.equinox.p2.publisher,org.eclipse.equinox.p2.publisher.eclipse,org.eclipse.equinox.p2.repository,org.eclipse.equinox.p2.repository.tools,org.eclipse.equinox.p2.touchpoint.eclipse,org.eclipse.equinox.p2.touchpoint.natives,org.eclipse.equinox.p2.transport.ecf,org.eclipse.equinox.p2.updatesite,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.equinox.security,org.eclipse.equinox.simpleconfigurator,org.eclipse.equinox.simpleconfigurator.manipulator,org.eclipse.equinox.util,org.eclipse.osgi.services,org.eclipse.tycho.noopsecurity,org.sat4j.core,org.sat4j.pb
osgi.bundles=org.apache.commons.codec,org.apache.commons.logging,org.apache.httpcomponents.httpclient,org.apache.httpcomponents.httpcore,org.eclipse.core.contenttype,org.eclipse.core.jobs,org.eclipse.core.net,org.eclipse.core.runtime@4\:start,org.eclipse.core.runtime.compatibility.registry,org.eclipse.ecf,org.eclipse.ecf.filetransfer,org.eclipse.ecf.identity,org.eclipse.ecf.provider.filetransfer,org.eclipse.ecf.provider.filetransfer.httpclient4,org.eclipse.ecf.provider.filetransfer.httpclient4.ssl,org.eclipse.ecf.provider.filetransfer.ssl,org.eclipse.ecf.ssl,org.eclipse.equinox.app,org.eclipse.equinox.common@2\:start,org.eclipse.equinox.concurrent,org.eclipse.equinox.ds@2\:start,org.eclipse.equinox.frameworkadmin,org.eclipse.equinox.frameworkadmin.equinox,org.eclipse.equinox.launcher,org.eclipse.equinox.p2.artifact.repository,org.eclipse.equinox.p2.core,org.eclipse.equinox.p2.director,org.eclipse.equinox.p2.director.app,org.eclipse.equinox.p2.engine,org.eclipse.equinox.p2.garbagecollector,org.eclipse.equinox.p2.jarprocessor,org.eclipse.equinox.p2.metadata,org.eclipse.equinox.p2.metadata.repository,org.eclipse.equinox.p2.publisher,org.eclipse.equinox.p2.publisher.eclipse,org.eclipse.equinox.p2.repository,org.eclipse.equinox.p2.repository.tools,org.eclipse.equinox.p2.touchpoint.eclipse,org.eclipse.equinox.p2.touchpoint.natives,org.eclipse.equinox.p2.transport.ecf,org.eclipse.equinox.p2.updatesite,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.equinox.security,org.eclipse.equinox.simpleconfigurator,org.eclipse.equinox.simpleconfigurator.manipulator,org.eclipse.equinox.util,org.eclipse.osgi.services,org.eclipse.osgi.compatibility.state,org.eclipse.tycho.noopsecurity,org.sat4j.core,org.sat4j.pb
osgi.bundles.defaultStartLevel=4
eclipse.product=org.eclipse.equinox.p2.director.app.product
osgi.splashPath=platform\:/base/plugins/org' > 'eclipse/configuration/config.ini'

502
tycho-eclipse-luna.patch Normal file
View File

@ -0,0 +1,502 @@
From 920242e853449e5f8c75d522155f006d15d1fa4a Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
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 \
<version>${equinoxVersion}</version>
</dependency>
<dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>org.eclipse.osgi.compatibility.state</artifactId>
+ <version>${equinoxVersion}</version>
+ </dependency>
+ <dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>${jdtVersion}</version>
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 @@
<plugin id="org.eclipse.equinox.simpleconfigurator.manipulator"/>
<plugin id="org.eclipse.equinox.util"/>
<plugin id="org.eclipse.osgi"/>
+ <plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
<plugin id="org.eclipse.osgi.services"/>
<plugin id="org.eclipse.tycho.noopsecurity"/>
<plugin id="org.sat4j.core"/>
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 @@
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>org.eclipse.osgi.compatibility.state</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>sisu-equinox-embedder</artifactId>
<version>${project.version}</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<SystemCapability> 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<Object, Object> platformProperties = new Hashtable<Object, Object>(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<String, String> systemBundleManifest = new Hashtable<String, String>();
- 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<File> 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<String, String> 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<String, String> manifestToWrite = new Hashtable<String, String>();
- Headers<String, String> 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));
- }
- converter.writeManifest(tmpManifestFile, manifestToWrite, false);
- Headers<String, String> writtenManifest = Headers.parseManifest(new FileInputStream(tmpManifestFile));
- assertEquals(originalManifest.size(), writtenManifest.size());
- for (Enumeration<String> 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

View File

@ -6,7 +6,7 @@
# This basically uses javac + xmvn to build only the Tycho components
# required to perform a full Tycho build
# Most common usage : A library (in Fedora) used by Tycho's runtime broke API
%global tycho_bootstrap 0
%global tycho_bootstrap 1
# Set 'eclipse_bootstrap' if Eclipse from buildroot cannot help build Tycho
# This basically provides a location for usage of pre-bundled Eclipse
# Possible uses : Need to build Tycho before Eclipse in fresh buildroot
@ -19,7 +19,7 @@
Name: tycho
Version: 0.20.0
Release: 1%{?dist}
Release: 1.1%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
Group: Development/Libraries
@ -40,14 +40,15 @@ Source4: eclipse-bootstrap.tar.xz
%endif
Patch0: %{name}-fix-build.patch
Patch1: %{name}-eclipse-luna.patch
# Upstream builds against maven-surefire 2.12.3
Patch1: %{name}-maven-surefire.patch
Patch2: %{name}-fix-surefire.patch
Patch3: %{name}-use-custom-resolver.patch
Patch2: %{name}-maven-surefire.patch
Patch3: %{name}-fix-surefire.patch
Patch4: %{name}-use-custom-resolver.patch
# Set some temporary build version so that the bootstrapped build has
# a different version from the nonbootstrapped. Otherwise there will
# be cyclic dependencies.
Patch4: %{name}-bootstrap.patch
Patch5: %{name}-bootstrap.patch
# Additional changes needed just for bootstrap build
Patch7: %{name}-fix-bootstrap-build.patch
@ -166,6 +167,7 @@ This package contains the API documentation for %{name}.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
find tycho-core -iname '*html' -delete
@ -236,11 +238,11 @@ echo "System version is ${sysVer} and attempting to build ${buildVer}."
# an intermediary build must be done to prevent a cycle at build time.
if [ "${sysVer}" == "${buildVer}" ]; then
echo "Performing intermediary build"
%patch4 -p1
%patch5 -p1
xmvn -o -Dmaven.test.skip=true -Dmaven.repo.local=$(pwd)/.m2 install
%patch4 -p1 -R
%patch5 -p1 -R
# EXACT version in reactor cache to build against (%%{version}-SNAPSHOT)
sed -i 's/<tychoBootstrapVersion>0.18.1<\/tychoBootstrapVersion>/<tychoBootstrapVersion>0.20.0-SNAPSHOT<\/tychoBootstrapVersion>/' pom.xml
@ -307,23 +309,35 @@ install -pm 755 %{SOURCE3} $RPM_BUILD_ROOT%{_javadir}/%{name}/copy-platform-all
%if %{eclipse_bootstrap}
# org.eclipse.osgi
osgiJarPath=`find ".m2/org" -name "org.eclipse.osgi_*.jar"`
osgiJar=`basename $osgiJarPath`
osgiVer=`echo $osgiJar | sed 's/^.*_//' | sed 's/.jar//'`
# http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.eclipse-build.git/tree/externalpoms/org.eclipse.osgi-3.6.0.v20100517.pom
# http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.eclipse-build.git/tree/externalpoms/org.eclipse.osgi.pom
echo '<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xsi:noNamespaceSchemaLocation="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<version>3.6.0.v20100517</version>
<description>OSGi System Bundle %%systemBundle</description>
<!-- See https://issues.sonatype.org/browse/OSSRH-739 -->
<version>3.10.0.v20140328-1811</version>
</project>' > JPP.tycho-osgi.pom
install -pm 644 JPP.tycho-osgi.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-osgi.pom
install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar
%add_maven_depmap JPP.%{name}-osgi.pom %{name}/osgi.jar -a "org.eclipse.tycho:org.eclipse.osgi"
# org.eclipse.osgi.compatibility.state
osgiStateJarPath=`find ".m2/org" -name "org.eclipse.osgi.compatibility.state_*.jar"`
# http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.eclipse-build.git/tree/externalpoms/org.eclipse.osgi.compatibility.state.pom
echo '<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xsi:noNamespaceSchemaLocation="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.compatibility.state</artifactId>
<version>1.0.0.v20140328-1811</version>
</project>' > JPP.tycho-osgi.compatibility.state.pom
install -pm 644 JPP.tycho-osgi.compatibility.state.pom $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.tycho-osgi.compatibility.state.pom
install -m 644 $osgiStateJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.compatibility.state.jar
%add_maven_depmap JPP.%{name}-osgi.compatibility.state.pom %{name}/osgi.compatibility.state.jar -a "org.eclipse.tycho:org.eclipse.osgi.compatibility.state"
%endif
%files
@ -336,6 +350,9 @@ install -m 644 $osgiJarPath $RPM_BUILD_ROOT%{_javadir}/%{name}/osgi.jar
%{_javadocdir}/%{name}
%changelog
* Thu Mar 27 2014 Roland Grunberg <rgrunber@redhat.com> - 0.20.0-1.1
- Update to Eclipse Luna (4.4).
* Mon Mar 24 2014 Roland Grunberg <rgrunber@redhat.com> - 0.20.0-1
- Update to 0.20.0 Release.