Skip to content

Commit

Permalink
Updated build.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbra committed Feb 12, 2019
1 parent 47e51aa commit fa5ae40
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
36 changes: 23 additions & 13 deletions build.ps1
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
1 change: 1 addition & 0 deletions product/roundhouse.tests/roundhouse.tests.csproj
Expand Up @@ -28,6 +28,7 @@
<PackageReference Include="Should" Version="1.1.20" />
<PackageReference Include="System.Data.SQLite" Version="1.0.109.2" />
<PackageReference Include="TinySpec.NUnit" Version="0.9.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="System.Data.OracleClient" />
Expand Down

0 comments on commit fa5ae40

Please sign in to comment.