BuildScripts/xcode/commonFastfile

77 lines
2.0 KiB
Plaintext

$appName = File.basename(Dir['../*.xcworkspace'].first, '.*')
private_lane :beforeBuild do |options|
appName = options[:appName] || $appName
podsReposPath = File.expand_path "~/.cocoapods/repos/master/"
lockFilePath = "#{podsReposPath}/.git/index.lock"
# check if .lock file exists in pod repos - then remove all master repo
if File.exists? lockFilePath
sh("rm -rf #{podsReposPath}")
end
carthage(platform: "iOS")
cocoapods(
clean: true,
repo_update: true
)
set_info_plist_value(
path: "./#{appName}/Info.plist",
key: "CFBundleVersion",
value: options[:buildNumber] || 10000
)
end
private_lane :afterBuild do |options|
appName = options[:appName] || $appName
podsReposPath = File.expand_path "~/.cocoapods/repos/master/"
lockFilePath = "#{podsReposPath}/.git/index.lock"
# check if .lock file exists in pod repos - then remove all master repo
if File.exists? lockFilePath
sh("rm -rf #{podsReposPath}")
end
carthage(platform: "iOS")
cocoapods(
clean: true,
repo_update: true
)
set_info_plist_value(
path: "./#{appName}/Info.plist",
key: "CFBundleVersion",
value: options[:buildNumber] || 10000
)
end
private_lane :buildConfiguration do |options|
beforeBuild(options)
configuration = lane_context[SharedValues::LANE_NAME]
method = configuration.start_with?("Enterprise") ? "enterprise" : "development"
appName = options[:appName] || $appName
uploadToFabric = options[:uploadToFabric]
icloudEnvironment = options[:iCloudContainerEnvironment] || ""
exportOptions = icloudEnvironment.to_s.empty? ? {} : {iCloudContainerEnvironment: icloudEnvironment}
exportOptions[:compileBitcode] = options[:compileBitcode] || false
gym(
clean: true,
workspace: "./#{appName}.xcworkspace",
scheme: appName,
archive_path: "./",
output_directory: "./",
output_name: "#{appName}.ipa",
configuration: configuration,
export_method: method,
export_options: exportOptions,
skip_package_ipa: !uploadToFabric
)
afterBuild(options)
end