Parser detects wrong include files now
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / core / builder / BatchImageBuilder.java
index 8743da1..d29be84 100644 (file)
@@ -12,9 +12,8 @@ package net.sourceforge.phpdt.internal.core.builder;
 
 import java.util.ArrayList;
 
-import net.sourceforge.phpdt.internal.core.JavaModelManager;
-import net.sourceforge.phpdt.internal.core.Util;
-import net.sourceforge.phpeclipse.PHPCore;
+import net.sourceforge.phpdt.core.JavaCore;
+import net.sourceforge.phpdt.internal.core.util.Util;
 
 import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
@@ -37,9 +36,8 @@ public void build() {
 
        try {
                notifier.subTask(Util.bind("build.cleaningOutput")); //$NON-NLS-1$
-               JavaModelManager.getJavaModelManager().deltaProcessor.addForRefresh(javaBuilder.javaProject);
                PHPBuilder.removeProblemsAndTasksFor(javaBuilder.currentProject);
-//             cleanOutputFolders();
+//             cleanOutputFolders(true);
                notifier.updateProgressDelta(0.1f);
 
                notifier.subTask(Util.bind("build.analyzingSources")); //$NON-NLS-1$
@@ -58,6 +56,7 @@ public void build() {
 
                if (javaBuilder.javaProject.hasCycleMarker())
                        javaBuilder.mustPropagateStructuralChanges();
+               
        } catch (CoreException e) {
                throw internalException(e);
        } finally {
@@ -66,6 +65,7 @@ public void build() {
 }
 
 protected void addAllSourceFiles(final ArrayList sourceFiles) throws CoreException {
+    
        for (int i = 0, l = sourceLocations.length; i < l; i++) {
                final ClasspathMultiDirectory sourceLocation = sourceLocations[i];
                final char[][] exclusionPatterns = sourceLocation.exclusionPatterns;
@@ -80,7 +80,7 @@ protected void addAllSourceFiles(final ArrayList sourceFiles) throws CoreExcepti
                                        }
                                        switch(proxy.getType()) {
                                                case IResource.FILE :
-                                                       if (Util.isJavaFileName(proxy.getName())) {
+                                                       if (net.sourceforge.phpdt.internal.compiler.util.Util.isJavaFileName(proxy.getName())) {
                                                                if (resource == null)
                                                                        resource = proxy.requestResource();
                                                                sourceFiles.add(new SourceFile((IFile) resource, sourceLocation, encoding));
@@ -99,8 +99,8 @@ protected void addAllSourceFiles(final ArrayList sourceFiles) throws CoreExcepti
 }
 
 protected void cleanOutputFolders() throws CoreException {
-       boolean deleteAll = PHPCore.CLEAN.equals(
-               javaBuilder.javaProject.getOption(PHPCore.CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER, true));
+       boolean deleteAll = JavaCore.CLEAN.equals(
+               javaBuilder.javaProject.getOption(JavaCore.CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER, true));
        if (deleteAll) {
                ArrayList visited = new ArrayList(sourceLocations.length);
                for (int i = 0, l = sourceLocations.length; i < l; i++) {
@@ -131,7 +131,7 @@ protected void cleanOutputFolders() throws CoreException {
                                                                if (Util.isExcluded(resource, exclusionPatterns)) return false;
                                                        }
                                                        if (proxy.getType() == IResource.FILE) {
-//                                                             if (Util.isClassFileName(proxy.getName())) {
+//                                                             if (ProjectPrefUtil.isClassFileName(proxy.getName())) {
 //                                                                     if (resource == null)
 //                                                                             resource = proxy.requestResource();
 //                                                                     resource.delete(IResource.FORCE, null);
@@ -178,7 +178,7 @@ protected void copyExtraResourcesBack(ClasspathMultiDirectory sourceLocation, fi
                                IResource resource = null;
                                switch(proxy.getType()) {
                                        case IResource.FILE :
-                                               if (Util.isJavaFileName(proxy.getName())) return false;// || Util.isClassFileName(proxy.getName())) return false;
+                                               if (net.sourceforge.phpdt.internal.compiler.util.Util.isJavaFileName(proxy.getName())) return false;// || ProjectPrefUtil.isClassFileName(proxy.getName())) return false;
 
                                                resource = proxy.requestResource();
                                                if (javaBuilder.filterExtraResource(resource)) return false;
@@ -205,7 +205,7 @@ protected void copyExtraResourcesBack(ClasspathMultiDirectory sourceLocation, fi
 
                                                IPath folderPath = resource.getFullPath();
                                                if (isAlsoProject && isExcludedFromProject(folderPath)) return false; // the sourceFolder == project
-                                               createFolder(folderPath.removeFirstSegments(segmentCount), outputFolder);
+//                                             createFolder(folderPath.removeFirstSegments(segmentCount), outputFolder);
                                }
                                return true;
                        }
@@ -233,7 +233,7 @@ protected void copyPackages(ClasspathMultiDirectory sourceLocation) throws CoreE
 
                                                IPath folderPath = resource.getFullPath();
                                                if (isAlsoProject && isExcludedFromProject(folderPath)) return false; // the sourceFolder == project
-                                               createFolder(folderPath.removeFirstSegments(segmentCount), outputFolder);
+//                                             createFolder(folderPath.removeFirstSegments(segmentCount), outputFolder);
                                }
                                return true;
                        }