forked from Azure/amqpnetlite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
136 lines (84 loc) · 4.05 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
129
130
131
132
133
134
135
136
version: 2.0.0.{build}
branches:
only:
- master
skip_tags: true
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
FRAMEWORKS_TO_BUILD: REST_OF_FRAMEWORKS
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
FRAMEWORKS_TO_BUILD: NANOFRAMEWORK
before_build:
- ps: >-
If($env:FRAMEWORKS_TO_BUILD -eq "REST_OF_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")
Write-Output "Restoring dotnet projects ..."
pushd dotnet
dotnet restore
popd
}
Else
{
'Installing nanoFramework VS extension ...' | Write-Host -ForegroundColor White -NoNewline
[System.Net.WebClient]$webClient = New-Object System.Net.WebClient
$webClient.UseDefaultCredentials = $true
# get extension information from MyGet VSIX feed
$vsixFeedXml = Join-Path $($env:USERPROFILE) "vs-extension-feed.xml"
$webClient.DownloadFile("https://www.myget.org/F/nanoframework-dev/vsix", $vsixFeedXml)
[xml]$feedDetails = Get-Content $vsixFeedXml
# assuming this is building on VS2017 only
$extensionUrl = $feedDetails.feed.entry[0].content.src
$vsixPath = Join-Path $($env:USERPROFILE) "nanoFramework.Tools.VS2017.Extension.zip"
# 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\2017\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 "REST_OF_FRAMEWORKS")
{
Write-Output "Invoking build.cmd script ..."
& c:\projects\amqpnetlite\build.cmd | Write-Output
& c:\projects\amqpnetlite\build.cmd release | Write-Output
}
Else
{
Write-Output "Invoking build.cmd script ..."
& c:\projects\amqpnetlite\build.cmd --solution amqp-nanoFramework.sln | Write-Output
& c:\projects\amqpnetlite\build.cmd release --solution 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'))