class Fastlane::Helper::GradleHelper
Attributes
Read-only path to the shell-escaped gradle script, suitable for use in shell commands
Path to the gradle script
All the available tasks
Public Class Methods
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
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
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
Source
# 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
Run a certain action
Private Instance Methods
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