Class: Fastlane::Helper::GradleHelper
- Inherits:
-
Object
- Object
- Fastlane::Helper::GradleHelper
- Defined in:
- fastlane/lib/fastlane/helper/gradle_helper.rb
Instance Attribute Summary collapse
-
#escaped_gradle_path ⇒ Object
readonly
Read-only path to the shell-escaped gradle script, suitable for use in shell commands.
-
#gradle_path ⇒ Object
Path to the gradle script.
-
#tasks ⇒ Object
All the available tasks.
Instance Method Summary collapse
-
#initialize(gradle_path: nil) ⇒ GradleHelper
constructor
A new instance of GradleHelper.
- #task_available?(task) ⇒ Boolean
-
#trigger(task: nil, flags: nil, serial: nil, print_command: true, print_command_output: true) ⇒ Object
Run a certain action.
Constructor Details
#initialize(gradle_path: nil) ⇒ GradleHelper
Returns a new instance of GradleHelper.
24 25 26 |
# File 'fastlane/lib/fastlane/helper/gradle_helper.rb', line 24 def initialize(gradle_path: nil) self.gradle_path = gradle_path end |
Instance Attribute Details
#escaped_gradle_path ⇒ Object (readonly)
Read-only path to the shell-escaped gradle script, suitable for use in shell commands
19 20 21 |
# File 'fastlane/lib/fastlane/helper/gradle_helper.rb', line 19 def escaped_gradle_path @escaped_gradle_path end |
#gradle_path ⇒ Object
Path to the gradle script
16 17 18 |
# File 'fastlane/lib/fastlane/helper/gradle_helper.rb', line 16 def gradle_path @gradle_path end |
#tasks ⇒ Object
All the available tasks
22 23 24 |
# File 'fastlane/lib/fastlane/helper/gradle_helper.rb', line 22 def tasks @tasks end |
Instance Method Details
#task_available?(task) ⇒ Boolean
35 36 37 38 |
# 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) ⇒ Object
Run a certain action
29 30 31 32 33 |
# 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 |