Compare commits
2 Commits
21f8e2435e
...
07e7f214f1
Author | SHA1 | Date | |
---|---|---|---|
07e7f214f1 | |||
3ad741514d |
@ -3,8 +3,6 @@
|
|||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
- #156 - Avoid running configure operation twice
|
- #156 - Avoid running configure operation twice
|
||||||
- #157 - Load configure task arguments before early configure operations
|
|
||||||
- #158 - Do not configure for clean tasks when not yet configured
|
|
||||||
|
|
||||||
## v3.0.0
|
## v3.0.0
|
||||||
|
|
||||||
|
@ -2,5 +2,4 @@ configure do
|
|||||||
check_c_compiler
|
check_c_compiler
|
||||||
end
|
end
|
||||||
env do |env|
|
env do |env|
|
||||||
puts "Prefix is #{Task["configure"]["prefix"]}"
|
|
||||||
end
|
end
|
||||||
|
@ -446,9 +446,6 @@ end
|
|||||||
See ${#Configuring the Project} for more details on how to make use of the
|
See ${#Configuring the Project} for more details on how to make use of the
|
||||||
configuration functionality that Rscons provides.
|
configuration functionality that Rscons provides.
|
||||||
|
|
||||||
Configure blocks must be defined in the Rsconscript file before any
|
|
||||||
environments are created.
|
|
||||||
|
|
||||||
####> Default Task
|
####> Default Task
|
||||||
|
|
||||||
The `default` task is special in that Rscons will execute it if no other task
|
The `default` task is special in that Rscons will execute it if no other task
|
||||||
|
@ -73,7 +73,6 @@ module Rscons
|
|||||||
# Process exit code (0 on success).
|
# Process exit code (0 on success).
|
||||||
def run(rsconscript, tasks_and_params, show_tasks, all_tasks, enabled_variants)
|
def run(rsconscript, tasks_and_params, show_tasks, all_tasks, enabled_variants)
|
||||||
Cache.instance["failed_commands"] = []
|
Cache.instance["failed_commands"] = []
|
||||||
@tasks_and_params = tasks_and_params
|
|
||||||
@enabled_variants = enabled_variants
|
@enabled_variants = enabled_variants
|
||||||
if enabled_variants == "" && !tasks_and_params.include?("configure")
|
if enabled_variants == "" && !tasks_and_params.include?("configure")
|
||||||
if cache_enabled_variants = Cache.instance["configuration_data"]["enabled_variants"]
|
if cache_enabled_variants = Cache.instance["configuration_data"]["enabled_variants"]
|
||||||
@ -81,15 +80,13 @@ module Rscons
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
@script = Script.new
|
@script = Script.new
|
||||||
if should_load_script
|
@script.load(rsconscript)
|
||||||
@script.load(rsconscript)
|
enable_variants
|
||||||
enable_variants
|
|
||||||
end
|
|
||||||
if show_tasks
|
if show_tasks
|
||||||
show_script_tasks(all_tasks)
|
show_script_tasks(all_tasks)
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
apply_task_params(false)
|
apply_task_params(tasks_and_params)
|
||||||
@task_execution_phase = true
|
@task_execution_phase = true
|
||||||
if tasks_and_params.empty?
|
if tasks_and_params.empty?
|
||||||
check_process_environments
|
check_process_environments
|
||||||
@ -172,8 +169,8 @@ module Rscons
|
|||||||
def distclean
|
def distclean
|
||||||
cache = Cache.instance
|
cache = Cache.instance
|
||||||
clean
|
clean
|
||||||
cache.clear
|
|
||||||
FileUtils.rm_rf(@build_dir)
|
FileUtils.rm_rf(@build_dir)
|
||||||
|
cache.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
# Check if the project needs to be configured.
|
# Check if the project needs to be configured.
|
||||||
@ -182,7 +179,6 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def check_configure
|
def check_configure
|
||||||
apply_task_params(true)
|
|
||||||
enable_variants
|
enable_variants
|
||||||
unless Cache.instance["configuration_data"]["configured"]
|
unless Cache.instance["configuration_data"]["configured"]
|
||||||
if @script.autoconf
|
if @script.autoconf
|
||||||
@ -382,27 +378,18 @@ module Rscons
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def apply_task_params(only_configure)
|
def apply_task_params(tasks_and_params)
|
||||||
@tasks_and_params.each do |task_name, task_params|
|
tasks_and_params.each do |task_name, task_params|
|
||||||
unless only_configure && task_name != "configure"
|
task_params.each do |param_name, param_value|
|
||||||
task_params.each do |param_name, param_value|
|
if param = Task[task_name].params[param_name]
|
||||||
if param = Task[task_name].params[param_name]
|
Task[task_name].set_param_value(param_name, param_value)
|
||||||
Task[task_name].set_param_value(param_name, param_value)
|
else
|
||||||
else
|
raise RsconsError.new("Unknown parameter #{param_name.inspect} for task #{task_name}")
|
||||||
raise RsconsError.new("Unknown parameter #{param_name.inspect} for task #{task_name}")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def should_load_script
|
|
||||||
return true if @tasks_and_params.empty?
|
|
||||||
return true if Cache.instance["configuration_data"]["configured"]
|
|
||||||
return false if (@tasks_and_params.keys - %w[distclean clean uninstall]).empty?
|
|
||||||
true
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -101,7 +101,6 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def write
|
def write
|
||||||
return unless Dir.exist?(File.dirname(cache_file))
|
|
||||||
@cache["version"] = VERSION
|
@cache["version"] = VERSION
|
||||||
File.open(cache_file, "w") do |fh|
|
File.open(cache_file, "w") do |fh|
|
||||||
fh.puts(JSON.dump(@cache))
|
fh.puts(JSON.dump(@cache))
|
||||||
|
@ -1845,42 +1845,6 @@ EOF
|
|||||||
expect(result.stdout).to_not match %r{Configuring project.*Configuring project}m
|
expect(result.stdout).to_not match %r{Configuring project.*Configuring project}m
|
||||||
end
|
end
|
||||||
|
|
||||||
it "loads configure parameters before invoking configure" do
|
|
||||||
test_dir "configure"
|
|
||||||
|
|
||||||
result = run_rscons(args: %w[-f configure_with_top_level_env.rb configure --prefix=/yodabob])
|
|
||||||
expect(result.stderr).to eq ""
|
|
||||||
expect(result.status).to eq 0
|
|
||||||
expect(result.stdout).to match "Prefix is /yodabob"
|
|
||||||
end
|
|
||||||
|
|
||||||
it "does not configure for distclean operation" do
|
|
||||||
test_dir "configure"
|
|
||||||
|
|
||||||
result = run_rscons(args: %w[-f configure_with_top_level_env.rb distclean])
|
|
||||||
expect(result.stderr).to eq ""
|
|
||||||
expect(result.status).to eq 0
|
|
||||||
expect(result.stdout).to_not match %r{Configuring project}
|
|
||||||
end
|
|
||||||
|
|
||||||
it "does not configure for clean operation" do
|
|
||||||
test_dir "configure"
|
|
||||||
|
|
||||||
result = run_rscons(args: %w[-f configure_with_top_level_env.rb clean])
|
|
||||||
expect(result.stderr).to eq ""
|
|
||||||
expect(result.status).to eq 0
|
|
||||||
expect(result.stdout).to_not match %r{Configuring project}
|
|
||||||
end
|
|
||||||
|
|
||||||
it "does not configure for uninstall operation" do
|
|
||||||
test_dir "configure"
|
|
||||||
|
|
||||||
result = run_rscons(args: %w[-f configure_with_top_level_env.rb uninstall])
|
|
||||||
expect(result.stderr).to eq ""
|
|
||||||
expect(result.status).to eq 0
|
|
||||||
expect(result.stdout).to_not match %r{Configuring project}
|
|
||||||
end
|
|
||||||
|
|
||||||
it "automatically runs the configure task if the project is not yet configured in the given build directory" do
|
it "automatically runs the configure task if the project is not yet configured in the given build directory" do
|
||||||
test_dir "configure"
|
test_dir "configure"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user