Unverified Commit 27293857 authored by Dan Field's avatar Dan Field Committed by GitHub

Make host app test actually test host app (#24131)

* Make host app test actually test host app

* mark updated test as flaky
parent 846a5eea
......@@ -14,7 +14,6 @@ import 'package:path/path.dart' as path;
/// adding Flutter to an existing iOS app.
Future<void> main() async {
await task(() async {
section('Create Flutter module project');
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_module_test.');
......@@ -23,7 +22,12 @@ Future<void> main() async {
await inDirectory(tempDir, () async {
await flutter(
'create',
options: <String>['--org', 'io.flutter.devicelab', '--template=module', 'hello'],
options: <String>[
'--org',
'io.flutter.devicelab',
'--template=module',
'hello'
],
);
});
await prepareProvisioningCertificates(projectDir.path);
......@@ -127,11 +131,51 @@ Future<void> main() async {
if (!editableHostAppBuilt) {
return TaskResult.failure('Failed to build editable host .app');
}
section('Add to existing iOS app');
final Directory hostApp = Directory(path.join(tempDir.path, 'hello_host_app'));
mkdir(hostApp);
recursiveCopy(
Directory(path.join(flutterDirectory.path, 'dev', 'integration_tests', 'ios_host_app')),
hostApp,
);
await inDirectory(hostApp, () async {
await exec('pod', <String>['install']);
await exec(
'xcodebuild',
<String>[
'-workspace',
'Host.xcworkspace',
'-scheme',
'Host',
'-configuration',
'Debug',
'CODE_SIGNING_ALLOWED=NO',
'CODE_SIGNING_REQUIRED=NO',
'CODE_SIGNING_IDENTITY=""',
'EXPANDED_CODE_SIGN_IDENTITY=""',
'CONFIGURATION_BUILD_DIR=${tempDir.path}',
],
);
});
final bool existingAppBuilt = exists(File(path.join(
tempDir.path,
'Host.app',
'Host',
)));
if (!existingAppBuilt) {
return TaskResult.failure('Failed to build existing app .app');
}
return TaskResult.success(null);
} catch (e) {
return TaskResult.failure(e.toString());
} finally {
//rmTree(tempDir);
rmTree(tempDir);
}
});
}
......@@ -326,6 +326,7 @@ tasks:
Checks that the module project template works and supports add2app on iOS.
stage: devicelab
required_agent_capabilities: ["mac/ios"]
flaky: true
external_ui_integration_test_ios:
description: >
......
......@@ -234,7 +234,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
shellScript = "\"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n\"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed\n";
};
EDACAC7378E52BD5BBDB34D5 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
......
# iOS host app
iOS host app for a Flutter module created using
```
$ flutter create -t module hello
```
and placed in a sibling folder to (a clone of) the host app.
Used by the `module_test_ios.dart` device lab test.
......@@ -367,9 +367,10 @@ EmbedFlutterFrameworks() {
# Sign the binaries we moved.
local identity="${EXPANDED_CODE_SIGN_IDENTITY_NAME:-$CODE_SIGN_IDENTITY}"
RunCommand codesign --force --verbose --sign "${identity}" -- "${xcode_frameworks_dir}/App.framework/App"
RunCommand codesign --force --verbose --sign "${identity}" -- "${xcode_frameworks_dir}/Flutter.framework/Flutter"
if (${identity} != ""); then
RunCommand codesign --force --verbose --sign "${identity}" -- "${xcode_frameworks_dir}/App.framework/App"
RunCommand codesign --force --verbose --sign "${identity}" -- "${xcode_frameworks_dir}/Flutter.framework/Flutter"
fi
}
# Main entry point.
......
......@@ -68,7 +68,7 @@ post_install do |installer|
config.build_settings['ENABLE_BITCODE'] = 'NO'
xcconfig_path = config.base_configuration_reference.real_path
File.open(xcconfig_path, 'a+') do |file|
file.puts "#include \"#{File.join(framework_dir, 'Generated.xcconfig')}\""
file.puts "#include \"#{File.realpath(File.join(framework_dir, 'Generated.xcconfig'))}\""
end
end
end
......
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