Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
platform: x64 | ||
environment: | ||
matrix: | ||
- DC: dmd | ||
DVersion: 2.081.1 | ||
arch: x64 | ||
- DC: ldc | ||
DVersion: 1.10.0 | ||
arch: x64 | ||
|
||
skip_tags: true | ||
|
||
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", | ||
"http://ftp.digitalmars.com/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", | ||
"http://ftp.digitalmars.com/dmd.$($latest).windows.7z"); | ||
}elseif($version -eq "nightly") { | ||
$latest = (Invoke-WebRequest "http://nightlies.dlang.org/$($version)/LATEST").toString(); | ||
$urls = @("http://nightlies.dlang.org/dmd-$($latest)/dmd.master.windows.7z"); | ||
}else { | ||
$urls = @("http://downloads.dlang.org/releases/2.x/$($version)/dmd.$($version).windows.7z", | ||
"http://ftp.digitalmars.com/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 dummy build script - dont remove me | ||
|
||
test_script: | ||
- echo %PLATFORM% | ||
- echo %Darch% | ||
- echo %DC% | ||
- echo %DMD% | ||
- echo %PATH% | ||
- '%DC% --help' | ||
- dub test --arch=%Darch% --compiler=%DC% |