Skip to content

Commit

Permalink
Merge pull request #200 from bamlab/fastlane-setup/update-ios-build
Browse files Browse the repository at this point in the history
fix(fastlane-setup): update fastfile ios build
  • Loading branch information
Almouro authored Oct 15, 2018
2 parents 5bd8b0c + 37207b2 commit 396b966
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions generators/fastlane-setup/templates/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ end

platform :ios do
error do |lane, exception, options|
path = "#{ENV['IOS_PROJECT_PATH']}/#{ENV['IOS_PLIST_PATH']}"
if File.exist?("../#{path}.back")
restore_file(path: path)
plist_path = "#{ENV['IOS_PROJECT_PATH']}/#{ENV['IOS_PLIST_PATH']}"
if File.exist?("../#{plist_path}.back")
restore_file(path: plist_path)
end
pbxproj_path="#{ENV['IOS_PROJECT_PATH']}/#{ENV['IOS_PROJECT_NAME']}.xcodeproj/project.pbxproj"
if File.exist?("../#{pbxproj_path}.back")
restore_file(path: pbxproj_path)
end
end

Expand Down Expand Up @@ -73,17 +77,23 @@ platform :ios do
backup_file(path: plist_full_path)
xcodeproj = "#{ENV['IOS_PROJECT_PATH']}/#{ENV['IOS_PROJECT_NAME']}.xcodeproj"
xcworkspace = "#{ENV['IOS_PROJECT_PATH']}/#{ENV['IOS_PROJECT_NAME']}.xcworkspace"
pbxproj_full_path="#{xcodeproj}/project.pbxproj"
backup_file(path: pbxproj_full_path)
update_info_plist(
xcodeproj: xcodeproj,
plist_path: ENV['IOS_PLIST_PATH'],
block: lambda { |plist|
plist['CFBundleIdentifier'] = ENV['IOS_APP_ID']
plist['CFBundleName'] = ENV['IOS_APP_NAME']
plist['CFBundleDisplayName'] = ENV['IOS_APP_NAME']
plist['CFBundleShortVersionString'] = ENV['IOS_VERSION']
plist['CFBundleVersion'] = ENV['IOS_VERSION_BUILD_NUMBER']
},
)
update_app_identifier(
xcodeproj: xcodeproj,
plist_path: ENV['IOS_PLIST_PATH'],
app_identifier: ENV['IOS_APP_ID']
)
profile_env_name = "sigh_#{ENV['IOS_APP_ID']}_#{ENV['MATCH_TYPE']}_profile-name"
gymOptions = ({
silent: true,
Expand All @@ -95,6 +105,7 @@ platform :ios do
)
gym(gymOptions)
restore_file(path: plist_full_path)
restore_file(path: pbxproj_full_path)
end

lane :deploy_hockey do |options|
Expand Down

0 comments on commit 396b966

Please sign in to comment.