Class: Bozo::Executor
Overview
Class defining the structure of the build and responsible for executing tasks and their dependencies.
Instance Attribute Summary
Attributes included from Runner
#build_configuration, #env, #global_params, #params
Instance Method Summary collapse
-
#clean(params, env) ⇒ Object
Runs the clean task.
-
#compile(params, env) ⇒ Object
Runs the compile task.
-
#dependencies(params, env) ⇒ Object
Runs the dependency retrieval task.
-
#execute(command, params, env) ⇒ Object
Executes the command using the given parameters and environment.
-
#initialize(build_configuration, global_params) ⇒ Executor
constructor
Create a new instance.
-
#package(params, env) ⇒ Object
Runs the package task.
-
#prepare(params, env) ⇒ Object
Runs the prepare task.
-
#publish(params, env) ⇒ Object
Runs the publish task.
-
#test(params, env) ⇒ Object
Runs the test task.
-
#uninstall(params, env) ⇒ Object
Runs the uninstall task.
Methods included from Runner
#build_server?, #environment, #execute_command, #pre_release?, #version
Methods included from Logging
#log_debug, #log_fatal, #log_info, #log_warn
Constructor Details
#initialize(build_configuration, global_params) ⇒ Executor
Create a new instance.
14 15 16 17 |
# File 'lib/bozo/executor.rb', line 14 def initialize(build_configuration, global_params) @build_configuration = build_configuration @global_params = cli_keys_to_ruby global_params end |
Instance Method Details
#clean(params, env) ⇒ Object
Runs the clean task.
39 40 41 42 43 44 45 |
# File 'lib/bozo/executor.rb', line 39 def clean(params, env) with_hooks :clean, params, env do log_info 'Cleaning project' clear_directory 'temp' clear_directory 'dist' end end |
#compile(params, env) ⇒ Object
Runs the compile task.
91 92 93 94 |
# File 'lib/bozo/executor.rb', line 91 def compile(params, env) prepare params, env execute_with_hooks :compile, params, env end |
#dependencies(params, env) ⇒ Object
Runs the dependency retrieval task.
68 69 70 71 72 |
# File 'lib/bozo/executor.rb', line 68 def dependencies(params, env) clean params, env retrieve_build_dependencies execute_with_hooks :dependencies, params, env end |
#execute(command, params, env) ⇒ Object
Executes the command using the given parameters and environment.
27 28 29 30 31 |
# File 'lib/bozo/executor.rb', line 27 def execute(command, params, env) with_hooks :build, params, env do send command, params, env end end |
#package(params, env) ⇒ Object
Runs the package task.
113 114 115 116 |
# File 'lib/bozo/executor.rb', line 113 def package(params, env) test params, env execute_with_hooks :package, params, env end |
#prepare(params, env) ⇒ Object
Runs the prepare task.
80 81 82 83 |
# File 'lib/bozo/executor.rb', line 80 def prepare(params, env) dependencies params, env execute_with_hooks :prepare, params, env end |
#publish(params, env) ⇒ Object
Runs the publish task.
124 125 126 127 128 129 130 131 132 133 |
# File 'lib/bozo/executor.rb', line 124 def publish(params, env) if build_server? package params, env execute_with_hooks :publish, params, env else log_warn 'You can only publish a package from build server.' log_warn '' log_warn 'If you really need to publish the package then provide the --build-server switch but you should only be doing that as a last resort.' end end |
#test(params, env) ⇒ Object
Runs the test task.
102 103 104 105 |
# File 'lib/bozo/executor.rb', line 102 def test(params, env) compile params, env execute_with_hooks :test, params, env end |
#uninstall(params, env) ⇒ Object
Runs the uninstall task.
53 54 55 56 57 58 59 60 |
# File 'lib/bozo/executor.rb', line 53 def uninstall(params, env) clean params, env with_hooks :uninstall, params, env do log_info 'Uninstalling project' clear_directory 'packages' clear_directory 'build' end end |