From 4d5db88998f1e2d9b8927b44f2e826a8181fa6b8 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Mon, 11 Jan 2021 10:29:26 -0800 Subject: [PATCH] Default add-to-app xcode_backend script to be verbose (#73110) --- dev/devicelab/bin/tasks/module_test_ios.dart | 10 ++++++---- .../module/ios/library/Flutter.tmpl/podhelper.rb.tmpl | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dev/devicelab/bin/tasks/module_test_ios.dart b/dev/devicelab/bin/tasks/module_test_ios.dart index f16de2a1d2..10ec562e46 100644 --- a/dev/devicelab/bin/tasks/module_test_ios.dart +++ b/dev/devicelab/bin/tasks/module_test_ios.dart @@ -305,8 +305,8 @@ Future main() async { ); section('Fail building existing Objective-C iOS app if flutter script fails'); - final int xcodebuildExitCode = await inDirectory(objectiveCHostApp, () => - exec( + final String xcodebuildOutput = await inDirectory(objectiveCHostApp, () => + eval( 'xcodebuild', [ '-workspace', @@ -315,7 +315,7 @@ Future main() async { 'Host', '-configuration', 'Debug', - 'ARCHS=i386', // i386 is not supported in Debug mode. + 'FLUTTER_ENGINE=bogus', // Force a Flutter error. 'CODE_SIGNING_ALLOWED=NO', 'CODE_SIGNING_REQUIRED=NO', 'CODE_SIGN_IDENTITY=-', @@ -327,7 +327,9 @@ Future main() async { ) ); - if (xcodebuildExitCode != 65) { // 65 returned on PhaseScriptExecution failure. + if (!xcodebuildOutput.contains('flutter --verbose --local-engine-src-path=bogus assemble') || // Verbose output + !xcodebuildOutput.contains('Unable to detect a Flutter engine build directory in bogus') || + !xcodebuildOutput.contains('Command PhaseScriptExecution failed with a nonzero exit code')) { return TaskResult.failure('Host Objective-C app build succeeded though flutter script failed'); } diff --git a/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl b/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl index fd1ecb6e31..03ee057a96 100644 --- a/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl +++ b/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl @@ -117,7 +117,7 @@ def install_flutter_application_pod(flutter_application_path) flutter_export_environment_path = File.join('${SRCROOT}', relative, 'flutter_export_environment.sh'); script_phase :name => 'Run Flutter Build {{projectName}} Script', - :script => "set -e\nset -u\nsource \"#{flutter_export_environment_path}\"\n\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build", + :script => "set -e\nset -u\nsource \"#{flutter_export_environment_path}\"\nexport VERBOSE_SCRIPT_LOGGING=1 && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build", :execution_position => :before_compile end