-
Notifications
You must be signed in to change notification settings - Fork 146
/
appveyor.yml
128 lines (111 loc) · 5.56 KB
/
appveyor.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
version: 2.0.0.{build}
branches:
only:
- master
skip_tags: true
init:
- git config --global core.autocrlf true
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
FRAMEWORKS_TO_BUILD: LEGACY_FRAMEWORKS
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
FRAMEWORKS_TO_BUILD: MAIN_FRAMEWORKS
before_build:
- ps: >-
If($env:FRAMEWORKS_TO_BUILD -eq "LEGACY_FRAMEWORKS")
{
Write-Output "Installing .NET MicroFramework 4.3 ..."
$msiPath = "$($env:USERPROFILE)\MicroFrameworkSDK43.MSI"
(New-Object Net.WebClient).DownloadFile('https://github.com/Azure/amqpnetlite/releases/download/netmf4.3/MicroFrameworkSDK4.3.MSI', $msiPath)
& msiexec.exe /i $msiPath /quiet /log $env:USERPROFILE\netmf43.log | Write-Output
Write-Output "NETMF43 Installed"
Write-Output "Installing .NET MicroFramework 4.4 ..."
$msiPath = "$($env:USERPROFILE)\MicroFrameworkSDK44.MSI"
(New-Object Net.WebClient).DownloadFile('https://github.com/NETMF/netmf-interpreter/releases/download/v4.4-RTW-20-Oct-2015/MicroFrameworkSDK.MSI', $msiPath)
& msiexec.exe /i $msiPath /quiet /log $env:USERPROFILE\netmf44.log | Write-Output
Write-Output "NETMF44 Installed"
Write-Output "Copying NuGet.exe ..."
New-Item c:\projects\amqpnetlite\build\tools -type directory
copy c:\tools\NuGet\NuGet.exe c:\projects\amqpnetlite\build\tools\NuGet.exe
Write-Output "Expanding PATH ..."
$env:Path = "$($env:PATH);$($env:ProgramFiles)\dotnet;$($env:VS140COMNTOOLS)..\IDE"
[Environment]::SetEnvironmentVariable("PATH", $env:Path, "User")
}
Else
{
'Installing nanoFramework VS extension ...' | Write-Host -ForegroundColor White -NoNewline
[System.Net.WebClient]$webClient = New-Object System.Net.WebClient
$webClient.Headers.Add("User-Agent", "request")
$webClient.Headers.Add("Accept", "application/vnd.github.v3+json")
$releaseList = $webClient.DownloadString('https://api.github.com/repos/nanoframework/nf-Visual-Studio-extension/releases?per_page=100')
if($releaseList -match '\"(?<VS2022_version>v2022\.\d+\.\d+\.\d+)\"')
{
$vs2022Tag = $Matches.VS2022_version
}
if($releaseList -match '\"(?<VS2019_version>v2019\.\d+\.\d+\.\d+)\"')
{
$vs2019Tag = $Matches.VS2019_version
}
# Find which VS version is installed
$VsWherePath = "${env:PROGRAMFILES(X86)}\Microsoft Visual Studio\Installer\vswhere.exe"
Write-Output "VsWherePath is: $VsWherePath"
$VsInstance = $(&$VSWherePath -latest -property displayName)
Write-Output "Latest VS is: $VsInstance"
# Get extension details according to VS version, starting from VS2022 down to VS2019
if($vsInstance.Contains('2022'))
{
$extensionUrl = "https://github.com/nanoframework/nf-Visual-Studio-extension/releases/download/$vs2022Tag/nanoFramework.Tools.VS2022.Extension.vsix"
$vsixPath = Join-Path $($env:USERPROFILE) "nanoFramework.Tools.VS2022.Extension.zip"
$extensionVersion = $vs2022Tag
}
elseif($vsInstance.Contains('2019'))
{
$extensionUrl = "https://github.com/nanoframework/nf-Visual-Studio-extension/releases/download/$vs2019Tag/nanoFramework.Tools.VS2019.Extension.vsix"
$vsixPath = Join-Path $($env:USERPROFILE) "nanoFramework.Tools.VS2019.Extension.zip"
$extensionVersion = $vs2019Tag
}
Write-Output "Downloading visx..." -NoNewline
# download VS extension
Write-Debug "Download VSIX file from $extensionUrl to $vsixPath"
$webClient.DownloadFile($extensionUrl, $vsixPath)
$outputPath = "$($env:USERPROFILE)\nf-extension"
# unzip extension
Write-Debug "Unzip extension content"
Expand-Archive $vsixPath -DestinationPath $outputPath
# copy build files to msbuild location
Write-Debug "Copy build files to msbuild location"
$msbuildPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild"
Copy-Item -Path "$($env:USERPROFILE)\nf-extension\`$MSBuild\nanoFramework" -Destination $msbuildPath -Recurse
'OK' | Write-Host -ForegroundColor Green
Write-Output "Copying NuGet.exe ..."
New-Item c:\projects\amqpnetlite\build\tools -type directory
copy c:\tools\NuGet\NuGet.exe c:\projects\amqpnetlite\build\tools\NuGet.exe
Write-Output "Restoring projects ..."
nuget restore amqp-nanoFramework.sln
}
build_script:
- ps: >-
If($env:FRAMEWORKS_TO_BUILD -eq "LEGACY_FRAMEWORKS")
{
Write-Output "Invoking build.cmd script ..."
& c:\projects\amqpnetlite\build.cmd --solution amqp-vs2015.sln | Write-Output
& c:\projects\amqpnetlite\build.cmd release --solution amqp-vs2015.sln | Write-Output
}
Else
{
Write-Output "Invoking build.cmd script for Debug..."
.\build.cmd --solution "amqp.sln amqp-nanoFramework.sln" | Write-Output
Write-Output "Creating dummy files for NetCore to allow NuGet build ..."
mkdir .\bin\Release\Amqp.NetCore
echo "dummy" > .\bin\release\Amqp.NetCore\Amqp.Net.dll
echo "dummy" > .\bin\release\Amqp.NetCore\Amqp.Net.pdb
echo "dummy" > .\bin\release\Amqp.NetCore\Amqp.Net.xml
echo "dummy" > .\bin\release\Amqp.NetCore\Amqp.Net.pri
Write-Output "Invoking build.cmd script for Release..."
.\build.cmd release --solution "amqp.sln amqp-nanoFramework.sln" | Write-Output
}
test: off
deploy: off
on_failure:
- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))