add Copy builder as a copy of Install
This commit is contained in:
parent
f678803a5d
commit
4eedea2563
@ -22,8 +22,9 @@ module Rscons
|
||||
# Names of the default builders which will be added to all newly created
|
||||
# {Environment} objects.
|
||||
DEFAULT_BUILDERS = [
|
||||
:Command,
|
||||
:CFile,
|
||||
:Command,
|
||||
:Copy,
|
||||
:Directory,
|
||||
:Disassemble,
|
||||
:Install,
|
||||
|
@ -54,6 +54,10 @@ module Rscons
|
||||
target if (target_is_dir ? Dir.exists?(target) : File.exists?(target))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Copy < Install; end
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -859,6 +859,23 @@ EOF
|
||||
expect(lines).to eq(["Install inst.exe"])
|
||||
end
|
||||
|
||||
it "operates the same as a Copy builder" do
|
||||
env = base_env.clone do |env|
|
||||
lines
|
||||
env.Copy("inst.exe", "simple.exe")
|
||||
end
|
||||
expect(lines).to eq(["Copy inst.exe"])
|
||||
env.Copy("inst.exe", "simple.exe")
|
||||
env.process
|
||||
expect(lines).to eq([])
|
||||
expect(File.exists?("inst.exe")).to be_truthy
|
||||
expect(File.read("inst.exe", mode: "rb")).to eq(File.read("simple.exe", mode: "rb"))
|
||||
FileUtils.rm("inst.exe")
|
||||
env.Copy("inst.exe", "simple.exe")
|
||||
env.process
|
||||
expect(lines).to eq(["Copy inst.exe"])
|
||||
end
|
||||
|
||||
it "copies a file to the target directory name" do
|
||||
env = base_env.clone do |env|
|
||||
lines
|
||||
|
Loading…
x
Reference in New Issue
Block a user