From e512ec339d1bd2b51e0a4d53a2460a004a62b10d Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 4 Jun 2020 23:15:53 +0300 Subject: [PATCH 1/3] Update script --- xcode/config_generator/render_xcconfigs.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xcode/config_generator/render_xcconfigs.rb b/xcode/config_generator/render_xcconfigs.rb index dbe8d84..6278cbf 100644 --- a/xcode/config_generator/render_xcconfigs.rb +++ b/xcode/config_generator/render_xcconfigs.rb @@ -51,11 +51,26 @@ def generate_bundle_id(target_name, account_type) return config_option($bundle_id_key, bundle_id) end +def generate_google_service_info_plist_path(google_service_info_plist_key, target_name, account_type) + google_service_info_plist_path = target_name + "/Resources/" + + if account_type == "AppStore" + google_service_info_plist_path += "AppStore-GoogleService-Info.plist" + elsif account_type == "Enterprise" + google_service_info_plist_path += "Enterprise-GoogleService-Info.plist" + else + google_service_info_plist_path += "Standard-GoogleService-Info.plist" + end + + return config_option(google_service_info_plist_key, google_service_info_plist_path) +end + # generate missing properties if needed def generate_missing_properties(target_name, properties, account_type) result = [] development_team_key = "DEVELOPMENT_TEAM" provisioning_key = "PROVISIONING_PROFILE_SPECIFIER" + google_service_info_plist_key = "GOOGLE_SERVICE_INFO_PLIST_PATH" unless properties.key?($bundle_id_key) bundle_id_config = generate_bundle_id(target_name, account_type) @@ -72,6 +87,10 @@ def generate_missing_properties(target_name, properties, account_type) unless properties.key?(provisioning_key) result.append(generate_provisioning_profile(provisioning_key, bundle_id, account_type)) end + + unless properties.key?(google_service_info_plist_key) + result.append(generate_google_service_info_plist_path(google_service_info_plist_key, target_name, account_type)) + end return result end From 5c277597f7044ee9a6f6c56d8d4fe2fdc79f4ebe Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 4 Jun 2020 23:38:30 +0300 Subject: [PATCH 2/3] Update script --- xcode/config_generator/render_xcconfigs.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xcode/config_generator/render_xcconfigs.rb b/xcode/config_generator/render_xcconfigs.rb index 6278cbf..2838ebd 100644 --- a/xcode/config_generator/render_xcconfigs.rb +++ b/xcode/config_generator/render_xcconfigs.rb @@ -58,8 +58,10 @@ def generate_google_service_info_plist_path(google_service_info_plist_key, targe google_service_info_plist_path += "AppStore-GoogleService-Info.plist" elsif account_type == "Enterprise" google_service_info_plist_path += "Enterprise-GoogleService-Info.plist" - else + elsif account_type == "Standard" google_service_info_plist_path += "Standard-GoogleService-Info.plist" + else + google_service_info_plist_path = "" end return config_option(google_service_info_plist_key, google_service_info_plist_path) @@ -89,7 +91,11 @@ def generate_missing_properties(target_name, properties, account_type) end unless properties.key?(google_service_info_plist_key) - result.append(generate_google_service_info_plist_path(google_service_info_plist_key, target_name, account_type)) + google_service_info_plist = generate_google_service_info_plist_path(google_service_info_plist_key, target_name, account_type) + + if google_service_info_plist[google_service_info_plist_key] + result.append(google_service_info_plist) + end end return result From 4770ee7f78d3e29f86817f272fc50bf9a7d45084 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 4 Jun 2020 23:44:17 +0300 Subject: [PATCH 3/3] Revert "Update script" This reverts commit 5c277597f7044ee9a6f6c56d8d4fe2fdc79f4ebe. --- xcode/config_generator/render_xcconfigs.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xcode/config_generator/render_xcconfigs.rb b/xcode/config_generator/render_xcconfigs.rb index 2838ebd..6278cbf 100644 --- a/xcode/config_generator/render_xcconfigs.rb +++ b/xcode/config_generator/render_xcconfigs.rb @@ -58,10 +58,8 @@ def generate_google_service_info_plist_path(google_service_info_plist_key, targe google_service_info_plist_path += "AppStore-GoogleService-Info.plist" elsif account_type == "Enterprise" google_service_info_plist_path += "Enterprise-GoogleService-Info.plist" - elsif account_type == "Standard" - google_service_info_plist_path += "Standard-GoogleService-Info.plist" else - google_service_info_plist_path = "" + google_service_info_plist_path += "Standard-GoogleService-Info.plist" end return config_option(google_service_info_plist_key, google_service_info_plist_path) @@ -91,11 +89,7 @@ def generate_missing_properties(target_name, properties, account_type) end unless properties.key?(google_service_info_plist_key) - google_service_info_plist = generate_google_service_info_plist_path(google_service_info_plist_key, target_name, account_type) - - if google_service_info_plist[google_service_info_plist_key] - result.append(google_service_info_plist) - end + result.append(generate_google_service_info_plist_path(google_service_info_plist_key, target_name, account_type)) end return result