Skip to content

Commit 4340b95

Browse files
committed
Errors, etc. Fixing input parameters - should be plain strings
1 parent a4c5cbe commit 4340b95

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

vsts-extension/CompileMql5Task/CompileMql5.ps1

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ try {
2828
$metaEditorPath = "$($env:AGENT_WORKFOLDER)\_mql5\metaeditor64.exe"
2929
if(-not (Test-Path $metaEditorPath -PathType Leaf))
3030
{
31-
Write-Host "Metatrader compiler not found. Downloading from $compilerDownloadLink"
31+
Write-Output "Metatrader compiler not found. Downloading from $compilerDownloadLink"
3232
[System.IO.Directory]::CreateDirectory([System.IO.Path]::GetDirectoryName($metaEditorPath)) | Out-Null
3333

3434
#fix the TLS issues, see here: https://stackoverflow.com/questions/41618766/powershell-invoke-webrequest-fails-with-ssl-tls-secure-channel
@@ -43,7 +43,7 @@ try {
4343

4444
foreach($file in $compileFiles)
4545
{
46-
Write-Host "Compiling MQL5 files: $file"
46+
Write-Output "Compiling MQL5 files: $file"
4747

4848
$proc = New-Object System.Diagnostics.Process
4949
$proc.StartInfo.UseShellExecute = $false
@@ -58,19 +58,20 @@ try {
5858
$logFile = [System.IO.Path]::ChangeExtension($file, ".log")
5959
if(Test-Path $logFile -PathType Leaf)
6060
{
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)
6464
}
6565
else
6666
{
67-
Write-Host "No log created during compilation."
67+
Write-Output "No log created during compilation."
6868
}
6969

7070
#1 - when successful, 0 when fails
7171
if($exitCode -ne 1)
7272
{
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"
7475
}
7576
}
7677

vsts-extension/CompileMql5Task/task.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"version": {
1313
"Major": 0,
1414
"Minor": 1,
15-
"Patch": 1
15+
"Patch": 7
1616
},
1717
"minimumAgentVersion": "1.95.0",
1818
"instanceNameFormat": "Compile $(pathToSources)",
@@ -34,7 +34,7 @@
3434
},
3535
{
3636
"name": "mql5IncludePath",
37-
"type": "filePath",
37+
"type": "string",
3838
"label": "MQL5 Include Path",
3939
"defaultValue": "",
4040
"required": false,
@@ -43,7 +43,7 @@
4343
},
4444
{
4545
"name": "metaEditorPath",
46-
"type": "filePath",
46+
"type": "string",
4747
"label": "Path to metaeditor64.exe",
4848
"defaultValue": "",
4949
"required": false,

vsts-extension/vss-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifestVersion": 1,
33
"id": "stpatrick-tfs-build-tasks-mql5",
44
"name": "MetaTrader 5 build tasks",
5-
"version": "0.1.2",
5+
"version": "0.1.7",
66
"publisher": "philip-patrick",
77
"targets": [
88
{

0 commit comments

Comments
 (0)