You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2006/09/11 18:24:51 UTC

svn commit: r442246 - /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java

Author: sppatel
Date: Mon Sep 11 09:24:49 2006
New Revision: 442246

URL: http://svn.apache.org/viewvc?view=rev&rev=442246
Log:
add in-place shared lib support for sharedlibs that are java projects

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java?view=diff&rev=442246&r1=442245&r2=442246
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java Mon Sep 11 09:24:49 2006
@@ -26,9 +26,12 @@
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
 
+import org.apache.geronimo.st.core.internal.Trace;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
@@ -45,6 +48,8 @@
 import org.eclipse.wst.server.core.IServer;
 import org.eclipse.wst.server.core.ServerUtil;
 
+import sun.java2d.loops.GraphicsPrimitive.TraceReporter;
+
 public class SharedLibEntryCreationOperation extends AbstractDataModelOperation implements ISharedLibEntryCreationDataModelProperties {
 
 	public SharedLibEntryCreationOperation() {
@@ -105,13 +110,19 @@
 			for (int i = 0; i < cp.length; i++) {
 				IClasspathEntry entry = cp[i];
 				int kind = entry.getEntryKind();
-				if (kind == IClasspathEntry.CPE_LIBRARY
-						|| kind == IClasspathEntry.CPE_VARIABLE) {
-					if (kind == IClasspathEntry.CPE_VARIABLE) {
-						// TODO exclude and return if web-inf/lib entries
+				if (kind == IClasspathEntry.CPE_LIBRARY || kind == IClasspathEntry.CPE_VARIABLE || kind == IClasspathEntry.CPE_PROJECT) {
+					IPath path = null;
+					if(kind == IClasspathEntry.CPE_PROJECT) {
+						IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(entry.getPath().segment(0));
+						IJavaProject ref = JavaCore.create(p);
+						path = p.getLocation().removeLastSegments(1).append(ref.getOutputLocation());
+					} else {
+						IClasspathEntry resolved = JavaCore.getResolvedClasspathEntry(entry);
+						path = resolved.getPath().makeAbsolute();
 					}
-					IClasspathEntry resolved = JavaCore.getResolvedClasspathEntry(entry);
-					entries.add(resolved.getPath().makeAbsolute().toOSString());
+					
+					Trace.trace(Trace.INFO, "Adding " + path.toOSString());
+					entries.add(path.toOSString());
 				}
 			}