Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fastlane_version "1.109.0"
load './Context'
default_platform :android
platform :android do
before_all do
ENV['SLACK_URL'] = Slack.url
ENV['FL_SLACK_CHANNEL'] = Slack.channel
ENV['FL_SLACK_USERNAME'] = Slack.username
ENV["CRASHLYTICS_API_TOKEN"] = Fabric.api_token
ENV["CRASHLYTICS_BUILD_SECRET"] = Fabric.build_secret
end
desc "Runs all the tests"
lane :test do
gradle(task: "test")
end
lane :prd do |options|
options[:env] = 'prd'
beta(options)
end
lane :stg do |options|
options[:env] = 'stg'
beta(options)
end
lane :dev do |options|
options[:env] = 'dev'
beta(options)
end
private_lane :beta do |options|
archive(options)
crashlytics(groups: Fabric.tester_group)
end
private_lane :archive do |options|
env = options.fetch(:env, 'dev')
build_type = options.fetch(:type, 'Release')
begin
BuildContext.validate_env(env)
rescue => e
UI.user_error!(e.message)
Kernel.abort
end
context = BuildContext.new(env, build_type)
gradle(
task: context.task,
flavor: context.flavor,
build_type: context.build_type,
flags: "-PdisablePreDex"
)
copy_artifacts(
target_path: "artifacts",
artifacts: [context.apk_path]
)
end
after_all do |lane|
slack(
message: 'Application was build',
)
end
error do |lane, exception|
slack(
success: false,
message: exception.message
)
end
end
# vim: ft=ruby sw=2 ts=2 sts=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment