From 1bcaa150180480e3e9808102720e075536ce026e Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 31 Jul 2019 11:34:22 -0700 Subject: [PATCH] Make podhelper.rb a template to avoid passing in the module name (#37276) --- dev/integration_tests/ios_add2app/Podfile | 2 +- .../Flutter.tmpl/{podhelper.rb => podhelper.rb.tmpl} | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) rename packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/{podhelper.rb => podhelper.rb.tmpl} (90%) diff --git a/dev/integration_tests/ios_add2app/Podfile b/dev/integration_tests/ios_add2app/Podfile index 8885e60d47..11981e2fe2 100644 --- a/dev/integration_tests/ios_add2app/Podfile +++ b/dev/integration_tests/ios_add2app/Podfile @@ -5,7 +5,7 @@ flutter_application_path = 'flutterapp/' load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb') target 'ios_add2app' do - install_all_flutter_pods(flutter_application_path, 'ios_add2app_flutter') + install_all_flutter_pods(flutter_application_path) end target 'ios_add2appTests' do diff --git a/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb b/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl similarity index 90% rename from packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb rename to packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl index f833b856e6..40af77fbc4 100644 --- a/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb +++ b/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl @@ -8,13 +8,11 @@ # @param [String] flutter_application_path Path of the root directory of the Flutter module. # Optional, defaults to two levels up from the directory of this script. # MyApp/my_flutter/.ios/Flutter/../.. -# @param [String] flutter_application_name Name of the Flutter module. Optional, defaults to module directory name. -def install_all_flutter_pods(flutter_application_path = nil, flutter_application_name = nil) - flutter_application_name ||= File.basename(File.expand_path(flutter_application_path)) +def install_all_flutter_pods(flutter_application_path = nil) flutter_application_path ||= File.join('..', '..') install_flutter_engine_pod install_flutter_plugin_pods(flutter_application_path) - install_flutter_application_pod(flutter_application_path, flutter_application_name) + install_flutter_application_pod(flutter_application_path) end # Install Flutter engine pod. @@ -65,12 +63,12 @@ end # # @example # target 'MyApp' do -# install_flutter_application_pod '../flutter_settings_repository', 'settings_module' +# install_flutter_application_pod '../flutter_settings_repository' # end # @param [String] flutter_application_path Path of the root directory of the Flutter module. # Optional, defaults to two levels up from the directory of this script. # MyApp/my_flutter/.ios/Flutter/../.. -def install_flutter_application_pod(flutter_application_path, flutter_application_name) +def install_flutter_application_pod(flutter_application_path) app_framework_dir = File.join(__dir__, 'App.framework') app_framework_dylib = File.join(app_framework_dir, 'App') if !File.exist?(app_framework_dylib) @@ -81,7 +79,7 @@ def install_flutter_application_pod(flutter_application_path, flutter_applicatio `echo "static const int Moo = 88;" | xcrun clang -x c -dynamiclib -o "#{app_framework_dylib}" -` end - pod flutter_application_name, :path => __dir__, :inhibit_warnings => true + pod '{{projectName}}', :path => __dir__, :inhibit_warnings => true # Use relative paths for script phase paths since these strings will likely be checked into source controls. # Process will be run from project directory.