Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Dos Santos2012-03-01 21:12:13 -0500
committerLeo Dos Santos2012-03-01 21:12:13 -0500
commit1ca1c31d904a81f36fdecb73a08b763e9df0bec0 (patch)
tree0dd896b428155f0045a4d7f011a2270f42dd8da2
parent490729180ed14b251afb37d6da3248d3f5b5d3cf (diff)
downloadorg.eclipse.virgo.ide-p2-provisioned.tar.gz
org.eclipse.virgo.ide-p2-provisioned.tar.xz
org.eclipse.virgo.ide-p2-provisioned.zip
371034: Unable to add dependencies in the manifest editor's Dependenciesp2-provisioned
tab https://bugs.eclipse.org/bugs/show_bug.cgi?id=371034
-rw-r--r--org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jarbin27402 -> 37544 bytes
-rw-r--r--org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jarbin35132 -> 50065 bytes
-rw-r--r--org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/kernel/osgi/provisioning/tools/Pre35DependencyLocatorVirgo.java61
-rw-r--r--org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/ServerUtils.java8
-rw-r--r--org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/provisioning/ArtefactRepositoryManager.java2
5 files changed, 69 insertions, 2 deletions
diff --git a/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jar b/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jar
index 3b59d74..e1ccd7e 100644
--- a/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jar
+++ b/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jar
Binary files differ
diff --git a/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jar b/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jar
index 844f43c..edfbf7a 100644
--- a/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jar
+++ b/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jar
Binary files differ
diff --git a/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/kernel/osgi/provisioning/tools/Pre35DependencyLocatorVirgo.java b/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/kernel/osgi/provisioning/tools/Pre35DependencyLocatorVirgo.java
new file mode 100644
index 0000000..eacd46e
--- /dev/null
+++ b/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/kernel/osgi/provisioning/tools/Pre35DependencyLocatorVirgo.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2012 SpringSource, a divison of VMware, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * SpringSource, a division of VMware, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.virgo.kernel.osgi.provisioning.tools;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.virgo.ide.manifest.core.dependencies.IDependencyLocator;
+import org.eclipse.virgo.kernel.repository.BundleDefinition;
+import org.eclipse.virgo.kernel.repository.LibraryDefinition;
+import org.eclipse.virgo.util.osgi.manifest.BundleManifest;
+
+/**
+ * @author Leo Dos Santos
+ */
+public class Pre35DependencyLocatorVirgo implements IDependencyLocator {
+
+private final Pre35DependencyLocator dependencyLocator;
+
+ public Pre35DependencyLocatorVirgo(String serverHomePath, String[] additionalSearchPaths, String indexDirectoryPath,
+ JavaVersion javaVersion) throws IOException {
+ // Some platform dependent string matching
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ serverHomePath = serverHomePath.replace('/', '\\');
+ indexDirectoryPath = indexDirectoryPath.replace('/', '\\');
+ for (int i = 0; i < additionalSearchPaths.length; i++) {
+ additionalSearchPaths[i] = additionalSearchPaths[i].replace('/', '\\');
+ }
+ }
+ dependencyLocator = new Pre35DependencyLocator(serverHomePath, additionalSearchPaths, indexDirectoryPath, new NoOpEventLogger());
+ }
+
+ public Map<File, List<String>> locateDependencies(BundleManifest manifest) throws DependencyLocationException {
+ return dependencyLocator.locateDependencies(manifest);
+ }
+
+ public Set<? extends BundleDefinition> getBundles() {
+ return dependencyLocator.getBundles();
+ }
+
+ public Set<? extends LibraryDefinition> getLibraries() {
+ return dependencyLocator.getLibraries();
+ }
+
+ public void shutdown() {
+ dependencyLocator.shutdown();
+ }
+
+}
diff --git a/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/ServerUtils.java b/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/ServerUtils.java
index b0085be..e75d387 100644
--- a/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/ServerUtils.java
+++ b/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/ServerUtils.java
@@ -44,6 +44,7 @@ import org.eclipse.virgo.ide.runtime.internal.core.ServerRuntimeUtils;
import org.eclipse.virgo.ide.runtime.internal.core.utils.StatusUtil;
import org.eclipse.virgo.kernel.osgi.provisioning.tools.DependencyLocator;
import org.eclipse.virgo.kernel.osgi.provisioning.tools.DependencyLocatorVirgo;
+import org.eclipse.virgo.kernel.osgi.provisioning.tools.Pre35DependencyLocatorVirgo;
import org.eclipse.virgo.util.osgi.manifest.BundleManifest;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.util.PublishUtil;
@@ -169,7 +170,12 @@ public class ServerUtils {
String[] additionalSearchPaths, String indexDirectoryPath, JavaVersion javaVersion) throws IOException {
// TODO CD check to see if this can be moved into the version handler
if (runtime.getRuntimeType().getId().startsWith("org.eclipse.virgo.server.runtime.virgo")) {
- return new DependencyLocatorVirgo(serverHomePath, additionalSearchPaths, indexDirectoryPath, javaVersion);
+ if (runtime.getRuntimeType().getId().endsWith("runtime.virgo")) {
+ // Prior to Virgo 3.5, the runtime ID did not include a version suffix
+ return new Pre35DependencyLocatorVirgo(serverHomePath, additionalSearchPaths, indexDirectoryPath, javaVersion);
+ } else {
+ return new DependencyLocatorVirgo(serverHomePath, additionalSearchPaths, indexDirectoryPath, javaVersion);
+ }
}
return null;
}
diff --git a/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/provisioning/ArtefactRepositoryManager.java b/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/provisioning/ArtefactRepositoryManager.java
index e6cd6a4..c640f8d 100644
--- a/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/provisioning/ArtefactRepositoryManager.java
+++ b/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/core/provisioning/ArtefactRepositoryManager.java
@@ -60,9 +60,9 @@ import org.eclipse.virgo.kernel.repository.BundleDefinition;
import org.eclipse.virgo.kernel.repository.BundleRepository;
import org.eclipse.virgo.kernel.repository.LibraryDefinition;
import org.eclipse.virgo.repository.ArtifactDescriptor;
-import org.eclipse.virgo.util.osgi.VersionRange;
import org.eclipse.virgo.util.osgi.manifest.BundleManifest;
import org.eclipse.virgo.util.osgi.manifest.ExportedPackage;
+import org.eclipse.virgo.util.osgi.manifest.VersionRange;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.util.PublishUtil;
import org.osgi.framework.Bundle;

Back to the top