[jboss-svn-commits] JBL Code SVN: r13560 - in labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse: builder and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 16 17:04:10 EDT 2007


Author: KrisVerlaenen
Date: 2007-07-16 17:04:10 -0400 (Mon, 16 Jul 2007)
New Revision: 13560

Modified:
   labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/DroolsEclipsePlugin.java
   labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/builder/DroolsBuilder.java
   labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/util/ProjectClassLoader.java
Log:
- Cache is cleaned when doing a full clean
- Fixed issue whit multiple output paths

Modified: labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/DroolsEclipsePlugin.java
===================================================================
--- labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/DroolsEclipsePlugin.java	2007-07-16 21:01:52 UTC (rev 13559)
+++ labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/DroolsEclipsePlugin.java	2007-07-16 21:04:10 UTC (rev 13560)
@@ -102,16 +102,20 @@
 				if (IDroolsConstants.CACHE_PARSED_RULES.equals(event.getProperty())) {
 					useCachePreference = ((Boolean) event.getNewValue()).booleanValue();
 					if (!useCachePreference) {
-						parsedRules.clear();
-						compiledRules.clear();
-						ruleInfoByClassNameMap.clear();
-						functionInfoByClassNameMap.clear();
+						clearCache();
 					}
 				}
 			}
     	});
 
     }
+	
+	public void clearCache() {
+		parsedRules.clear();
+		compiledRules.clear();
+		ruleInfoByClassNameMap.clear();
+		functionInfoByClassNameMap.clear();
+	}
 
 	/**
 	 * This method is called when the plug-in is stopped

Modified: labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/builder/DroolsBuilder.java
===================================================================
--- labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/builder/DroolsBuilder.java	2007-07-16 21:01:52 UTC (rev 13559)
+++ labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/builder/DroolsBuilder.java	2007-07-16 21:04:10 UTC (rev 13560)
@@ -85,6 +85,7 @@
     
     protected void fullBuild(IProgressMonitor monitor)
             throws CoreException {
+    	DroolsEclipsePlugin.getDefault().clearCache();
         getProject().accept(new DroolsBuildVisitor());
     }
     

Modified: labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/util/ProjectClassLoader.java
===================================================================
--- labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/util/ProjectClassLoader.java	2007-07-16 21:01:52 UTC (rev 13559)
+++ labs/jbossrules/trunk/drools-eclipse/drools-eclipse-plugin/src/main/java/org/drools/eclipse/util/ProjectClassLoader.java	2007-07-16 21:04:10 UTC (rev 13560)
@@ -5,7 +5,10 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
 
 import org.drools.eclipse.DroolsEclipsePlugin;
 import org.eclipse.core.resources.IFile;
@@ -65,6 +68,7 @@
         List pathElements = new ArrayList();
         try {
             IClasspathEntry[] paths = project.getResolvedClasspath(true);
+            Set outputPaths = new HashSet();
             if (paths != null) {
                 
                 for ( int i = 0; i < paths.length; i++ ) {
@@ -72,6 +76,11 @@
                     if (path.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
                         URL url = getRawLocationURL(path.getPath());
                         pathElements.add(url);
+                    } else if (path.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+                    	IPath output = path.getOutputLocation();
+                    	if (path.getOutputLocation() != null) {
+                    		outputPaths.add(output);
+                    	}
                     }
                 }
             }
@@ -79,6 +88,11 @@
             IPath outputPath = location.append(project.getOutputLocation()
                     .removeFirstSegments(1));
             pathElements.add(outputPath.toFile().toURI().toURL());
+            for (Iterator iterator = outputPaths.iterator(); iterator.hasNext(); ) {
+            	IPath path = (IPath) iterator.next();
+            	outputPath = location.append(path.removeFirstSegments(1));
+                pathElements.add(outputPath.toFile().toURI().toURL());
+            }
             
             // also add classpath of required projects
             String[] names = project.getRequiredProjectNames();




More information about the jboss-svn-commits mailing list