28
28
$metaEditorPath = " $ ( $env: AGENT_WORKFOLDER ) \_mql5\metaeditor64.exe"
29
29
if (-not (Test-Path $metaEditorPath - PathType Leaf))
30
30
{
31
- Write-Host " Metatrader compiler not found. Downloading from $compilerDownloadLink "
31
+ Write-Output " Metatrader compiler not found. Downloading from $compilerDownloadLink "
32
32
[System.IO.Directory ]::CreateDirectory([System.IO.Path ]::GetDirectoryName($metaEditorPath )) | Out-Null
33
33
34
34
# fix the TLS issues, see here: https://stackoverflow.com/questions/41618766/powershell-invoke-webrequest-fails-with-ssl-tls-secure-channel
43
43
44
44
foreach ($file in $compileFiles )
45
45
{
46
- Write-Host " Compiling MQL5 files: $file "
46
+ Write-Output " Compiling MQL5 files: $file "
47
47
48
48
$proc = New-Object System.Diagnostics.Process
49
49
$proc.StartInfo.UseShellExecute = $false
@@ -58,19 +58,20 @@ try {
58
58
$logFile = [System.IO.Path ]::ChangeExtension($file , " .log" )
59
59
if (Test-Path $logFile - PathType Leaf)
60
60
{
61
- Write-Host " Compilation log $ ( [System.IO.Path ]::GetFileName($logFile )) :"
62
- Write-Host " ====================================================================="
63
- Write-Host (Get-Content $logFile - Raw)
61
+ Write-Output " Compilation log $ ( [System.IO.Path ]::GetFileName($logFile )) :"
62
+ Write-Output " ====================================================================="
63
+ Write-Output (Get-Content $logFile - Raw)
64
64
}
65
65
else
66
66
{
67
- Write-Host " No log created during compilation."
67
+ Write-Output " No log created during compilation."
68
68
}
69
69
70
70
# 1 - when successful, 0 when fails
71
71
if ($exitCode -ne 1 )
72
72
{
73
- Write-Error " Compilation failed (exit code $exitCode )"
73
+ Write-VstsTaskError - Message " Compilation failed (exit code $exitCode )"
74
+ Write-VstsSetResult - Result ' Failed' - Message " Compilation failed"
74
75
}
75
76
}
76
77
0 commit comments