forked from 0xd4d/dnlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
36 lines (28 loc) · 864 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
param([switch]$NoMsbuild)
$ErrorActionPreference = 'Stop'
$configuration = 'Release'
#
# dotnet build isn't used because it can't build net35 tfms
#
$env:NoTargetFrameworkNet35 = ''
$useMsbuild = $IsWindows -or $IsWindows -eq $null
if ($NoMsbuild) {
$useMsbuild = $false
}
if (!$useMsbuild) {
# There are currently no net35 reference assemblies on nuget
$env:NoTargetFrameworkNet35 = 'true'
}
if ($useMsbuild) {
msbuild -v:m -restore -t:Build -p:Configuration=$configuration
if ($LASTEXITCODE) { exit $LASTEXITCODE }
msbuild -v:m -t:Pack -p:Configuration=$configuration src/dnlib.csproj
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}
else {
dotnet build -v:m -c $configuration
if ($LASTEXITCODE) { exit $LASTEXITCODE }
dotnet pack -v:m -c $configuration src/dnlib.csproj
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}
$env:NoTargetFrameworkNet35 = ''