Rake for .NET

问题描述 投票:0回答:2

构建 .NET 解决方案并使用 Rake 运行 MbUnit 测试的最佳方法是什么?

我目前正在像这样直接调用命令:

sh "#{DOT_NET_PATH}msbuild.exe /p:Configuration=#{CONFIG} #{SOLUTION}"

这可行,但看起来有点垃圾。人们会推荐使用什么宝石吗?

.net rake
2个回答
14
投票

我刚刚开始使用 albacore,可以在 http://github.com/derickbailey/Albacore 上找到。

完整文档位于 wiki

执行构建的任务就是这么简单:

msbuild do |msb|
 msb.solution = "mysolution.sln"
 #... other settings here
end

想要执行单元测试?

desc "NUnit Test Runner Example"
nunit do |nunit|
    nunit.path_to_command = "NUnit/nunit-console.exe"
    nunit.assemblies << "assemblies/TestSolution.Tests.dll"
end

更新: 查看 这篇 2010 年 5 月的文章,了解非常全面的教程。


4
投票

rake-dotnet 非常有用,虽然相当新(尽管这对我来说确实很无耻;-))。

源代码

© www.soinside.com 2019 - 2024. All rights reserved.