Class: DeployGate::Android::GradleDeploy

Inherits:
Object
  • Object
show all
Defined in:
lib/deploygate/android/gradle_deploy.rb

Constant Summary collapse

GRADLE_DEPLOY_USER_NAME_ENV =
'DEPLOYGATE_USER_NAME'
GRADLE_DEPLOY_MESSAGE_ENV =
'DEPLOYGATE_MESSAGE'
GRADLE_DEPLOY_DISTRIBUTION_KEY_ENV =
'DEPLOYGATE_DISTRIBUTION_KEY'

Instance Method Summary collapse

Constructor Details

#initialize(dir, options) ⇒ GradleDeploy

Returns a new instance of GradleDeploy.



9
10
11
12
13
14
15
16
17
# File 'lib/deploygate/android/gradle_deploy.rb', line 9

def initialize (dir, options)
  @dir = dir
  @cli = HighLine.new

  GradleProject.root_dir?(@dir)     or raise "#{@dir} is not the root directory of Android project"
  Dir.chdir(@dir)                   or raise "Cannot chdir to #{@dir}"
  @gradle = find_gradle_executable  or raise 'Gradle executable not found.'
  @deploy_env = env(options)
end

Instance Method Details

#deployObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/deploygate/android/gradle_deploy.rb', line 19

def deploy
  print 'Looking for DeployGate tasks...'
  tasks = get_deploygate_tasks
  puts

  task  = case tasks.size
            when 0
              install_plugin and return deploy
            when 1
              tasks[0]
            else
              choose(tasks)
          end

  run_task task unless task.nil?
end