Unverified Commit 523ac7b6 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tool] Always re-copy Framework/podspec when regenerating iOS module project (#45877)

parent 250cd92d
......@@ -775,8 +775,7 @@ Future<void> _runHostOnlyDeviceLabTests() async {
() => _runDevicelabTest('module_test', environment: gradleEnvironment, testEmbeddingV2: true),
() => _runDevicelabTest('plugin_dependencies_test', environment: gradleEnvironment),
// TODO(jmagman): Re-enable once flakiness is resolved, https://github.com/flutter/flutter/issues/37525
// if (Platform.isMacOS) () => _runDevicelabTest('module_test_ios'),
if (Platform.isMacOS) () => _runDevicelabTest('module_test_ios'),
if (Platform.isMacOS) () => _runDevicelabTest('build_ios_framework_module_test'),
if (Platform.isMacOS) () => _runDevicelabTest('plugin_lint_mac'),
() => _runDevicelabTest('plugin_test', environment: gradleEnvironment),
......
......@@ -9,6 +9,7 @@ import 'package:xml/xml.dart' as xml;
import 'package:yaml/yaml.dart';
import 'android/gradle_utils.dart' as gradle;
import 'artifacts.dart';
import 'base/common.dart';
import 'base/context.dart';
import 'base/file_system.dart';
......@@ -456,6 +457,11 @@ class IosProject implements XcodeBasedProject {
if (!pubspecChanged && !toolingChanged) {
return;
}
final Directory engineDest = ephemeralDirectory
.childDirectory('Flutter')
.childDirectory('engine');
_deleteIfExistsSync(ephemeralDirectory);
_overwriteFromTemplate(fs.path.join('module', 'ios', 'library'), ephemeralDirectory);
// Add ephemeral host app, if a editable host app does not already exist.
......@@ -464,6 +470,17 @@ class IosProject implements XcodeBasedProject {
if (hasPlugins(parent)) {
_overwriteFromTemplate(fs.path.join('module', 'ios', 'host_app_ephemeral_cocoapods'), ephemeralDirectory);
}
// Copy podspec and framework from engine cache. The actual build mode
// doesn't actually matter as it will be overwritten by xcode_backend.sh.
// However, cocoapods will run before that script and requires something
// to be in this location.
final Directory framework = fs.directory(artifacts.getArtifactPath(Artifact.flutterFramework,
platform: TargetPlatform.ios, mode: BuildMode.debug));
if (framework.existsSync()) {
final File podspec = framework.parent.childFile('Flutter.podspec');
copyDirectorySync(framework, engineDest.childDirectory('Flutter.framework'));
podspec.copySync(engineDest.childFile('Flutter.podspec').path);
}
}
}
......
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