iced/build.ps1

28 lines
1.4 KiB
PowerShell
Raw Normal View History

2019-10-04 16:28:14 +00:00
$ErrorActionPreference = 'Stop'
2019-10-05 15:57:58 +00:00
$configuration = 'Release'
$netcore_tfm = 'netcoreapp3.0'
2019-10-04 16:28:14 +00:00
#
# dotnet build isn't used because it can't build net35 tfms
#
$env:MoreDefineConstants = ''
2019-10-05 15:57:58 +00:00
msbuild -v:m -restore -t:Build -p:Configuration=$configuration
2019-10-04 16:28:14 +00:00
if ($LASTEXITCODE) { exit $LASTEXITCODE }
2019-10-05 15:57:58 +00:00
if (!(Test-Path Iced.UnitTests\bin\$configuration\$netcore_tfm)) { throw "Invalid tfm: $netcore_tfm" }
dotnet test -c $configuration -f $netcore_tfm -p:Exclude='\"[Iced]Iced.Intel.InstructionMemorySizes,[Iced]Iced.Intel.EncoderInternal.OpCodeHandlers,[Iced]Iced.Intel.InstructionInfoInternal.InfoHandlers,[Iced]Iced.Intel.MnemonicUtils,[Iced]Iced.Intel.InstructionOpCounts\"' -p:ExcludeByFile="$PWD\Iced\**\*.g.cs" -p:ExcludeByAttribute='ObsoleteAttribute' -p:CollectCoverage=true -p:CoverletOutputFormat=lcov --no-build Iced.UnitTests\Iced.UnitTests.csproj -- RunConfiguration.NoAutoReporters=true RunConfiguration.TargetPlatform=X64
2019-10-04 16:28:14 +00:00
if ($LASTEXITCODE) { exit $LASTEXITCODE }
# Don't include the IVT in the final binary
$env:MoreDefineConstants = 'IcedNoIVT'
2019-10-05 15:57:58 +00:00
msbuild -v:m -t:Clean -p:Configuration=$configuration
2019-10-04 16:28:14 +00:00
if ($LASTEXITCODE) { exit $LASTEXITCODE }
2019-10-05 15:57:58 +00:00
msbuild -v:m -restore -t:Build -p:Configuration=$configuration Iced\Iced.csproj
2019-10-04 16:28:14 +00:00
if ($LASTEXITCODE) { exit $LASTEXITCODE }
2019-10-05 15:57:58 +00:00
msbuild -v:m -t:Pack -p:Configuration=$configuration Iced\Iced.csproj
2019-10-04 16:28:14 +00:00
if ($LASTEXITCODE) { exit $LASTEXITCODE }
$env:MoreDefineConstants = ''