Fixed some issues with the powershell scripts inside of .vscode

I had only tested the other configuration on a single project and in practice saw that the current vscode terminal location would cause a fail if it was in use. Now the build task uses a reference location...

Also fixed a few of the build tasks which seemed to work before, but werent calling anymore for some reason using the & modifier. Now thye seem to always work using the powershell command to open the ps1 files.
This commit is contained in:
foxnne 2019-09-04 01:14:21 -05:00
parent 2c926361e4
commit 7af4093e67
3 changed files with 19 additions and 6 deletions

View File

@ -6,8 +6,10 @@
Write-Output "Starting build process..."
Set-Location $PSScriptRoot
Set-Location ../project_name
$fxc = "C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Utilities\bin\x86\fxc.exe"
$files = Get-ChildItem -Path "Content\*" -Recurse -Include *fx
@ -21,3 +23,4 @@ foreach ($file in $files)
Write-Output "Built ${fileName}.fx to ${filePath}b"
}

View File

@ -6,11 +6,11 @@
Write-Output "Starting T4 processing..."
Set-Location ../project_name
Set-Location $PSScriptRoot
Set-Location ..\project_name
# create our output directory
if ((Test-Path("T4Templates")) -eq 0) { New-Item -ItemType "directory" -Path "T4Templates" }
if ((Test-Path("T4Templates\Output")) -eq 0) { New-Item -ItemType "directory" -Path "T4Templates\Output"}
if ((Test-Path("T4Templates\Output")) -eq 0) { New-Item -ItemType "directory" -Path "T4Templates\Output" }
$files = Get-ChildItem ".\T4Templates\*" -Include *.tt
@ -19,7 +19,9 @@ foreach ($file in $files)
$fileName = $file.BaseName
# Build the template
t4 -r System.dll -r mscorlib.dll -r netstandard.dll -r System.IO.FileSystem.dll -r System.Linq.dll -r System.Text.RegularExpressions -o "T4Templates\Output\${fileName}.cs" "T4Templates\${fileName}.tt"
Write-Output "Built ${fileName}.cs from ${fileName}.tt"
}

14
.vscode/tasks.json vendored
View File

@ -112,7 +112,11 @@
"command": "${workspaceFolder}/.vscode/buildEffects.sh"
},
"windows":{
"command": "& ${workspaceFolder}/.vscode/buildEffects.ps1"
"command": "powershell",
"args": [
"-File",
"${workspaceFolder}/.vscode/buildEffects.ps1"
],
},
"problemMatcher": "$msCompile"
},
@ -168,10 +172,14 @@
"command": "${workspaceFolder}/.vscode/processT4Templates.sh"
},
"windows": {
"command": "& ${workspaceFolder}/.vscode/processT4Templates.ps1"
"command": "powershell",
"args": [
"-File",
"${workspaceFolder}/.vscode/processT4Templates.ps1"
]
},
"group": "build",
"problemMatcher": "$msCompile",
},
]
}
}