class Fastlane::Helper::GradleHelper
Attributes
escaped_gradle_path[R]
Read-only path to the shell-escaped gradle script, suitable for use in shell commands
gradle_path[RW]
Path to the gradle script
tasks[RW]
All the available tasks
Public Class Methods
new(gradle_path: nil)
click to toggle source
# File fastlane/lib/fastlane/helper/gradle_helper.rb, line 24 def initialize(gradle_path: nil) self.gradle_path = gradle_path end
Public Instance Methods
gradle_path=(gradle_path)
click to toggle source
# File fastlane/lib/fastlane/helper/gradle_helper.rb, line 40 def gradle_path=(gradle_path) @gradle_path = gradle_path @escaped_gradle_path = gradle_path.shellescape end
task_available?(task)
click to toggle source
# File fastlane/lib/fastlane/helper/gradle_helper.rb, line 35 def task_available?(task) load_all_tasks return tasks.collect(&:title).include?(task) end
trigger(task: nil, flags: nil, serial: nil, print_command: true, print_command_output: true)
click to toggle source
Run a certain action
# File fastlane/lib/fastlane/helper/gradle_helper.rb, line 29 def trigger(task: nil, flags: nil, serial: nil, print_command: true, print_command_output: true) android_serial = (serial != "") ? "ANDROID_SERIAL=#{serial}" : nil command = [android_serial, escaped_gradle_path, task, flags].compact.join(" ") Action.sh(command, print_command: print_command, print_command_output: print_command_output) end
Private Instance Methods
load_all_tasks()
click to toggle source
# File fastlane/lib/fastlane/helper/gradle_helper.rb, line 47 def load_all_tasks self.tasks = [] command = [escaped_gradle_path, "tasks", "--console=plain"].join(" ") output = Action.sh(command, print_command: false, print_command_output: false) output.split("\n").each do |line| if (result = line.match(/(\w+)\s\-\s([\w\s]+)/)) self.tasks << GradleTask.new(title: result[1], description: result[2]) end end self.tasks end