Make --build-shared-library more robust. (#17420)

* Search for a suitable ARM sysroot instead of hardcoding it;
* Add facility to explain why NDK was not found;
This commit is contained in:
Vyacheslav Egorov
2018-05-14 16:36:54 +02:00
committed by GitHub
parent f9bb4289e9
commit 4931b46772
6 changed files with 144 additions and 71 deletions

View File

@@ -132,9 +132,11 @@ void main() {
final AndroidSdk sdk = AndroidSdk.locateAndroidSdk();
expect(sdk.directory, realSdkDir);
expect(sdk.ndkDirectory, realNdkDir);
expect(sdk.ndkCompiler, realNdkCompiler);
expect(sdk.ndkCompilerArgs, <String>['--sysroot', realNdkSysroot]);
print(AndroidNdk.explainMissingNdk(sdk.directory));
expect(sdk.ndk, isNotNull);
expect(sdk.ndk.directory, realNdkDir);
expect(sdk.ndk.compiler, realNdkCompiler);
expect(sdk.ndk.compilerArgs, <String>['--sysroot', realNdkSysroot]);
}, overrides: <Type, Generator>{
FileSystem: () => fs,
Platform: () => new FakePlatform(operatingSystem: os),
@@ -149,9 +151,9 @@ void main() {
final String realSdkDir = sdkDir.path;
final AndroidSdk sdk = AndroidSdk.locateAndroidSdk();
expect(sdk.directory, realSdkDir);
expect(sdk.ndkDirectory, null);
expect(sdk.ndkCompiler, null);
expect(sdk.ndkCompilerArgs, null);
expect(sdk.ndk, isNull);
final String explanation = AndroidNdk.explainMissingNdk(sdk.directory);
expect(explanation, contains('Can not locate ndk-bundle'));
}, overrides: <Type, Generator>{
FileSystem: () => fs,
Platform: () => new FakePlatform(operatingSystem: os),