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
|
# Names of the default builders which will be added to all newly created
|
||||||
# {Environment} objects.
|
# {Environment} objects.
|
||||||
DEFAULT_BUILDERS = [
|
DEFAULT_BUILDERS = [
|
||||||
:Command,
|
|
||||||
:CFile,
|
:CFile,
|
||||||
|
:Command,
|
||||||
|
:Copy,
|
||||||
:Directory,
|
:Directory,
|
||||||
:Disassemble,
|
:Disassemble,
|
||||||
:Install,
|
:Install,
|
||||||
|
@ -54,6 +54,10 @@ module Rscons
|
|||||||
target if (target_is_dir ? Dir.exists?(target) : File.exists?(target))
|
target if (target_is_dir ? Dir.exists?(target) : File.exists?(target))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class Copy < Install; end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -859,6 +859,23 @@ EOF
|
|||||||
expect(lines).to eq(["Install inst.exe"])
|
expect(lines).to eq(["Install inst.exe"])
|
||||||
end
|
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
|
it "copies a file to the target directory name" do
|
||||||
env = base_env.clone do |env|
|
env = base_env.clone do |env|
|
||||||
lines
|
lines
|
||||||
|
Loading…
x
Reference in New Issue
Block a user