-
Notifications
You must be signed in to change notification settings - Fork 50
/
BuildNuget.ps1
39 lines (28 loc) · 1.23 KB
/
BuildNuget.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
37
#Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
#http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd
#http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd
#http://schemas.microsoft.com/packaging/2016/06/nuspec.xsd
if (-not (Test-Path -Path Nuget.exe -PathType Leaf)) {
Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile Nuget.exe
}
.\nuget restore
dotnet restore
msbuild -restore
msbuild PrimS.Telnet.sln /p:Configuration=Debug /p:Platform="Any CPU"
#with mstests
vstest.console.exe **\bin\**\PrimS.Telnet.Sync.CiTests.dll
vstest.console.exe PrimS.Telnet.48.CiTests\bin\Debug\**\PrimS.Telnet.48.CiTests.dll
dotnet vstest PrimS.Telnet.CiTests\bin\Debug\**\PrimS.Telnet.CiTests.dll
dotnet vstest **\bin\Debug\**\PrimS.Telnet.NetStandard.CiTests.dll
dotnet tool install --global GitVersion.Tool
$str = dotnet-gitversion /updateprojectfiles | out-string
$json = ConvertFrom-Json $str
$semVer = $json.SemVer
$fullSemVer = $json.FullSemVer
$nuGetVersionV2 = $json.NuGetVersionV2
Write-Host $str
Write-Host $semVer
Write-Host $fullSemVer
Write-Host $nuGetVersionV2
msbuild PrimS.Telnet.sln /p:Configuration=Release /p:Platform="Any CPU"
.\nuget pack Telnet.nuspec -Version $nuGetVersionV2