25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

101 satır
1.7 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. foreach (var testProject in build.TestProjectFiles)
  52. {
  53. DotNetCoreTest(testProject.FullPath);
  54. }
  55. });
  56. Task("Pack")
  57. .Does(() =>
  58. {
  59. var settings = new DotNetCorePackSettings
  60. {
  61. Configuration = build.Configuration,
  62. VersionSuffix = build.Version.Suffix,
  63. OutputDirectory = "./artifacts/packages"
  64. };
  65. foreach (var project in build.ProjectFiles)
  66. {
  67. DotNetCorePack(project.FullPath, settings);
  68. }
  69. });
  70. Task("Default")
  71. .IsDependentOn("Build")
  72. .IsDependentOn("Test")
  73. .IsDependentOn("Pack")
  74. .Does(() =>
  75. {
  76. util.PrintInfo();
  77. });
  78. Task("Version")
  79. .Does(() =>
  80. {
  81. Information($"{build.FullVersion()}");
  82. });
  83. Task("Print")
  84. .Does(() =>
  85. {
  86. util.PrintInfo();
  87. });
  88. RunTarget(target);