-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
140 lines (135 loc) · 5.2 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
platform: x64
environment:
matrix:
- DC: dmd
DVersion: stable
arch: x64
- DC: dmd
DVersion: stable
arch: x86
- DC: ldc
DVersion: stable
arch: x64
#todo ldc/x86?
install:
- ps: function ResolveDMD
{
$version = $env:DVersion;
if($version -eq "stable") {
$latest = (Invoke-WebRequest "http://downloads.dlang.org/releases/LATEST").toString();
$urls = @("http://downloads.dlang.org/releases/2.x/$($latest)/dmd.$($latest).windows.7z");
}elseif($version -eq "beta") {
$latest = (Invoke-WebRequest "http://downloads.dlang.org/pre-releases/LATEST").toString();
$latestVersion = $latest.split("-")[0].split("~")[0];
$urls = @("http://downloads.dlang.org/pre-releases/2.x/$($latestVersion)/dmd.$($latest).windows.7z");
}elseif($version -eq "nightly") {
$urls = @("http://nightlies.dlang.org/dmd-master-2017-05-20/dmd.master.windows.7z");
}else {
$urls = @("http://downloads.dlang.org/releases/2.x/$($version)/dmd.$($version).windows.7z");
}
$env:PATH += ";C:\dmd2\windows\bin;";
return $urls;
}
- ps: function ResolveLDC
{
if($env:arch -eq "x86"){
$archBits = "32";
}
elseif($env:arch -eq "x64"){
$archBits = "64";
}
$version = $env:DVersion;
$arch = $env:arch;
if($version -eq "stable") {
$latest = (Invoke-WebRequest "https://ldc-developers.github.io/LATEST").toString().replace("`n","").replace("`r","");
$urls = @("https://github.com/ldc-developers/ldc/releases/download/v$($latest)/ldc2-$($latest)-windows-$($arch).7z");
}elseif($version -eq "beta") {
$latest = (Invoke-WebRequest "https://ldc-developers.github.io/LATEST_BETA").toString().replace("`n","").replace("`r","");
$urls = @("https://github.com/ldc-developers/ldc/releases/download/v$($latest)/ldc2-$($latest)-windows-$($arch).7z");
} else {
$latest = $version;
$urls = @("https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-windows-$($arch).7z");
$urls += "https://github.com/ldc-developers/ldc/releases/download/v$($version)/ldc2-$($version)-win$($archBits)-msvc.zip";
}
$env:PATH += ";C:\ldc2-$($latest)-windows-$($arch)\bin;C:\ldc2-$($latest)-win$($archBits)-msvc\bin";
$env:DC = "ldc2";
return $urls;
}
- ps: function SetUpDCompiler
{
$env:toolchain = "msvc";
if($env:DC -eq "dmd"){
$env:DMD = "dmd";
$urls = ResolveDMD;
}
elseif($env:DC -eq "ldc"){
$env:DC = "ldmd2";
$env:DMD = "ldmd2";
$urls = ResolveLDC;
}
echo "downloading...";
echo urls=$urls;
foreach($tryUrl in $urls){
$dloadOk = $true;
echo Trying $tryUrl;
try{
Invoke-WebRequest $tryUrl -OutFile "c:\compiler.archive";
}
catch [Net.WebException]{
$dloadOk = $false;
}
if($dloadOk -eq $true){
break;
}
}
echo "extracting...";
pushd c:\\;
7z x compiler.archive > $null;
popd;
echo "finished.";
}
- ps: SetUpDCompiler
- powershell -Command Invoke-WebRequest https://code.dlang.org/files/dub-1.9.0-windows-x86.zip -OutFile dub.zip
- 7z x dub.zip -odub > nul
- set PATH=%CD%\%binpath%;%CD%\dub;%PATH%
- dub --version
# Some older LDC/GDC compilers don't come with rdmd
- ps: function SetUpRDMD
{
if((Get-Command "rdmd.exe" -ErrorAction SilentlyContinue) -eq $null)
{
Invoke-WebRequest "http://downloads.dlang.org/releases/2.x/2.080.0/dmd.2.080.0.windows.7z" -OutFile "c:\rdmd-dmd.7z";
pushd c:\\;
7z x -ordmd-dmd rdmd-dmd.7z > $null;
popd;
}
}
- ps: SetUpRDMD
- set PATH=%PATH%;c:\rdmd-dmd\dmd2\windows\bin
before_build:
- ps: if($env:arch -eq "x86"){
$env:compilersetupargs = "x86";
$env:Darch = "x86";
$env:DConf = "m32";
}elseif($env:arch -eq "x64"){
$env:compilersetupargs = "amd64";
$env:Darch = "x86_64";
$env:DConf = "m64";
}
- ps: $env:compilersetup = "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall";
- '"%compilersetup%" %compilersetupargs%'
build_script:
- echo %PLATFORM%
- echo %Darch%
- echo %DC%
- echo %DMD%
- dub clean
- ps: $env:dubFlags = "--arch=%Darch% --compiler=%DC%"
- dub run --config=indexer %dubFlags%
- dub run glue-d:codescan --config=indexer %dubFlags%
test_script:
- dub test glue-d:annotations %dubFlags%
- dub test glue-d:codescan %dubFlags%
- dub test glue-d:logging %dubFlags%
- dub test glue-d:utils %dubFlags%
- dub test %dubFlags%