From fa5ae40ca18309e9a30b03941aca8e4f1e74553c Mon Sep 17 00:00:00 2001 From: "Erik A. Brandstadmoen" Date: Thu, 7 Feb 2019 07:55:56 +0100 Subject: [PATCH] Updated build.ps1 --- build.ps1 | 36 ++++++++++++------- .../roundhouse.tests/roundhouse.tests.csproj | 1 + 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/build.ps1 b/build.ps1 index 4f4aa956..ccb844b9 100755 --- a/build.ps1 +++ b/build.ps1 @@ -26,8 +26,8 @@ If ($onAppVeyor) { appveyor UpdateBuild -Version "$newVersion" } -" * Updating NuGet" -nuget update -self +" * Updating NuGet to handle newer license metadata" +nuget update -self -Verbosity quiet " * Restoring nuget packages" nuget restore -NonInteractive -Verbosity quiet @@ -47,13 +47,26 @@ $file = $(Get-ChildItem -Recurse -Include MySql.Data.dll ~/.nuget/packages/mysql " * Building and packaging" -dotnet build --no-restore -v q -p:Version="$($gitVersion.FullSemVer)" -p:Configuration=Release -p:Platform="Any CPU" -dotnet publish --no-restore -v q -p:Version="$($gitVersion.FullSemVer)" -p:Configuration=Release -p:Platform="Any CPU" -p:TargetFramework=netcoreapp2.1 product/roundhouse.console -dotnet pack --no-build -v q -p:Version="$($gitVersion.FullSemVer)" -p:NoPackageAnalysis=true -p:Configuration=Release -p:Platform="Any CPU" -o ${PACKAGEDIR} +msbuild /t:"Build" /p:DropFolder=$CODEDROP /p:Version="$($gitVersion.FullSemVer)" /p:NoPackageAnalysis=true /nologo /v:q /fl /flp:"LogFile=$LOGDIR/msbuild.log;Verbosity=n" /p:Configuration=Build /p:Platform="Any CPU" -" * Packaging netcoreapp2.1 global tool dotnet-roundhouse`n" +" - NuGet libraries" +dotnet pack -nologo --no-build -v q -p:Version="$($gitVersion.FullSemVer)" -p:NoPackageAnalysis=true -p:Configuration=Build -p:Platform="Any CPU" -o ${PACKAGEDIR} -nuget pack -Verbosity quiet -outputdirectory ${PACKAGEDIR} .\product\roundhouse.console\roundhouse.tool.nuspec -Properties "Version=$($gitVersion.FullSemVer);NoPackageAnalysis=true" + +" - net461 command-line nuget package" + +nuget pack product/roundhouse.console/roundhouse.nuspec -OutputDirectory "$CODEDROP/packages" -Verbosity quiet -NoPackageAnalysis -Version "$($gitVersion.FullSemVer)" +msbuild /t:"Pack" product/roundhouse.tasks/roundhouse.tasks.csproj /p:DropFolder=$CODEDROP /p:Version="$($gitVersion.FullSemVer)" /p:NoPackageAnalysis=true /nologo /v:q /fl /flp:"LogFile=$LOGDIR/msbuild.roundhouse.tasks.pack.log;Verbosity=n" /p:Configuration=Build /p:Platform="Any CPU" + +" - netcoreapp2.1 global tool dotnet-roundhouse" + +dotnet publish -v q -nologo --no-restore product/roundhouse.console -p:Version="$($gitVersion.FullSemVer)" -p:NoPackageAnalysis=true -p:TargetFramework=netcoreapp2.1 -p:Version="$($gitVersion.FullSemVer)" -p:Configuration=Build -p:Platform="Any CPU" +dotnet pack -v q -nologo --no-restore --no-build product/roundhouse.console -p:NoPackageAnalysis=true -p:TargetFramework=netcoreapp2.1 -o ${PACKAGEDIR} -p:Version="$($gitVersion.FullSemVer)" -p:Configuration=Build -p:Platform="Any CPU" + + +# " * Packaging netcoreapp2.1 global tool dotnet-roundhouse`n" + +# nuget pack -Verbosity quiet -outputdirectory ${PACKAGEDIR} .\product\roundhouse.console\roundhouse.tool.nuspec -Properties "Version=$($gitVersion.FullSemVer);NoPackageAnalysis=true" # AppVeyor runs the test automagically, no need to run explicitly with nunit-console.exe. # But we want to run the tests on localhost too. @@ -62,13 +75,10 @@ If (! $onAppVeyor) { "`n * Running unit tests`n" # Find test projects - $testProjects = $(dir -r -i *.tests.csproj) + $testAssemblies = $(dir -r -i *.tests.dll) - $testProjects | % { - Push-Location $_.Directory - dotnet test -v q - Pop-Location + $testAssemblies | ? { $_.FullName -NotLike "*obj*" } | % { + dotnet vstest $_ } } -Pop-Location diff --git a/product/roundhouse.tests/roundhouse.tests.csproj b/product/roundhouse.tests/roundhouse.tests.csproj index cb7e3a34..304de679 100644 --- a/product/roundhouse.tests/roundhouse.tests.csproj +++ b/product/roundhouse.tests/roundhouse.tests.csproj @@ -28,6 +28,7 @@ +