From fc1c0ac74b452fd64dbbea7b582817e2c1fea78a Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Mar 2021 16:29:00 +0300 Subject: [PATCH 1/6] Add cpde generation phase --- xcode/commonFastfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 6319ae9..5a6ad82 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -108,6 +108,7 @@ private_lane :buildConfiguration do |options| installDependencies(options) + run_code_generation_phase_if_needed() generate_enabled_features_extension_if_needed(options) if !(options[:uploadToFabric] || options[:uploadToAppStore]) @@ -425,3 +426,14 @@ def set_xcconfig_for_configuration_of_project(lane_name, configuration, xcodepro project.save() end + +# Build phases + +def run_code_generation_phase_if_needed() + code_generation_script_path = File.expand_path "../.githooks/scripts/CodeGen.sh" + + if File.exists? code_generation_script_path + sh(code_generation_script_path) + end + +end From f5d3b7e4ea8f47bac1e14e2add1f563bd4df910a Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Mar 2021 16:49:22 +0300 Subject: [PATCH 2/6] Add xcodeproj_path to code generation --- xcode/commonFastfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 5a6ad82..950a2d8 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -429,11 +429,12 @@ end # Build phases -def run_code_generation_phase_if_needed() +def run_code_generation_phase_if_needed(options) code_generation_script_path = File.expand_path "../.githooks/scripts/CodeGen.sh" + xcodeproj_path = File.expand_path options[:xcodeproj_path] if File.exists? code_generation_script_path - sh(code_generation_script_path) + sh("code_generation_script_path ${xcodeproj_path}") end end From 43485eb8f5076f94a56ec52f44fac7ea0cb3c563 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Mar 2021 16:56:39 +0300 Subject: [PATCH 3/6] Correct params input to sh --- xcode/commonFastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 950a2d8..92a3102 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -434,7 +434,7 @@ def run_code_generation_phase_if_needed(options) xcodeproj_path = File.expand_path options[:xcodeproj_path] if File.exists? code_generation_script_path - sh("code_generation_script_path ${xcodeproj_path}") + sh("#{code_generation_script_path} #{xcodeproj_path}") end end From ddf7e0228b06c2d76d309b37541a2738c60c82f3 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Mar 2021 17:07:09 +0300 Subject: [PATCH 4/6] Correct code generation input --- xcode/commonFastfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 92a3102..f4d4e61 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -89,12 +89,12 @@ private_lane :buildConfiguration do |options| configuration_type = Touchlane::ConfigurationType.from_lane_name(lane_name) options = fill_up_options_using_configuration_type(options, configuration_type) - openKeychain(options) + #openKeychain(options) if !options[:buildNumber].nil? - increment_build_number( - build_number: options[:buildNumber] - ) + #increment_build_number( + # build_number: options[:buildNumber] + #) end ipa_name = "#{appName}.ipa" @@ -106,9 +106,9 @@ private_lane :buildConfiguration do |options| options[:xcodeproj_path] = "../#{appName}.xcodeproj" options[:workspace] = "./#{appName}.xcworkspace" - installDependencies(options) + #installDependencies(options) - run_code_generation_phase_if_needed() + run_code_generation_phase_if_needed(options) generate_enabled_features_extension_if_needed(options) if !(options[:uploadToFabric] || options[:uploadToAppStore]) @@ -433,8 +433,9 @@ def run_code_generation_phase_if_needed(options) code_generation_script_path = File.expand_path "../.githooks/scripts/CodeGen.sh" xcodeproj_path = File.expand_path options[:xcodeproj_path] + if File.exists? code_generation_script_path - sh("#{code_generation_script_path} #{xcodeproj_path}") + sh(code_generation_script_path, xcodeproj_path) end end From 8529a6f41f4a44928eb24a8bc0ed7c04abf7a125 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Mar 2021 17:37:51 +0300 Subject: [PATCH 5/6] Remove comments --- xcode/commonFastfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index f4d4e61..f939208 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -89,12 +89,12 @@ private_lane :buildConfiguration do |options| configuration_type = Touchlane::ConfigurationType.from_lane_name(lane_name) options = fill_up_options_using_configuration_type(options, configuration_type) - #openKeychain(options) + openKeychain(options) if !options[:buildNumber].nil? - #increment_build_number( - # build_number: options[:buildNumber] - #) + increment_build_number( + build_number: options[:buildNumber] + ) end ipa_name = "#{appName}.ipa" @@ -106,7 +106,7 @@ private_lane :buildConfiguration do |options| options[:xcodeproj_path] = "../#{appName}.xcodeproj" options[:workspace] = "./#{appName}.xcworkspace" - #installDependencies(options) + installDependencies(options) run_code_generation_phase_if_needed(options) generate_enabled_features_extension_if_needed(options) From bfad757f236486b21aeb85ff23a822a3b30ffb83 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Mar 2021 17:54:53 +0300 Subject: [PATCH 6/6] Remove empty spaces --- xcode/commonFastfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index f939208..e7f4c13 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -433,9 +433,7 @@ def run_code_generation_phase_if_needed(options) code_generation_script_path = File.expand_path "../.githooks/scripts/CodeGen.sh" xcodeproj_path = File.expand_path options[:xcodeproj_path] - if File.exists? code_generation_script_path sh(code_generation_script_path, xcodeproj_path) end - end