ahk_tests/compile.ps1
Thomas Faber 85175a35eb [AHK]
- Add PowerShell version of compile.sh

svn path=/trunk/ahk_tests/; revision=1963
2013-02-10 13:30:09 +00:00

30 lines
619 B
PowerShell

[CmdletBinding()]
Param(
[string]$Ahk2Exe = ".\Compiler\ahk2exe.exe",
[string]$OutDir = ".\AHK-Tests"
)
if (!(Test-Path $Ahk2Exe))
{
Write-Output "Please add AHK in the Compiler subdirectory or specify -Ahk2Exe option"
Exit
}
if (Test-Path $OutDir)
{
Remove-Item $OutDir\zz*_test.exe
}
else
{
$null = New-Item -Type Directory $OutDir
}
$Tests = Get-ChildItem -Recurse -Filter "zz*.ahk"
foreach ($Test in $Tests)
{
$In = $Test.FullName
$Out = "$OutDir\$($Test.BaseName).exe"
Write-Verbose "Compiling $In"
Start-Process $Ahk2Exe "/in ""$In"" /out ""$Out""" -Wait -NoNewWindow
}