Skip to content

Commit b682309

Browse files
committed
Restructuring again
1 parent 9ce17fc commit b682309

File tree

254 files changed

+23
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+23
-1
lines changed
File renamed without changes.

CompileMql5Task/CompileMql5.ps1 renamed to vsts-extension/CompileMql5Task/CompileMql5.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[CmdletBinding()]
22
param()
33

4+
$compilerDownloadLink = ""
45
Trace-VstsEnteringInvocation $MyInvocation
56

67
try {
@@ -9,6 +10,7 @@ try {
910
#get the inputs
1011
[string]$pathToSources = Get-VstsInput -Name pathToSources -Require
1112
[string]$mql5IncludePath = Get-VstsInput -Name mql5IncludePath
13+
[string]$metaEditorPath = Get-VstsInput -Name metaEditorPath
1214

1315
if("$mql5IncludePath" -eq "")
1416
{
@@ -20,6 +22,18 @@ try {
2022
$pathToSources = "$($env:BUILD_SOURCESDIRECTORY)\*.mqproj"
2123
}
2224

25+
if("$metaEditorPath" -eq "")
26+
{
27+
#download the file if not exist already
28+
$metaEditorPath = "$($env:AGENT_WORKFOLDER)\_mql5\metaeditor64.exe"
29+
if(-not (Test-Path $metaEditorPath -PathType Leaf))
30+
{
31+
Write-Host "Metatrader compiler not found. Downloading from $compilerDownloadLink"
32+
[System.IO.Directory]::CreateDirectory([System.IO.Path]::GetDirectoryName($metaEditorPath)) | Out-Null
33+
(New-Object System.Net.WebClient).DownloadFile($compilerDownloadLink, $metaEditorPath)
34+
}
35+
}
36+
2337
$compileFiles = Find-VstsMatch -DefaultRoot $env:BUILD_SOURCESDIRECTORY -Pattern $pathToSources
2438

2539
foreach($file in $compileFiles)
@@ -28,7 +42,7 @@ try {
2842

2943
$proc = New-Object System.Diagnostics.Process
3044
$proc.StartInfo.UseShellExecute = $false
31-
$proc.StartInfo.FileName = "$PSScriptRoot\metaeditor64.exe"
45+
$proc.StartInfo.FileName = $metaEditorPath
3246
$proc.StartInfo.CreateNoWindow = $true
3347
$proc.StartInfo.Arguments = "/compile:`"$file`" /log /include:`"$mql5IncludePath`""
3448
$proc.Start() | Out-Null

0 commit comments

Comments
 (0)