From: Xavier Ducrohet Date: Fri, 2 Jul 2010 01:01:43 +0000 (-0700) Subject: Update Android project properties to support libraries depending on libraries. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b4e47556d21459d4582f932a256662b7bc8eb7dc;p=android-x86%2Fsdk.git Update Android project properties to support libraries depending on libraries. This is simply enabling the ability to add libraries to a library project in the UI. Also updated the change log. Change-Id: Ibaf67ce8c2af10ff890038a72de9f176bfae8592 --- diff --git a/eclipse/changes.txt b/eclipse/changes.txt index 5cf67e2a7..f9eaf9d38 100644 --- a/eclipse/changes.txt +++ b/eclipse/changes.txt @@ -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: diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/PostCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/PostCompilerBuilder.java index 15f960c6f..539c8e38c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/PostCompilerBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/PostCompilerBuilder.java @@ -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); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java index 4621431d6..44da3a997 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/AndroidPropertyPage.java @@ -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 diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java index 1675f7fa4..67de29839 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/properties/LibraryProperties.java @@ -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)}. *

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 true 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 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); } } diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/.classpath b/eclipse/plugins/com.android.ide.eclipse.ddms/.classpath index 9132c7b75..719219667 100644 --- a/eclipse/plugins/com.android.ide.eclipse.ddms/.classpath +++ b/eclipse/plugins/com.android.ide.eclipse.ddms/.classpath @@ -6,7 +6,7 @@ - - + +