Skip to content

Commit

Permalink
Updated the Fastfile's after_all to give the option to allow keeping …
Browse files Browse the repository at this point in the history
…the archive. (#33)
  • Loading branch information
ibrahimQL authored Apr 8, 2020
1 parent 3a262b1 commit 47bae4c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ platform :ios do

before_all do
installKeychainsIfPossible
xcversion(version: ENV["XCODE_VERSION"] || '~> 10.2')
xcversion(version: ENV["XCODE_VERSION"] || '~> 11.4')
if !ENV["SKIP_COCOAPODS"]
cocoapods(silent: true, try_repo_update_on_error: true)
end
end

after_all do
cleanup
after_all do |lanes, options|
cleanup(options)
removeKeychainsIfPossible
end

desc "Runs all the tests."
lane :runTests do
scan(output_types: "junit",
device: ENV["DEVICE"] || 'iPhone XS (12.2)'
device: ENV["DEVICE"] || 'iPhone 11 Pro (13.4)'
)
end

Expand Down Expand Up @@ -173,8 +173,8 @@ platform :ios do
end

desc "Deletes the archive generated by gym."
lane :cleanupArchive do
if "#{lane_context[SharedValues::XCODEBUILD_ARCHIVE]}" != ""
lane :cleanupArchive do |options|
if ("#{lane_context[SharedValues::XCODEBUILD_ARCHIVE]}" != "") && !(options[:keepArchive] || false)
sh "rm -r \"#{File.dirname(lane_context[SharedValues::XCODEBUILD_ARCHIVE])}\" || :"
end
end
Expand All @@ -190,9 +190,9 @@ platform :ios do
end

desc "Cleanup simulator and build archives."
lane :cleanup do
lane :cleanup do |options|
cleanupSimulator
cleanupArchive
cleanupArchive(options)
end

end
Expand Down

0 comments on commit 47bae4c

Please sign in to comment.