FNA-VSCode-Template/.vscode/processT4Templates.ps1
foxnne 7af4093e67 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.
2019-09-04 01:14:21 -05:00

28 lines
880 B
PowerShell

#!/bin/bash
# buildEffects
# Compiles all .fx files found in the project's Content directory.
# Intended for usage with VS Code Build Tasks tooling.
# You may need to change the path to fxc.exe depending on your installation.
Write-Output "Starting T4 processing..."
Set-Location $PSScriptRoot
Set-Location ..\project_name
# create our output directory
if ((Test-Path("T4Templates\Output")) -eq 0) { New-Item -ItemType "directory" -Path "T4Templates\Output" }
$files = Get-ChildItem ".\T4Templates\*" -Include *.tt
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"
}