OSDN Git Service

Update Android project properties to support libraries depending on libraries.
authorXavier Ducrohet <xav@android.com>
Fri, 2 Jul 2010 01:01:43 +0000 (18:01 -0700)
committerXavier Ducrohet <xav@android.com>
Fri, 2 Jul 2010 16:36:12 +0000 (09:36 -0700)
This is simply enabling the ability to add libraries to a library project
in the UI.

Also updated the change log.

Change-Id: Ibaf67ce8c2af10ff890038a72de9f176bfae8592

eclipse/changes.txt
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/PostCompilerBuilder.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java
eclipse/plugins/com.android.ide.eclipse.ddms/.classpath

index 5cf67e2..f9eaf9d 100644 (file)
@@ -1,6 +1,7 @@
 0.9.8:
 - Fixed issue with library project names containing characters that aren't compatible with Eclipse path variable. The link between the main project and the library would fail to create.
 - Added support for library projects that don't have a source folder called "src". There is now support for any number of source folder, with no name restriction. They can even be in sub folder such as "src/java".
+- Added support for libraries with library dependencies.
 - added support for new resource qualifiers: car/desk, night/notnight and navexposed/navhidden
 
 0.9.7:
index 15f960c..539c8e3 100644 (file)
@@ -524,7 +524,7 @@ public class PostCompilerBuilder extends BaseBuilder {
             }
 
             msg = String.format("Unknown error: %1$s", msg);
-            AdtPlugin.printErrorToConsole(project, msg);
+            AdtPlugin.logAndPrintError(exception, project.getName(), msg);
             markProject(AndroidConstants.MARKER_PACKAGING, msg, IMarker.SEVERITY_ERROR);
         }
 
index 4621431..44da3a9 100644 (file)
@@ -85,12 +85,6 @@ public class AndroidPropertyPage extends PropertyPage implements IWorkbenchPrope
 
         mIsLibrary = new Button(libraryGroup, SWT.CHECK);
         mIsLibrary.setText("Is Library");
-        mIsLibrary.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mLibraryDependencies.setEnabled(!mIsLibrary.getSelection());
-            }
-        });
 
         mLibraryDependencies = new LibraryProperties(libraryGroup);
 
@@ -149,7 +143,7 @@ public class AndroidPropertyPage extends PropertyPage implements IWorkbenchPrope
                 mustSaveProp = true;
             }
 
-            if (mLibraryDependencies.save(mIsLibrary.getSelection())) {
+            if (mLibraryDependencies.save()) {
                 mustSaveProp = true;
             }
 
@@ -184,9 +178,7 @@ public class AndroidPropertyPage extends PropertyPage implements IWorkbenchPrope
             }
 
             mIsLibrary.setSelection(state.isLibrary());
-
             mLibraryDependencies.setContent(state);
-            mLibraryDependencies.setEnabled(!state.isLibrary());
 
             /*
              * APK-SPLIT: This is not yet supported, so we hide the UI
index 1675f7f..67de298 100644 (file)
@@ -113,7 +113,6 @@ final class LibraryProperties {
         mMatchIcon = AdtPlugin.getImageDescriptor("/icons/match.png").createImage(); //$NON-NLS-1$
         mErrorIcon = AdtPlugin.getImageDescriptor("/icons/error.png").createImage(); //$NON-NLS-1$
 
-
         // Layout has 2 column
         mTop = new Composite(parent, SWT.NONE);
         mTop.setLayout(new GridLayout(2, false));
@@ -259,13 +258,12 @@ final class LibraryProperties {
      * {@link #setContent(ProjectState)}.
      * <p/>This only saves the data into the {@link ProjectProperties} of the state, but does
      * not update the {@link ProjectState} or the list of {@link LibraryState}.
-     * @param isLibrary the new library flag of the project.
      * @return <code>true</code> if there was actually new data saved in the project state, false
      * otherwise.
      */
-    boolean save(boolean isLibrary) {
-        boolean mustSave = mMustSave || (isLibrary && mState.getLibraries().size() > 0);
-        if (mustSave) {
+    boolean save() {
+        boolean mustSave = mMustSave;
+        if (mMustSave) {
             // remove all previous library dependencies.
             ProjectProperties props = mState.getProperties();
             Set<String> keys = props.keySet();
@@ -276,12 +274,10 @@ final class LibraryProperties {
             }
 
             // now add the new libraries.
-            if (isLibrary == false) {
-                int index = 1;
-                for (ItemData data : mItemDataList) {
-                    props.setProperty(ProjectProperties.PROPERTY_LIB_REF + index++,
-                            data.relativePath);
-                }
+            int index = 1;
+            for (ItemData data : mItemDataList) {
+                props.setProperty(ProjectProperties.PROPERTY_LIB_REF + index++,
+                        data.relativePath);
             }
         }
 
index 9132c7b..7192196 100644 (file)
@@ -6,7 +6,7 @@
        <classpathentry kind="lib" path="libs/jfreechart-1.0.9.jar"/>
        <classpathentry kind="lib" path="libs/jcommon-1.0.12.jar"/>
        <classpathentry kind="lib" path="libs/jfreechart-1.0.9-swt.jar"/>
-       <classpathentry kind="lib" path="libs/ddmlib.jar"/>
-       <classpathentry kind="lib" path="libs/ddmuilib.jar"/>
+       <classpathentry kind="lib" path="libs/ddmlib.jar" sourcepath="/ddmlib"/>
+       <classpathentry kind="lib" path="libs/ddmuilib.jar" sourcepath="/ddmuilib"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>