Also display error on empty minSdkVersion for preview targets.

BUG: 2050928
This commit is contained in:
Xavier Ducrohet
2009-08-12 17:57:35 -07:00
parent 9f30bb1c47
commit 7e97a5d23f

View File

@@ -335,9 +335,8 @@ public class PreCompilerBuilder extends BaseBuilder {
if (codename != null) {
// integer minSdk when the target is a preview => fatal error
String msg = String.format(
"Platform %1$s is a preview and requires appication manifests to set %2$s to '%3$s'",
codename, ManifestConstants.ATTRIBUTE_MIN_SDK_VERSION,
codename);
"Platform %1$s is a preview and requires appication manifests to set %2$s to '%1$s'",
codename, ManifestConstants.ATTRIBUTE_MIN_SDK_VERSION);
AdtPlugin.printErrorToConsole(project, msg);
BaseProjectHelper.addMarker(manifest, AdtConstants.MARKER_ADT, msg,
IMarker.SEVERITY_ERROR);
@@ -375,6 +374,17 @@ public class PreCompilerBuilder extends BaseBuilder {
stopBuild(msg);
}
}
} else if (projectTarget.getVersion().isPreview()) {
// else the minSdkVersion is not set but we are using a preview target.
// Display an error
String codename = projectTarget.getVersion().getCodename();
String msg = String.format(
"Platform %1$s is a preview and requires appication manifests to set %2$s to '%1$s'",
codename, ManifestConstants.ATTRIBUTE_MIN_SDK_VERSION);
AdtPlugin.printErrorToConsole(project, msg);
BaseProjectHelper.addMarker(manifest, AdtConstants.MARKER_ADT, msg,
IMarker.SEVERITY_ERROR);
stopBuild(msg);
}
if (javaPackage == null || javaPackage.length() == 0) {