Sha256: 7b35f712e23364198dd77a18573de6ec4f53c7abb69c725e369adb1f05b298c3

Contents?: true

Size: 1.55 KB

Versions: 8

Compression:

Stored size: 1.55 KB

Contents

import "md5", "autoclean"

var :content => "1\n"

task :a => "f1.t"

file "f1.t" do |t|
    write_content(t.name)
end

gen Directory, "d1.t"

gen Directory, "base.t", "s/s" => ["a.t", "f1.t"] do |t|
    fn = t.name + "/t"
    puts "copying to #{fn}"
    open fn, "w" do |f|
        f.write(File.read(t.source))
        f.write(File.read("f1.t"))
    end; sys.cd "sub1"
end

if var["subfile"]
    import "subfile"
    gen SubFile, "d2.t/f" => "f1.t" do |t|
        sys.cp t.source, t.name
    end
end

file "f2.t" => ["base.t/s/s"] do |t|
    sys.cp "#{t.source}/t", t.name
end

gen SourceNode, "c1.t"

gen SourceNode, "c2.t" => ["c1.t", "c3.t"]

file "f3.t" => "c1.t" do |t|
    var[:content] = File.read(t.source)
    write_content(t.name)
end

file "f4.t" => ["f3.t", "c2.t"] do |t|
    var[:content] = t.deps.inject("") { |c, fn| c + File.read(fn) }
    write_content(t.name)
end

gen SourceNode, "c4.t" => "c2.t"

file "f5.t" => "c2.t" do |t|
    sys.cp t.source, t.name
end

gen SourceNode, "c5.t" => ["sub1/c1.t", "c6.t"]

file "f6.t" => "c5.t" do |t|
    write_content(t.name)
end

gen Rule, ".r.t" => ".t" do |t|
    sys.cp t.source, t.name
end

gen Rule, ".r.t" => ".tt" do |t|
    sys.cp t.source, t.name
end

gen SourceNode, "c7.t" => ["f1.t", "c8.t"]

file "f7.t" => "c7.t" do |t|
    sys.cp t.source, t.name
    sys.cd "sub1"
end

desc "copy f1.t from sub1 to f8.t"
file "f8.t" => "sub1/f1.t" do |t|
    sys.cp t.source, t.name
end

subdirs "sub1"

def write_content(fn)
    puts "writing #{fn}"
    open fn, "w" do |f|
        f.write var[:content]
    end
end

gen AutoClean

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rant-0.4.6 test/import/nodes/signed/Rantfile
rant-0.4.8 test/import/nodes/signed/Rantfile
rant-0.5.0 test/import/nodes/signed/Rantfile
rant-0.5.2 test/import/nodes/signed/Rantfile
rant-0.5.4 test/import/nodes/signed/Rantfile
rant-0.5.6 test/import/nodes/signed/Rantfile
rant-0.4.4 test/import/nodes/signed/Rantfile
rant-0.5.7 test/import/nodes/signed/Rantfile