From 8688abd925ddd7288f9e9075f065ecd12a81ae05 Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Thu, 16 Feb 2012 17:08:13 -0800 Subject: Remove warning that minsdkVersion is lower than the compile target. This is not needed anymore now that Lint can check if this is actually a problem or not. Change-Id: I9f43f46033e07c44b78728e8582364b355ff1ccf --- anttasks/src/com/android/ant/NewSetupTask.java | 7 +------ .../build/builders/PostCompilerBuilder.java | 6 ++++-- .../build/builders/PreCompilerBuilder.java | 22 +++++++++------------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/anttasks/src/com/android/ant/NewSetupTask.java b/anttasks/src/com/android/ant/NewSetupTask.java index f3fd9aa..1f29d17 100644 --- a/anttasks/src/com/android/ant/NewSetupTask.java +++ b/anttasks/src/com/android/ant/NewSetupTask.java @@ -412,12 +412,7 @@ public class NewSetupTask extends Task { antProject.setProperty(mTargetApiOut, value); int projectApiLevel = androidVersion.getApiLevel(); - if (minSdkValue < projectApiLevel) { - System.out.println(String.format( - "WARNING: Attribute %1$s in AndroidManifest.xml (%2$d) is lower than the project target API level (%3$d)", - AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION, - minSdkValue, projectApiLevel)); - } else if (minSdkValue > androidVersion.getApiLevel()) { + if (minSdkValue > androidVersion.getApiLevel()) { System.out.println(String.format( "WARNING: Attribute %1$s in AndroidManifest.xml (%2$d) is higher than the project target API level (%3$d)", AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION, diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java index 5f39c99..e963af8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java @@ -237,9 +237,11 @@ public class PostCompilerBuilder extends BaseBuilder { } // build() returns a list of project from which this project depends for future compilation. - @SuppressWarnings({"unchecked"}) @Override - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) + protected IProject[] build( + int kind, + @SuppressWarnings("rawtypes") Map args, + IProgressMonitor monitor) throws CoreException { // get a project object IProject project = getProject(); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java index ce37d61..7713f47 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java @@ -205,9 +205,11 @@ public class PreCompilerBuilder extends BaseBuilder { } // build() returns a list of project from which this project depends for future compilation. - @SuppressWarnings("unchecked") @Override - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) + protected IProject[] build( + int kind, + @SuppressWarnings("rawtypes") Map args, + IProgressMonitor monitor) throws CoreException { // get a project object IProject project = getProject(); @@ -411,15 +413,6 @@ public class PreCompilerBuilder extends BaseBuilder { BaseProjectHelper.markResource(manifestFile, AdtConstants.MARKER_ADT, msg, IMarker.SEVERITY_ERROR); return result; - } else if (minSdkValue < targetVersion.getApiLevel()) { - // integer minSdk is not high enough for the target => warning - String msg = String.format( - "Attribute %1$s (%2$d) is lower than the project target API level (%3$d)", - AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION, - minSdkValue, targetVersion.getApiLevel()); - AdtPlugin.printBuildToConsole(BuildVerbosity.VERBOSE, project, msg); - BaseProjectHelper.markResource(manifestFile, AdtConstants.MARKER_ADT, - msg, IMarker.SEVERITY_WARNING); } else if (minSdkValue > targetVersion.getApiLevel()) { // integer minSdk is too high for the target => warning String msg = String.format( @@ -650,8 +643,8 @@ public class PreCompilerBuilder extends BaseBuilder { } } - @SuppressWarnings("unchecked") - private void handleBuildConfig(Map args) throws IOException, CoreException { + private void handleBuildConfig(@SuppressWarnings("rawtypes") Map args) + throws IOException, CoreException { boolean debugMode = !args.containsKey(RELEASE_REQUESTED); BuildConfigGenerator generator = new BuildConfigGenerator( @@ -793,7 +786,10 @@ public class PreCompilerBuilder extends BaseBuilder { // launch aapt: create the command line ArrayList array = new ArrayList(); + + @SuppressWarnings("deprecation") String aaptPath = projectTarget.getPath(IAndroidTarget.AAPT); + array.add(aaptPath); array.add("package"); //$NON-NLS-1$ array.add("-m"); //$NON-NLS-1$ -- cgit v1.1