diff options
author | Tor Norbye <tnorbye@google.com> | 2014-02-14 14:35:16 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-02-14 14:38:17 -0800 |
commit | 19db9aa4690383017dfd94fdd489480733103ec2 (patch) | |
tree | fd6e99be772fda0cfab748cfdf8d9f1460b062d2 | |
parent | 3ce7789f80db952bb80235f893b0e9fd238a317f (diff) | |
download | sdk-19db9aa4690383017dfd94fdd489480733103ec2.zip sdk-19db9aa4690383017dfd94fdd489480733103ec2.tar.gz sdk-19db9aa4690383017dfd94fdd489480733103ec2.tar.bz2 |
Tweak error message for compiler compliance with 1.7
Change-Id: I48270a247f90e872210ca9758421bb49921b135f
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java index 770710d..c850a2a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java @@ -24,6 +24,8 @@ import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs; import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity; import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper; import com.android.ide.eclipse.adt.internal.project.ProjectHelper; +import com.android.ide.eclipse.adt.internal.sdk.Sdk; +import com.android.sdklib.IAndroidTarget; import com.android.utils.Pair; import org.eclipse.core.resources.IFolder; @@ -110,6 +112,20 @@ public class ResourceManagerBuilder extends BaseBuilder { errorMessage = String.format(errorMessage, result.getSecond() == null ? "(no value)" : result.getSecond()); + if (JavaCore.VERSION_1_7.equals(result.getSecond())) { + // If the user is trying to target 1.7 but compiling with something older, + // the error message can be a bit misleading; instead point them in the + // direction of updating the project's build target. + Sdk currentSdk = Sdk.getCurrent(); + if (currentSdk != null) { + IAndroidTarget target = currentSdk.getTarget(project.getProject()); + if (target != null && target.getVersion().getApiLevel() < 19) { + errorMessage = "Using 1.7 requires compiling with Android 4.4 " + + "(KitKat); currently using " + target.getVersion(); + } + } + } + markProject(AdtConstants.MARKER_ADT, errorMessage, IMarker.SEVERITY_ERROR); AdtPlugin.printErrorToConsole(project, errorMessage); |