Skip to content

Commit

Permalink
PowerShell build script love
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Craver committed Apr 17, 2016
1 parent 151f05c commit 2b488fa
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ foreach {
}

# Restore packages and build product
& dotnet restore "Dapper"
& dotnet restore "Dapper.Contrib"
& dotnet restore -v Minimal # Restore all packages
if ($LASTEXITCODE -ne 0)
{
throw "dotnet restore failed with exit code $LASTEXITCODE"
Expand All @@ -40,13 +39,18 @@ if ($LASTEXITCODE -ne 0)
& dotnet pack "Dapper" --configuration Release --output "artifacts\packages"
& dotnet pack "Dapper.Contrib" --configuration Release --output "artifacts\packages"

#restore, compile, and run tests
& dotnet restore "Dapper.Tests" -f "artifacts\packages"
& dotnet restore "Dapper.Tests.Contrib" -f "artifacts\packages"
dir "*.Tests*" | where {$_.PsIsContainer} |
# Build all
# Note the exclude: https://github.com/dotnet/cli/issues/1342
dir "Dapper*" | where {$_.PsIsContainer -and $_ -NotLike "*.EntityFramework.StrongName" } |
foreach {
pushd "$_"
& dotnet build
popd
}
# Run tests
dir "*.Tests*" | where {$_.PsIsContainer} |
foreach {
pushd "$_"
& dotnet test
popd
}
Expand Down

0 comments on commit 2b488fa

Please sign in to comment.