Commit f79b3338 authored by Jakob Andersen's avatar Jakob Andersen Committed by GitHub

Remove unnecessary Android SDK checks. (#8926)

* Remove unnecessary Android SDK checks.

* Remove unused accessors, skip replay test.
parent 972da543
......@@ -124,14 +124,14 @@ class AndroidSdk {
/// Validate the Android SDK. This returns an empty list if there are no
/// issues; otherwise, it returns a list of issues found.
List<String> validateSdkWellFormed({bool requireApkSigner = true}) {
List<String> validateSdkWellFormed() {
if (!processManager.canRun(adbPath))
return <String>['Android SDK file not found: $adbPath.'];
if (sdkVersions.isEmpty || latestVersion == null)
return <String>['Android SDK is missing command line tools; download from https://goo.gl/XxQghQ'];
return latestVersion.validateSdkWellFormed(requireApkSigner: requireApkSigner);
return latestVersion.validateSdkWellFormed();
}
String getPlatformToolsPath(String binaryName) {
......@@ -227,32 +227,13 @@ class AndroidSdkVersion implements Comparable<AndroidSdkVersion> {
String get aaptPath => getBuildToolsPath('aapt');
String get dxPath => getBuildToolsPath('dx');
String get zipalignPath => getBuildToolsPath('zipalign');
String get apksignerPath => getBuildToolsPath('apksigner');
List<String> validateSdkWellFormed({bool requireApkSigner = true}) {
if (buildToolsVersion.major < minimumAndroidSdkVersion) {
return <String>['Minimum supported Android SDK version is $minimumAndroidSdkVersion '
'but this system has ${buildToolsVersion.major}. Please upgrade.'];
}
List<String> validateSdkWellFormed() {
if (_exists(androidJarPath) != null)
return <String>[_exists(androidJarPath)];
if (_canRun(aaptPath) != null)
return <String>[_canRun(aaptPath)];
if (_canRun(dxPath) != null)
return <String>[_canRun(dxPath)];
if (_canRun(zipalignPath) != null)
return <String>[_canRun(zipalignPath)];
if (requireApkSigner && _canRun(apksignerPath) != null)
return <String>[_canRun(apksignerPath) + '\napksigner requires Android SDK Build Tools 24.0.3 or newer.'];
return <String>[];
}
......
......@@ -90,7 +90,7 @@ Future<Null> buildApk(
if (androidSdk == null)
throwToolExit('No Android SDK found. Try setting the ANDROID_HOME environment variable.');
final List<String> validationResult = androidSdk.validateSdkWellFormed(requireApkSigner: false);
final List<String> validationResult = androidSdk.validateSdkWellFormed();
if (validationResult.isNotEmpty) {
validationResult.forEach(printError);
throwToolExit('Try re-installing or updating your Android SDK.');
......
......@@ -22,5 +22,5 @@ void main() {
'--replay-from=$replay',
],
);
});
}, skip: true /* TODO(#8947): Document how to update this test. */);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment