Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module Fabric
def self.api_token
"Fabric_TOKEN"
end
def self.build_secret
"Fabric_SECRET"
end
def self.tester_group
['tester']
end
end
module Slack
def self.url
'HOOK_URL'
end
def self.channel
'#noti_channel'
end
def self.username
'fastlane-android'
end
end
class BuildContext
@@flavor_hash = {
'prd' => 'production',
'stg' => 'staging',
'dev' => 'development'
}
def self.validate_env(env)
unless @@flavor_hash.has_key?(env)
raise [
"Invalid environment: #{env}\n",
"Valid environment is one of them: #{envs}",
].join("\n")
end
end
def initialize(env, build_type)
BuildContext.validate_env(env)
@env = env
@build_type = build_type
end
def task
'assemble'
end
def flavor
@@flavor_hash[@env]
end
def apk_path
"app/build/outputs/apk/app-#{flavor}-#{@build_type.downcase}.apk"
end
def build_type
@build_type
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