Unverified Commit 33794351 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

iOS aot assembly requires SDK root (#71094)

parent 39155dcb
......@@ -47,6 +47,10 @@ abstract class AotAssemblyBase extends Target {
if (environment.defines[kTargetPlatform] == null) {
throw MissingDefineException(kTargetPlatform, 'aot_assembly');
}
if (environment.defines[kSdkRoot] == null) {
throw MissingDefineException(kSdkRoot, 'aot_assembly');
}
final List<String> extraGenSnapshotOptions = decodeDartDefines(environment.defines, kExtraGenSnapshotOptions);
final bool bitcode = environment.defines[kBitcodeFlag] == 'true';
final BuildMode buildMode = getBuildModeForName(environment.defines[kBuildMode]);
......
......@@ -187,6 +187,7 @@ void main() {
fileSystem.currentDirectory,
defines: <String, String>{
kTargetPlatform: 'ios',
kSdkRoot: 'path/to/sdk',
},
processManager: processManager,
artifacts: artifacts,
......@@ -209,6 +210,34 @@ void main() {
Platform: () => macPlatform,
});
testUsingContext('AotAssemblyRelease throws exception if sdk root is missing', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final Environment environment = Environment.test(
fileSystem.currentDirectory,
defines: <String, String>{
kTargetPlatform: 'ios',
},
processManager: processManager,
artifacts: artifacts,
logger: logger,
fileSystem: fileSystem,
);
environment.defines[kBuildMode] = 'release';
environment.defines[kIosArchs] = 'x86_64';
expect(const AotAssemblyRelease().build(environment), throwsA(isA<Exception>()
.having(
(Exception exception) => exception.toString(),
'description',
contains('required define SdkRoot but it was not provided'),
)
));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
Platform: () => macPlatform,
});
testWithoutContext('Unpack copies Flutter.framework', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final Directory outputDir = fileSystem.directory('output');
......
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