Adds checks for OpenRA.Utility.exe in make.cmd.

It displays a message now instead of file not found error.
This commit is contained in:
deniz1a
2015-06-07 09:10:54 +03:00
parent 854117d1d9
commit b8c3a7a30d

View File

@@ -18,6 +18,11 @@ function FindMSBuild
return $null return $null
} }
function UtilityNotFound
{
echo "OpenRA.Utility.exe could not be found. Build the project first using the `"all`" command."
}
if ($args.Length -eq 0) if ($args.Length -eq 0)
{ {
echo "Command list:" echo "Command list:"
@@ -74,7 +79,7 @@ elseif ($command -eq "clean")
rm *.dll rm *.dll
rm *.config rm *.config
rm mods/*/*.dll rm mods/*/*.dll
if (Test-Path -Path thirdparty/download/) if (Test-Path thirdparty/download/)
{ {
rmdir thirdparty/download -Recurse -Force rmdir thirdparty/download -Recurse -Force
} }
@@ -129,6 +134,8 @@ elseif ($command -eq "dependencies")
} }
} }
elseif ($command -eq "test") elseif ($command -eq "test")
{
if (Test-Path OpenRA.Utility.exe)
{ {
echo "Testing mods..." echo "Testing mods..."
echo "Testing Red Alert mod MiniYAML..." echo "Testing Red Alert mod MiniYAML..."
@@ -140,7 +147,14 @@ elseif ($command -eq "test")
echo "Testing Tiberian Sun mod MiniYAML..." echo "Testing Tiberian Sun mod MiniYAML..."
./OpenRA.Utility.exe ts --check-yaml ./OpenRA.Utility.exe ts --check-yaml
} }
else
{
UtilityNotFound
}
}
elseif ($command -eq "check") elseif ($command -eq "check")
{
if (Test-Path OpenRA.Utility.exe)
{ {
echo "Checking for code style violations in OpenRA.Renderer.Null..." echo "Checking for code style violations in OpenRA.Renderer.Null..."
./OpenRA.Utility.exe ra --check-code-style OpenRA.Renderer.Null ./OpenRA.Utility.exe ra --check-code-style OpenRA.Renderer.Null
@@ -167,13 +181,25 @@ elseif ($command -eq "check")
echo "Checking for code style violations in OpenRA.Test..." echo "Checking for code style violations in OpenRA.Test..."
./OpenRA.Utility.exe cnc --check-code-style OpenRA.Test ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Test
} }
else
{
UtilityNotFound
}
}
elseif ($command -eq "docs") elseif ($command -eq "docs")
{
if (Test-Path OpenRA.Utility.exe)
{ {
./make.ps1 version ./make.ps1 version
./OpenRA.Utility.exe all --docs | Out-File -Encoding "UTF8" DOCUMENTATION.md ./OpenRA.Utility.exe all --docs | Out-File -Encoding "UTF8" DOCUMENTATION.md
./OpenRA.Utility.exe ra --lua-docs | Out-File -Encoding "UTF8" Lua-API.md ./OpenRA.Utility.exe ra --lua-docs | Out-File -Encoding "UTF8" Lua-API.md
} }
else else
{
UtilityNotFound
}
}
else
{ {
echo ("Invalid command '{0}'" -f $command) echo ("Invalid command '{0}'" -f $command)
} }