From 420f7b22e62d45ff579e700c6456834c0739e37f Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Fri, 2 Mar 2012 19:07:07 -0800 Subject: Make the library container be exported. This allows test projects that reference the app project to have access to the library(ies) and associated jar files. Change-Id: I7bebe3e1d2e2265a95b23f65e6f1f0c5e51271bb --- .../project/LibraryClasspathContainerInitializer.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'eclipse') 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..197d18c 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) { -- cgit v1.1