diff --git a/.vscode/buildEffects.ps1 b/.vscode/buildEffects.ps1 index 0f5a719..a6ed69b 100644 --- a/.vscode/buildEffects.ps1 +++ b/.vscode/buildEffects.ps1 @@ -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" } + diff --git a/.vscode/processT4Templates.ps1 b/.vscode/processT4Templates.ps1 index b70f07a..974975a 100644 --- a/.vscode/processT4Templates.ps1 +++ b/.vscode/processT4Templates.ps1 @@ -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" } + diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 851db23..fdacfa0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -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", }, ] -} \ No newline at end of file +}