aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-06-20 20:12:04 -0700
committerTor Norbye <tnorbye@google.com>2012-06-20 20:14:20 -0700
commit86b9ea11f0f65ac33c417712b2f50022c5b84977 (patch)
tree3a9edd82b0e12a0182376cf93c08aa1464f48db2
parent401b5c1aa8f51f332405460faddaa4c1921867a0 (diff)
downloadsdk-86b9ea11f0f65ac33c417712b2f50022c5b84977.zip
sdk-86b9ea11f0f65ac33c417712b2f50022c5b84977.tar.gz
sdk-86b9ea11f0f65ac33c417712b2f50022c5b84977.tar.bz2
Fix validation where selecting same build and min sdk version
Fix bug where selecting the same min sdk version and build target version would result in a wizard complaint that the minSdkVersion was higher than the build target API level. This happened because the code passed the minSdk string to the AndroidVersion compare method, which assumes that string is a codename; in the wizard case it can be the string representation of the api level. Change-Id: Icf87f0b45fe3905bd9a7ae4fba7883d3a5fc4b4a
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
index 83326a4..d4aff90 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
@@ -611,7 +611,8 @@ public class NewProjectPage extends WizardPage
"Preview platforms require the min SDK version to match their codenames.");
}
} else if (mValues.target.getVersion().compareTo(
- mValues.minSdkLevel, mValues.minSdk) < 0) {
+ mValues.minSdkLevel,
+ version.isPreview() ? mValues.minSdk : null) < 0) {
status = new Status(IStatus.WARNING, AdtPlugin.PLUGIN_ID,
"The minimum SDK version is higher than the build target version");
}