From 16eeea5b550685c42eba93b10862247ce8e6d189 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Fri, 17 Jan 2020 11:19:48 +0300 Subject: [PATCH 1/4] add Rome support --- xcode/commonFastfile | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index edea840..396b8f8 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -13,19 +13,39 @@ private_lane :installDependencies do |options| bundle_install(path: "../.gem") end - if File.exists? "../Cartfile" - begin - carthage(command: "bootstrap", platform: "iOS") - rescue - # workaround for https://github.com/Carthage/Carthage/issues/2298 - sh("rm -rf ~/Library/Caches/org.carthage.CarthageKit") - carthage(command: "update", platform: "iOS", cache_builds: true) - end - end - cocoapods( repo_update: true ) + + if File.exists? "../Cartfile" + use_rome = File.exists? "../Romefile" + + swift_version = sh("xcrun swift --version | head -1 | sed 's/.*\\(\(.*\)\\).*/\\1/' | tr -d \"()\" | tr \" \" \"-\"").chop + rome_path = "Pods/Rome/rome" + rome_options = "--platform iOS --cache-prefix #{swift_version} --romefile ../Romefile" + + carthage_install = lambda do + if use_rome + sh("#{rome_path} download #{rome_options}") + end + + carthage(command: "bootstrap", platform: "iOS", cache_builds: true) + + if use_rome + sh("#{rome_path} list --missing #{rome_options} | awk '{print $1}' | xargs #{rome_path} upload #{rome_options}") + end + end + + carthage_install.call + + # begin + + # rescue + # # workaround for https://github.com/Carthage/Carthage/issues/2298 + # sh("rm -rf ~/Library/Caches/org.carthage.CarthageKit") + # carthage_install() + # end + end end private_lane :uploadToFabric do |options| From 1a1381dd19c2120c5ed51cee5ff798e2e6d54c40 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Fri, 17 Jan 2020 11:47:53 +0300 Subject: [PATCH 2/4] =?UTF-8?q?change=20Rom=D1=83=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xcode/commonFastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 396b8f8..58708c4 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -21,7 +21,7 @@ private_lane :installDependencies do |options| use_rome = File.exists? "../Romefile" swift_version = sh("xcrun swift --version | head -1 | sed 's/.*\\(\(.*\)\\).*/\\1/' | tr -d \"()\" | tr \" \" \"-\"").chop - rome_path = "Pods/Rome/rome" + rome_path = "../Pods/Rome/rome" rome_options = "--platform iOS --cache-prefix #{swift_version} --romefile ../Romefile" carthage_install = lambda do From b2a07d79c3aaf4a46709adc621edd1288c3ed265 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Wed, 22 Jan 2020 18:17:11 +0300 Subject: [PATCH 3/4] run rome from project folder --- xcode/commonFastfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 58708c4..892396b 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -21,18 +21,18 @@ private_lane :installDependencies do |options| use_rome = File.exists? "../Romefile" swift_version = sh("xcrun swift --version | head -1 | sed 's/.*\\(\(.*\)\\).*/\\1/' | tr -d \"()\" | tr \" \" \"-\"").chop - rome_path = "../Pods/Rome/rome" - rome_options = "--platform iOS --cache-prefix #{swift_version} --romefile ../Romefile" + rome_path = "Pods/Rome/rome" + rome_options = "--platform iOS --cache-prefix #{swift_version} --romefile Romefile" carthage_install = lambda do if use_rome - sh("#{rome_path} download #{rome_options}") + sh("cd .. && #{rome_path} download #{rome_options}") end carthage(command: "bootstrap", platform: "iOS", cache_builds: true) if use_rome - sh("#{rome_path} list --missing #{rome_options} | awk '{print $1}' | xargs #{rome_path} upload #{rome_options}") + sh("cd .. && #{rome_path} list --missing #{rome_options} | awk '{print $1}' | xargs -I framework_name #{rome_path} upload framework_name #{rome_options}") end end From d9d0a6034f20c4997234296b1f3e489af2abd5f8 Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Thu, 23 Jan 2020 12:55:44 +0300 Subject: [PATCH 4/4] fix carthage retry --- xcode/commonFastfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 892396b..0258809 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -36,15 +36,13 @@ private_lane :installDependencies do |options| end end - carthage_install.call - - # begin - - # rescue - # # workaround for https://github.com/Carthage/Carthage/issues/2298 - # sh("rm -rf ~/Library/Caches/org.carthage.CarthageKit") - # carthage_install() - # end + begin + carthage_install.call + rescue + # workaround for https://github.com/Carthage/Carthage/issues/2298 + sh("rm -rf ~/Library/Caches/org.carthage.CarthageKit") + carthage_install.call + end end end