Sha256: 7cc2cdc7ff387818576d76bd606d47181b84488b6593cbbf05af30c5a8afbd24

Contents?: true

Size: 875 Bytes

Versions: 13

Compression:

Stored size: 875 Bytes

Contents

var.env "csc", "target"
conf = plugin :Configure do |conf|
    conf.init_modes = [:explicit]
    conf.override_modes = [:env]
    conf.task           # define a task named :configure
    conf.check "target" do |c|
        c.default "conf_csharp.exe"
        c.interact {
            c.prompt "Name for executable: "
        }
    end
    # define more checks
end

plugin :Csharp do |cs|
    cs.config = conf
end

conf.init

task :default => ["conf_csharp.cs", conf["target"]]

# from our example above
gen Assembly, conf["target"] do |t|
    t.libs = %w(System.Xml.dll)
    t.sources = Dir["*.cs"]
end

file "conf_csharp.cs" do |t|
    File.open(t.name, "w") { |f|
	f << <<-EOF
class ConfCSharp
{
    public static void Main(string[] args)
    {
	System.Console.WriteLine("ConfCSharp");
    }
}
	EOF
    }
end

task :clean do
    sys.rm_f Dir["*.{exe,cs}"] + %w(config)
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rant-0.3.4 test/plugin/rantfile
rant-0.3.6 test/plugin/rantfile
rant-0.4.0 test/plugin/rantfile
rant-0.4.2 test/plugin/rantfile
rant-0.4.4 test/plugin/rantfile
rant-0.4.6 test/plugin/rantfile
rant-0.4.8 test/plugin/rantfile
rant-0.5.4 test/plugin/rantfile
rant-0.5.6 test/plugin/rantfile
rant-0.3.8 test/plugin/rantfile
rant-0.5.0 test/plugin/rantfile
rant-0.5.2 test/plugin/rantfile
rant-0.5.7 test/plugin/rantfile