# Customise this file, documentation can be found here:
# https://github.com/fastlane/fastlane/tree/master/fastlane/docs
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.101.0"
default_platform :android
platform :android do
before_all do
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
end
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end
desc "Build the apk"
lane :build do
gradle(task: "clean assemble")
end
desc "Tag as a new version"
lane :tag do
increment_version_code(
#code_num: 9,
var_name: "versionCode|versionBuild",
#var_name: "AI_VERSION_CODE",
#file: "app/version.properties",
verbose: true,
)
commit_android_version_bump(
message: "Increment version for new tag"
)
end
desc "Build and deploy the apk for Alpha testing in Google Play store"
lane :deploy_alpha do
gradle(
task: "clean assemble",
build_type: 'Release',
# properties: {
# 'versionCode' => 7,
# 'versionName' => "0.0.1.7"
# }
)
supply(
apk: 'app/build/outputs/apk/app-release.apk',
track: 'alpha'
)
# Now tag the current released app
# tag_svn_url = sh("printf #{ENV['SVN_URL']} | sed 's@trunk@tags/build_#{version}-#{build_number}@' | tr -d '\n'")
# tag_svn_message = "Release build " + version + "-" + build_number
# sh("svn copy #{ENV['SVN_URL']} #{tag_svn_url} -m '#{tag_svn_message}'")
# Revert the local changes (badge changes should NOT be committed)
# sh("cd .. && svn revert -R .")
# Increase the build number to be committed.
end
desc "Submit a new Beta Build to Crashlytics Beta"
lane :beta do
gradle(task: "assembleRelease")
crashlytics
# sh "your_script.sh"
# You can also use other beta testing services here
end
desc "Deploy a new version to the Google Play"
lane :deploy do
gradle(task: "assembleRelease")
supply
end
# You can define as many lanes as you want
after_all do |lane|
# This block is called, only if the executed lane was successful
# slack(
# message: "Successfully deployed new App Update."
# )
end
error do |lane, exception|
# slack(
# message: exception.message,
# success: false
# )
end
end
# More information about multiple platforms in fastlane: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Platforms.md
# All available actions: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Actions.md
# fastlane reports which actions are used
# No personal data is sent or shared. Learn more at https://github.com/fastlane/enhancer