Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3af6b6be1b | ||
|
|
0442b876a5 |
No files matched your search
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
rscons (1.9.1)
|
rscons (1.9.2)
|
||||||
json (~> 1.0)
|
json (~> 1.0)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
@@ -48,4 +48,4 @@ DEPENDENCIES
|
|||||||
yard
|
yard
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.10.4
|
1.10.6
|
||||||
@@ -406,6 +406,10 @@ http://rubydoc.info/github/holtrop/rscons/frames.
|
|||||||
|
|
||||||
## Release Notes
|
## Release Notes
|
||||||
|
|
||||||
|
### v1.9.2
|
||||||
|
|
||||||
|
- allow phony targets in conjunction with build roots
|
||||||
|
|
||||||
### v1.9.1
|
### v1.9.1
|
||||||
|
|
||||||
- change *SUFFIX defaults to arrays
|
- change *SUFFIX defaults to arrays
|
||||||
|
|||||||
@@ -509,7 +509,11 @@ module Rscons
|
|||||||
#
|
#
|
||||||
# @return [String] The expanded path.
|
# @return [String] The expanded path.
|
||||||
def expand_path(path)
|
def expand_path(path)
|
||||||
path.sub(%r{^\^(?=[\\/])}, @build_root)
|
if Rscons.phony_target?(path)
|
||||||
|
path
|
||||||
|
else
|
||||||
|
path.sub(%r{^\^(?=[\\/])}, @build_root)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Execute a command using the system shell.
|
# Execute a command using the system shell.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module Rscons
|
module Rscons
|
||||||
# gem version
|
# gem version
|
||||||
VERSION = "1.9.1"
|
VERSION = "1.9.2"
|
||||||
end
|
end
|
||||||
+25
-22
@@ -933,33 +933,36 @@ EOF
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "phony targets" do
|
context "phony targets" do
|
||||||
it "allows specifying a Symbol as a target name and reruns the builder if the sources or command have changed" do
|
[false, true].each do |with_build_root|
|
||||||
test_dir("simple")
|
it "allows specifying a Symbol as a target name and reruns the builder if the sources or command have changed" do
|
||||||
env = Rscons::Environment.new do |env|
|
test_dir("simple")
|
||||||
env.add_builder(:Checker) do |target, sources, cache, env, vars|
|
env = Rscons::Environment.new do |env|
|
||||||
unless cache.up_to_date?(target, :Checker, sources, env)
|
env.build_root = "bld" if with_build_root
|
||||||
puts "Checker #{sources.first}" if env.echo != :off
|
env.add_builder(:Checker) do |target, sources, cache, env, vars|
|
||||||
cache.register_build(target, :Checker, sources, env)
|
unless cache.up_to_date?(target, :Checker, sources, env)
|
||||||
|
puts "Checker #{sources.first}" if env.echo != :off
|
||||||
|
cache.register_build(target, :Checker, sources, env)
|
||||||
|
end
|
||||||
|
target
|
||||||
end
|
end
|
||||||
target
|
env.Program("simple.exe", "simple.c")
|
||||||
|
env.Checker(:checker, "simple.exe")
|
||||||
end
|
end
|
||||||
env.Program("simple.exe", "simple.c")
|
expect(lines).to eq(["CC #{with_build_root ? 'bld/' : ''}simple.o", "LD simple.exe", "Checker simple.exe"])
|
||||||
env.Checker(:checker, "simple.exe")
|
|
||||||
end
|
|
||||||
expect(lines).to eq(["CC simple.o", "LD simple.exe", "Checker simple.exe"])
|
|
||||||
|
|
||||||
env.clone do |env|
|
env.clone do |env|
|
||||||
env.Checker(:checker, "simple.exe")
|
env.Checker(:checker, "simple.exe")
|
||||||
end
|
end
|
||||||
expect(lines).to eq([])
|
expect(lines).to eq([])
|
||||||
|
|
||||||
File.open("simple.exe", "w") do |fh|
|
File.open("simple.exe", "w") do |fh|
|
||||||
fh.puts "Changed simple.exe"
|
fh.puts "Changed simple.exe"
|
||||||
|
end
|
||||||
|
env.clone do |env|
|
||||||
|
env.Checker(:checker, "simple.exe")
|
||||||
|
end
|
||||||
|
expect(lines).to eq(["Checker simple.exe"])
|
||||||
end
|
end
|
||||||
env.clone do |env|
|
|
||||||
env.Checker(:checker, "simple.exe")
|
|
||||||
end
|
|
||||||
expect(lines).to eq(["Checker simple.exe"])
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user