Unverified Commit 7711c1ef authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Suggest precache instead of build when engine artifacts are missing (#75351)

parent d01d5732
...@@ -43,7 +43,7 @@ def flutter_additional_ios_build_settings(target) ...@@ -43,7 +43,7 @@ def flutter_additional_ios_build_settings(target)
unless Dir.exist?(debug_framework_dir) unless Dir.exist?(debug_framework_dir)
# iOS artifacts have not been downloaded. # iOS artifacts have not been downloaded.
raise "#{debug_framework_dir} must exist. If you're running pod install manually, make sure flutter build ios is executed first" raise "#{debug_framework_dir} must exist. If you're running pod install manually, make sure \"flutter precache --ios\" is executed first"
end end
release_framework_dir = File.expand_path(File.join(artifacts_dir, 'ios-release', 'Flutter.xcframework'), __FILE__) release_framework_dir = File.expand_path(File.join(artifacts_dir, 'ios-release', 'Flutter.xcframework'), __FILE__)
...@@ -90,6 +90,11 @@ def flutter_additional_macos_build_settings(target) ...@@ -90,6 +90,11 @@ def flutter_additional_macos_build_settings(target)
debug_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64'), __FILE__) debug_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64'), __FILE__)
release_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64-release'), __FILE__) release_framework_dir = File.expand_path(File.join(artifacts_dir, 'darwin-x64-release'), __FILE__)
unless Dir.exist?(debug_framework_dir)
# macOS artifacts have not been downloaded.
raise "#{debug_framework_dir} must exist. If you're running pod install manually, make sure \"flutter precache --macos\" is executed first"
end
target.build_configurations.each do |build_configuration| target.build_configurations.each do |build_configuration|
# Profile can't be derived from the CocoaPods build configuration. Use release framework (for linking only). # Profile can't be derived from the CocoaPods build configuration. Use release framework (for linking only).
configuration_engine_dir = build_configuration.type == :debug ? debug_framework_dir : release_framework_dir configuration_engine_dir = build_configuration.type == :debug ? debug_framework_dir : release_framework_dir
......
...@@ -549,7 +549,7 @@ String _getIosEngineArtifactPath(String engineDirectory, ...@@ -549,7 +549,7 @@ String _getIosEngineArtifactPath(String engineDirectory,
.childDirectory(_artifactToFileName(Artifact.flutterXcframework)); .childDirectory(_artifactToFileName(Artifact.flutterXcframework));
if (!xcframeworkDirectory.existsSync()) { if (!xcframeworkDirectory.existsSync()) {
throwToolExit('No xcframework found at ${xcframeworkDirectory.path}. Try running "flutter build ios".'); throwToolExit('No xcframework found at ${xcframeworkDirectory.path}. Try running "flutter precache --ios".');
} }
Directory flutterFrameworkSource; Directory flutterFrameworkSource;
for (final Directory platformDirectory for (final Directory platformDirectory
......
...@@ -38,7 +38,7 @@ def install_flutter_engine_pod ...@@ -38,7 +38,7 @@ def install_flutter_engine_pod
release_framework_dir = File.join(flutter_root, 'bin', 'cache', 'artifacts', 'engine', 'ios-release') release_framework_dir = File.join(flutter_root, 'bin', 'cache', 'artifacts', 'engine', 'ios-release')
unless Dir.exist?(release_framework_dir) unless Dir.exist?(release_framework_dir)
# iOS artifacts have not been downloaded. # iOS artifacts have not been downloaded.
raise "#{release_framework_dir} must exist. Make sure \"flutter build ios\" has been run at least once" raise "#{release_framework_dir} must exist. Make sure \"flutter precache --ios\" has been run at least once"
end end
FileUtils.cp_r(File.join(release_framework_dir, framework_name), engine_dir) FileUtils.cp_r(File.join(release_framework_dir, framework_name), engine_dir)
end end
......
...@@ -70,7 +70,7 @@ void main() { ...@@ -70,7 +70,7 @@ void main() {
), ),
throwsToolExit( throwsToolExit(
message: message:
'No xcframework found at $xcframeworkPath. Try running "flutter build ios".'), 'No xcframework found at $xcframeworkPath.'),
); );
fileSystem.directory(xcframeworkPath).createSync(recursive: true); fileSystem.directory(xcframeworkPath).createSync(recursive: true);
expect( expect(
...@@ -215,7 +215,7 @@ void main() { ...@@ -215,7 +215,7 @@ void main() {
), ),
throwsToolExit( throwsToolExit(
message: message:
'No xcframework found at /out/android_debug_unopt/Flutter.xcframework. Try running "flutter build ios".'), 'No xcframework found at /out/android_debug_unopt/Flutter.xcframework'),
); );
fileSystem.directory(xcframeworkPath).createSync(recursive: true); fileSystem.directory(xcframeworkPath).createSync(recursive: true);
expect( expect(
......
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