-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
appveyor.yml
172 lines (156 loc) · 6.67 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#---------------------------------#
# general configuration #
#---------------------------------#
#version: 1.0.{build}-{branch}
# Do not build on tags (GitHub only)
skip_tags: true
#---------------------------------#
# environment configuration #
#---------------------------------#
# Operating system (build VM template)
environment:
matrix:
- os: Visual Studio 2019
VS: 16
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# - os: Visual Studio 2017
# VS: 15
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# - os: Visual Studio 2015
# VS: 14
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# - os: Visual Studio 2013
# VS: 12
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# cache relative to C:\projects\visuald
cache:
- C:\projects\cache\dmd2109_1.7z
- C:\projects\cache\cd851.zip
- C:\projects\cache\VisualD-v0.50.1.exe
- C:\projects\cache\binutils-2.25.tar.gz
#matrix:
# allow_failures:
# - VS: 14
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf input
# scripts that run after cloning repository
install:
# show environment
- set D_COMPILER=dmd
- set CONFIG=Release COFF32
- set CONFIG_DMDSERVER=Release COFF32
- set
- cd c:\projects
- if not exist cache\nul mkdir cache
# Download & extract D compiler
- ps: |
If ($Env:D_COMPILER -eq 'dmd') {
If (-not (Test-Path 'cache\dmd2109_1.7z')) {
Start-FileDownload 'http://downloads.dlang.org/releases/2.x/2.109.1/dmd.2.109.1.windows.7z' -FileName 'cache\dmd2109_1.7z'
}
7z x cache\dmd2109_1.7z > $null
Set-Item -path env:DMD -value c:\projects\dmd2\windows\bin\dmd.exe
} ElseIf ($Env:D_COMPILER -eq 'dmd-nightly') {
Start-FileDownload 'http://nightlies.dlang.org/dmd-nightly/dmd.master.windows.7z' -FileName 'dmd2.7z'
7z x dmd2.7z > $null
Set-Item -path env:DMD -value c:\projects\dmd2\windows\bin\dmd.exe
} ElseIf ($Env:D_COMPILER -eq 'ldc') {
# LDC unsupported so far
Start-FileDownload 'http://github.com/ldc-developers/ldc/releases/download/v1.20.1/ldc2-1.20.1-windows-multilib.zip' -FileName 'ldc2.zip'
7z x ldc2.zip > $null
Set-Item -path env:DMD -value c:\projects\ldc2-1.20.1-windows-multilib\bin\ldmd2.exe
}
# Download & extract coffimplib.exe (no longer available publically as a single download)
- ps: |
If (-not (Test-Path 'cache\cd851.7z')) {
Start-FileDownload 'http://ftp.digitalmars.com/Digital_Mars_C++/Patch/cd851.zip' -FileName 'cache\cd851.zip'
}
7z x cache\cd851.zip > $null
copy c:\projects\dm\bin\coffimplib.exe c:\projects\dmd2\windows\bin
# Download & install Visual D
- ps: |
If (-not (Test-Path 'cache\VisualD-v1.3.1.exe')) {
Start-FileDownload 'https://github.com/dlang/visuald/releases/download/v1.3.1/VisualD-v1.3.1.exe' -FileName 'cache\VisualD-v1.3.1.exe'
}
- cache\VisualD-v1.3.1.exe /S
# configure DMD path
- reg add "HKLM\SOFTWARE\DMD" /v InstallationFolder /t REG_SZ /d c:\projects /reg:32 /f
# disable link dependencies monitoring, fails on AppVeyor server
- reg add "HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\ToolsOptionsPages\Projects\Visual D Settings" /v optlinkDeps /t REG_DWORD /d 0 /reg:32 /f
# Set environment variables
- set PATH=c:\projects\dm\bin;%PATH%
- if "%VS%" == "12" call "c:\Program Files (x86)\Microsoft Visual Studio %VS%.0\VC\vcvarsall.bat" x86
- if "%VS%" == "14" call "c:\Program Files (x86)\Microsoft Visual Studio %VS%.0\VC\vcvarsall.bat" x86
- if "%VS%" == "15" call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
- if "%VS%" == "16" call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"
# Print environment info
- set
- msbuild /version
- cl
#---------------------------------#
# build configuration #
#---------------------------------#
before_build:
- cd c:\projects
build_script:
- '"%DMD%" --version'
- cd c:\projects
- cd visuald
# Fetch submodules
- git submodule update --init --recursive
# ignore failure once, in case it needs reloading the sdk project
- nmake "CONFIG=%CONFIG%" prerequisites || nmake "CONFIG=%CONFIG%" prerequisites
# build Visual D
- nmake "CONFIG=%CONFIG%" visuald_vs
# build and run Visual D unittests
- nmake "CONFIG=%CONFIG%" "CONFIG_DMDSERVER=%CONFIG_DMDSERVER%" visuald_test dmdserver_test
- cd ..
# Clone mago/cv2pdb (need to be two levels up)
- cd ..
- git clone https://github.com/rainers/mago.git mago
- md cv2pdb
- cd cv2pdb
- git clone https://github.com/rainers/cv2pdb.git trunk
- cd ..
# Download & extract binutils
- cd projects
- ps: |
If (-not (Test-Path 'cache\binutils-2.25.tar.gz')) {
Start-FileDownload 'http://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.gz' -FileName 'cache\binutils-2.25.tar.gz'
}
7z x cache\binutils-2.25.tar.gz > $null
7z x binutils-2.25.tar > $null
- 'if "%VS%"=="12" echo #define snprintf _snprintf >binutils-2.25\config.h'
- 'if "%VS%"=="14" echo // empty >binutils-2.25\config.h'
- 'if "%VS%"=="15" echo // empty >binutils-2.25\config.h'
- set BINUTILS=c:\projects\binutils-2.25
- set DMDINSTALLDIR=c:\projects\dmd2
# build installer
- cd visuald
# can build dbuild15 and dparser only with VS2017
- if "%VS%"=="15" nuget restore vdc\abothe\VDServer.sln
- if "%VS%"=="15" nmake "CONFIG=%CONFIG%" "CONFIG_DMDSERVER=%CONFIG_DMDSERVER%" install_vs_only_vs2017
- if not "%VS%"=="15" nmake "CONFIG=%CONFIG%" "CONFIG_DMDSERVER=%CONFIG_DMDSERVER%" appveyor
after_build:
# publish as artifact
- cd c:\projects
- 7z a logs_and_symbols.7z -r visuald\bin\*.pdb visuald\bin\*.html
# - for %%I in (downloads\*.exe) do (set BUILD_EXE=%%I && set ARTIFACT=%%~dpnI-%APPVEYOR_BUILD_NUMBER%-vs%VS%.exe)
# - copy %BUILD_EXE% %ARTIFACT%
# Push-AppveyorArtifact $Env:ARTIFACT
- ps: |
echo 'Creating artifacts...'
Push-AppveyorArtifact ..\cv2pdb\trunk\bin\Release\cv2pdb.exe
Push-AppveyorArtifact logs_and_symbols.7z
on_failure:
- cd c:\projects
- 7z a logs.7z -r visuald\bin\*.html
- ps: |
echo 'Publishing log files...'
Push-AppveyorArtifact logs.7z
#---------------------------------#
# test configuration #
#---------------------------------#
test_script:
- cd c:\projects