diff options
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java index 7a19344..65fd9c7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java @@ -144,7 +144,8 @@ public class LibraryClasspathContainerInitializer extends BaseClasspathContainer if (foundLibrariesContainer == false) { // add the android container to the array rawClasspath = ProjectHelper.addEntryToClasspath(rawClasspath, - JavaCore.newContainerEntry(new Path(AdtConstants.CONTAINER_LIBRARIES))); + JavaCore.newContainerEntry(new Path(AdtConstants.CONTAINER_LIBRARIES), + true /*isExported*/)); } // set the new list of entries to the project @@ -208,7 +209,8 @@ public class LibraryClasspathContainerInitializer extends BaseClasspathContainer IClasspathEntry entry = JavaCore.newLibraryEntry( jarIFile.getLocation(), sourceFolder, // source attachment path - null); // default source attachment root path. + null, // default source attachment root path. + true /*isExported*/); entries.add(entry); @@ -237,7 +239,7 @@ public class LibraryClasspathContainerInitializer extends BaseClasspathContainer // now add a classpath entry for each Java project (this is a set so dups are already // removed) for (IProject p : refProjects) { - entries.add(JavaCore.newProjectEntry(p.getFullPath())); + entries.add(JavaCore.newProjectEntry(p.getFullPath(), true /*isExported*/)); } // and process the jar files list, but first sanitize it to remove dups. @@ -262,10 +264,11 @@ public class LibraryClasspathContainerInitializer extends BaseClasspathContainer e.getSourceAttachmentRootPath(), e.getAccessRules(), e.getExtraAttributes(), - e.isExported())); + true /*isExported*/)); } else { entries.add(JavaCore.newLibraryEntry(new Path(jarFile.getAbsolutePath()), - null /*sourceAttachmentPath*/, null /*sourceAttachmentRootPath*/)); + null /*sourceAttachmentPath*/, null /*sourceAttachmentRootPath*/, + true /*isExported*/)); } } } catch (DifferentLibException e) { @@ -347,6 +350,10 @@ public class LibraryClasspathContainerInitializer extends BaseClasspathContainer IClasspathEntry[] classpaths = javaProject.readRawClasspath(); if (classpaths != null) { for (IClasspathEntry e : classpaths) { + // only consider the classpath entries that are exported. + if (e.isExported() == false) { + continue; + } // if this is a classpath variable reference, we resolve it. if (e.getEntryKind() == IClasspathEntry.CPE_VARIABLE) { e = JavaCore.getResolvedClasspathEntry(e); @@ -365,7 +372,9 @@ public class LibraryClasspathContainerInitializer extends BaseClasspathContainer container.getKind() == IClasspathContainer.K_APPLICATION) { IClasspathEntry[] entries = container.getClasspathEntries(); for (IClasspathEntry entry : entries) { - handleClasspathEntry(entry, wsRoot, jarFiles); + if (entry.isExported()) { + handleClasspathEntry(entry, wsRoot, jarFiles); + } } } } catch (JavaModelException jme) { |