2
A
回答
5
是的,這當然可以使用內置的通配符處理功能,例如:
var solutions = GetFiles("./**/*.sln");
Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(() =>
{
// Build all solutions.
foreach(var solution in solutions)
{
Information("Building {0}", solution);
MSBuild(solution, settings =>
settings.SetPlatformTarget(PlatformTarget.MSIL)
.WithProperty("TreatWarningsAsErrors","true")
.WithTarget("Build")
.SetConfiguration(configuration));
}
});
同樣,你可以做同樣的前構建具有的NuGet恢復,例如
Task("Restore")
.Does(() =>
{
// Restore all NuGet packages.
foreach(var solution in solutions)
{
Information("Restoring {0}...", solution);
NuGetRestore(solution);
}
});
而且乾淨的任務可以適應這樣
var solutionPaths = solutions.Select(solution => solution.GetDirectory());
Task("Clean")
.Does(() =>
{
// Clean solution directories.
foreach(var path in solutionPaths)
{
Information("Cleaning {0}", path);
CleanDirectories(path + "/**/bin/" + configuration);
CleanDirectories(path + "/**/obj/" + configuration);
}
});
相關問題
- 1. 避免在VisualStudio解決方案中構建所有VB.NET項目
- 2. 在TFS中管理構建所有解決方案
- 3. c#解決方案的構建優化
- 4. 如何構建C#解決方案
- 5. 構建解決方案
- 6. 讓MsBuild構建子文件夾中的所有解決方案
- 7. 構建文件夾中的所有解決方案
- 8. 在Visual Studio中構建解決方案,重建解決方案和清理解決方案的區別?
- 9. TeamCity使用Visual Studio構建C++解決方案
- 10. [Jenkins]使用devenv.com構建C++解決方案文件
- 11. 使用Visual Studio 2010從命令行構建C#解決方案
- 12. 在vs2010下構建vs2008解決方案
- 13. VB.NET解決方案中的間接引用解決方案構建
- 14. Cake(C#make)在build.cake中使用.Net Framework方法
- 15. 在Doctrine2中是否有i18n解決方案構建
- 16. TFS在解決方案構建或解決方案打開時要求籤出?
- 17. 如何在我的解決方案中找到所有構建事件
- 18. 簡化CI構建的C#項目/解決方案結構
- 19. 無法構建解決方案
- 20. 構建一個解決方案
- 21. 從TFS2008構建VS2010解決方案
- 22. LNK2019構建解決方案時出錯
- 23. 如何構建一個解決方案
- 24. 從makefile VS2010構建解決方案
- 25. VS 2008解決方案構建
- 26. 請幫我構建ETL解決方案
- 27. 組織多解決方案構建
- 28. MVC3解決方案log4net構建問題
- 29. 使用特定變更集在TFS上構建解決方案
- 30. 在使用TFS 2017構建解決方案時出現CS0234 BuildAgent