Created
December 3, 2016 18:50
-
-
Save matsuokah/7771597346d07dcebd52accba0a7037e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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