Process environments created during task execution phase
This commit is contained in:
1 parent
29ca9b3f13
commit
bb4657e465
4 files changed
+33
-1
No files matched your search
@@ -42,6 +42,16 @@ module Rscons
|
||||
@variant_groups = []
|
||||
end
|
||||
|
||||
# Return if Rscons is in the task execution phase.
|
||||
#
|
||||
# @api private
|
||||
#
|
||||
# @return [Boolean]
|
||||
# If Rscons is in the task execution phase.
|
||||
def task_execution_phase?
|
||||
@task_execution_phase
|
||||
end
|
||||
|
||||
# Run the application.
|
||||
#
|
||||
# Execute user-specified tasks.
|
||||
@@ -77,6 +87,7 @@ module Rscons
|
||||
return 0
|
||||
end
|
||||
apply_task_params(tasks_and_params)
|
||||
@task_execution_phase = true
|
||||
if tasks_and_params.empty?
|
||||
check_process_environments
|
||||
if Task.tasks["default"]
|
||||
|
||||
@@ -130,13 +130,21 @@ module Rscons
|
||||
#
|
||||
# If a block is given it is immediately executed and passed the newly
|
||||
# created Environment object as an argument.
|
||||
# If the Environment is created in task context, the +process+ method is
|
||||
# immediately called.
|
||||
# Otherwise, the Environment is not processed until the task execution
|
||||
# phase.
|
||||
#
|
||||
# @yield [env]
|
||||
# @yieldparam env [Environment]
|
||||
# The created environment.
|
||||
def env(*args, &block)
|
||||
Rscons.application.check_configure
|
||||
Environment.new(*args, &block)
|
||||
e = Environment.new(*args, &block)
|
||||
if Rscons.application.task_execution_phase?
|
||||
e.process
|
||||
end
|
||||
e
|
||||
end
|
||||
|
||||
# Construct a task parameter.
|
||||
|
||||
Reference in new issue
Block a user