Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

108 строки
1.9 KiB

  1. #addin "nuget:https://www.nuget.org/api/v2?package=Newtonsoft.Json&version=9.0.1"
  2. #load "./build/index.cake"
  3. var target = Argument("target", "Default");
  4. var build = BuildParameters.Create(Context);
  5. var util = new Util(Context, build);
  6. Task("Clean")
  7. .Does(() =>
  8. {
  9. if (DirectoryExists("./artifacts"))
  10. {
  11. DeleteDirectory("./artifacts", true);
  12. }
  13. });
  14. Task("Restore")
  15. .IsDependentOn("Clean")
  16. .Does(() =>
  17. {
  18. var settings = new DotNetCoreRestoreSettings
  19. {
  20. ArgumentCustomization = args =>
  21. {
  22. args.Append($"/p:VersionSuffix={build.Version.Suffix}");
  23. return args;
  24. }
  25. };
  26. DotNetCoreRestore(settings);
  27. });
  28. Task("Build")
  29. .IsDependentOn("Restore")
  30. .Does(() =>
  31. {
  32. var settings = new DotNetCoreBuildSettings
  33. {
  34. Configuration = build.Configuration,
  35. VersionSuffix = build.Version.Suffix,
  36. ArgumentCustomization = args =>
  37. {
  38. args.Append($"/p:InformationalVersion={build.Version.VersionWithSuffix()}");
  39. return args;
  40. }
  41. };
  42. foreach (var project in build.ProjectFiles)
  43. {
  44. DotNetCoreBuild(project.FullPath, settings);
  45. }
  46. });
  47. Task("Test")
  48. .IsDependentOn("Build")
  49. .Does(() =>
  50. {
  51. var settings = new DotNetCoreTestSettings
  52. {
  53. Configuration = build.Configuration,
  54. NoBuild = false
  55. };
  56. foreach (var testProject in build.TestProjectFiles)
  57. {
  58. DotNetCoreTest(testProject.FullPath, settings);
  59. }
  60. });
  61. Task("Pack")
  62. .Does(() =>
  63. {
  64. var settings = new DotNetCorePackSettings
  65. {
  66. Configuration = build.Configuration,
  67. VersionSuffix = build.Version.Suffix,
  68. IncludeSymbols = true,
  69. OutputDirectory = "./artifacts/packages"
  70. };
  71. foreach (var project in build.ProjectFiles)
  72. {
  73. DotNetCorePack(project.FullPath, settings);
  74. }
  75. });
  76. Task("Default")
  77. .IsDependentOn("Build")
  78. .IsDependentOn("Test")
  79. .IsDependentOn("Pack")
  80. .Does(() =>
  81. {
  82. util.PrintInfo();
  83. });
  84. Task("Version")
  85. .Does(() =>
  86. {
  87. Information($"{build.FullVersion()}");
  88. });
  89. Task("Print")
  90. .Does(() =>
  91. {
  92. util.PrintInfo();
  93. });
  94. RunTarget(target);