From 3383f507b3e41c55f834f3d03baaf54d5cb04ba5 Mon Sep 17 00:00:00 2001 From: Alexey Gerasimov Date: Wed, 27 Sep 2017 20:00:15 +0300 Subject: [PATCH] Private lane added --- xcode/commonFastfile | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/xcode/commonFastfile b/xcode/commonFastfile index 622ddce..497a0ef 100644 --- a/xcode/commonFastfile +++ b/xcode/commonFastfile @@ -1,10 +1,11 @@ $appName = File.basename(Dir['../*.xcworkspace'].first, '.*') -before_each do |lane, options| +before_all do |lane, options| cocoapods( clean: true, repo_update: true ) + set_info_plist_value( path: "./#{$appName}/Info.plist", key: "CFBundleVersion", @@ -12,12 +13,13 @@ before_each do |lane, options| ) end -after_each do |lane, options| +after_all do |lane, options| if options[:uploadToFabric] token = sh("cat ../#{$appName}.xcodeproj/project.pbxproj | grep 'Fabric/run' | awk '{print $4}' | tr -d '\n'") secret = sh("cat ../#{$appName}.xcodeproj/project.pbxproj | grep 'Fabric/run' | awk '{print $5}' | sed 's/..$//' | tr -d '\n'") releaseNotesFile = "release-notes.txt" sh("touch ../#{releaseNotesFile}") + crashlytics( ipa_path: "./#{$appName}.ipa", crashlytics_path: "./Pods/Crashlytics/", @@ -28,3 +30,22 @@ after_each do |lane, options| ) end end + +private_lane :buildConfiguration do |options| + configuration = lane_context[SharedValues::LANE_NAME] + method = configuration.start_with?("Enterprise") ? "enterprise" : "development" + uploadToFabric = options[:uploadToFabric] + additionalArgs = uploadToFabric ? "" : "analyze" + + gym( + clean: true, + scheme: $appName, + archive_path: "./", + output_directory: "./", + output_name: "#{$appName}.ipa", + configuration: configuration, + export_method: method, + skip_package_ipa: !uploadToFabric, + xcargs: additionalArgs + ) +end