From 0633d7c3718b551e75c0fa143d95fe9fe258a754 Mon Sep 17 00:00:00 2001 From: Vitaliy Salnikov Date: Mon, 18 May 2020 14:44:56 +0300 Subject: [PATCH 1/6] Add lane for generating icon shields --- xcode/commonFastfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 1307e51..00aa771 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -85,6 +85,20 @@ private_lane :uploadToAppStore do |options| ) end +private_lane :add_shield do |options| + buildNumber = options[:buildNumber] + buildDescription = options[:xcconfig_name].scan(/\p{Upper}/)[1..2].join + + begin + add_badge( + shield: "#{buildDescription}-#{buildNumber}-green", + no_badge: true + ) + rescue => err + UI.error(err) + end +end + private_lane :buildConfiguration do |options| appName = options[:appName] || $appName @@ -129,6 +143,7 @@ private_lane :buildConfiguration do |options| if options[:uploadToFabric] syncCodeSigning(options) + add_shield(options) buildArchive(options) uploadToFirebase(options) From 5ede10f8d6c33f393ca43f4dd716532f79c617a0 Mon Sep 17 00:00:00 2001 From: Vitaliy Salnikov Date: Mon, 18 May 2020 14:45:22 +0300 Subject: [PATCH 2/6] Add Brewfile bundle to commonFastlane --- xcode/commonFastfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 00aa771..3877d4d 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -10,6 +10,10 @@ private_lane :installDependencies do |options| if File.exists? lockFilePath sh("rm -rf #{podsReposPath}") end + + if File.exists? "../Brewfile" + sh("brew bundle --file ../Brewfile") + end if File.exists? "../Gemfile" bundle_install(path: "../.gem") From e2399629c3f784e3c65162708db5926a1b0ac0a4 Mon Sep 17 00:00:00 2001 From: Vitaliy Salnikov Date: Mon, 18 May 2020 14:49:59 +0300 Subject: [PATCH 3/6] Fail build on badge generation fail --- xcode/commonFastfile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 3877d4d..707bbf6 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -93,14 +93,10 @@ private_lane :add_shield do |options| buildNumber = options[:buildNumber] buildDescription = options[:xcconfig_name].scan(/\p{Upper}/)[1..2].join - begin - add_badge( - shield: "#{buildDescription}-#{buildNumber}-green", - no_badge: true - ) - rescue => err - UI.error(err) - end + add_badge( + shield: "#{buildDescription}-#{buildNumber}-green", + no_badge: true + ) end private_lane :buildConfiguration do |options| From e52308fc6c4c10cda7bfc442f194512c940166a1 Mon Sep 17 00:00:00 2001 From: Vitaliy Salnikov Date: Mon, 18 May 2020 18:59:33 +0300 Subject: [PATCH 4/6] Change Homebrew dependency handling --- xcode/commonFastfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 707bbf6..f20e5b0 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -11,8 +11,11 @@ private_lane :installDependencies do |options| sh("rm -rf #{podsReposPath}") end - if File.exists? "../Brewfile" - sh("brew bundle --file ../Brewfile") + brew_dependencies = "imagemagick" + sh "brew ls --versions #{brew_dependencies}" do |status, output, command| + unless status.success? + sh("brew install #{brew_dependencies}") + end end if File.exists? "../Gemfile" From 33851d484aed9f519c884a9ce3b0d0d195efade6 Mon Sep 17 00:00:00 2001 From: Vitaliy Salnikov Date: Thu, 21 May 2020 11:45:08 +0300 Subject: [PATCH 5/6] Remove Homebrew dependency fetching --- xcode/commonFastfile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index f20e5b0..ae4bac6 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -10,13 +10,6 @@ private_lane :installDependencies do |options| if File.exists? lockFilePath sh("rm -rf #{podsReposPath}") end - - brew_dependencies = "imagemagick" - sh "brew ls --versions #{brew_dependencies}" do |status, output, command| - unless status.success? - sh("brew install #{brew_dependencies}") - end - end if File.exists? "../Gemfile" bundle_install(path: "../.gem") @@ -92,7 +85,7 @@ private_lane :uploadToAppStore do |options| ) end -private_lane :add_shield do |options| +private_lane :addShield do |options| buildNumber = options[:buildNumber] buildDescription = options[:xcconfig_name].scan(/\p{Upper}/)[1..2].join @@ -146,7 +139,7 @@ private_lane :buildConfiguration do |options| if options[:uploadToFabric] syncCodeSigning(options) - add_shield(options) + addShield(options) buildArchive(options) uploadToFirebase(options) From d1faa6cdfe8946cb496716abf636d4e20c620f10 Mon Sep 17 00:00:00 2001 From: Vitaliy Salnikov Date: Thu, 21 May 2020 12:41:41 +0300 Subject: [PATCH 6/6] Continue build on badge generation fail --- xcode/commonFastfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index ae4bac6..382a448 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -89,10 +89,14 @@ private_lane :addShield do |options| buildNumber = options[:buildNumber] buildDescription = options[:xcconfig_name].scan(/\p{Upper}/)[1..2].join - add_badge( - shield: "#{buildDescription}-#{buildNumber}-green", - no_badge: true - ) + begin + add_badge( + shield: "#{buildDescription}-#{buildNumber}-green", + no_badge: true + ) + rescue => error + UI.error(error) + end end private_lane :buildConfiguration do |options|