Skip to content

Instantly share code, notes, and snippets.

@matsuokah
Created December 3, 2016 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsuokah/7771597346d07dcebd52accba0a7037e to your computer and use it in GitHub Desktop.
Save matsuokah/7771597346d07dcebd52accba0a7037e to your computer and use it in GitHub Desktop.
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