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|