Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. $artifactsDir = "$PSScriptRoot\artifacts"
  2. $version = if ($env:APPVEYOR) { $env:APPVEYOR_BUILD_VERSION } else { "1.0.0-pre" }
  3.  
  4. task Clean {
  5. if (Test-Path $artifactsDir) { del $artifactsDir -Recurse -Force }
  6. del * -Include bin, obj -Recurse -Force
  7. }
  8.  
  9. task RestoreDependencies Clean, {
  10. exec { dotnet restore /p:Version=$version }
  11. }
  12.  
  13. task BuildSolution RestoreDependencies, {
  14. dir *.sln | %{
  15. exec { dotnet build $_.FullName -c Release /p:Version=$version }
  16. }
  17. }
  18.  
  19. task RunTests BuildSolution, {
  20. if (Test-Path test) {
  21. dir test -Include *.csproj -Recurse | %{
  22. exec { dotnet test $_.FullName -c Release --no-build }
  23. }
  24. }
  25. }
  26.  
  27. task PackSolution RunTests, {
  28. if (Test-Path src) {
  29. dir src -Include *.csproj -Recurse | %{
  30. exec { dotnet pack $_.FullName -c Release -o $artifactsDir --no-build /p:Version=$version }
  31. }
  32. }
  33. }
  34.  
  35. task . PackSolution
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement