From b8c3a7a30d003c0b03c490e7b9618f3ce1e83b37 Mon Sep 17 00:00:00 2001 From: deniz1a Date: Sun, 7 Jun 2015 09:10:54 +0300 Subject: [PATCH] Adds checks for OpenRA.Utility.exe in make.cmd. It displays a message now instead of file not found error. --- make.ps1 | 100 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 37 deletions(-) diff --git a/make.ps1 b/make.ps1 index c25f189ac4..96163c3df0 100644 --- a/make.ps1 +++ b/make.ps1 @@ -18,6 +18,11 @@ function FindMSBuild 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) { echo "Command list:" @@ -74,7 +79,7 @@ elseif ($command -eq "clean") rm *.dll rm *.config rm mods/*/*.dll - if (Test-Path -Path thirdparty/download/) + if (Test-Path thirdparty/download/) { rmdir thirdparty/download -Recurse -Force } @@ -130,48 +135,69 @@ elseif ($command -eq "dependencies") } elseif ($command -eq "test") { - echo "Testing mods..." - echo "Testing Red Alert mod MiniYAML..." - ./OpenRA.Utility.exe ra --check-yaml - echo "Testing Tiberian Dawn mod MiniYAML..." - ./OpenRA.Utility.exe cnc --check-yaml - echo "Testing Dune 2000 mod MiniYAML..." - ./OpenRA.Utility.exe d2k --check-yaml - echo "Testing Tiberian Sun mod MiniYAML..." - ./OpenRA.Utility.exe ts --check-yaml + if (Test-Path OpenRA.Utility.exe) + { + echo "Testing mods..." + echo "Testing Red Alert mod MiniYAML..." + ./OpenRA.Utility.exe ra --check-yaml + echo "Testing Tiberian Dawn mod MiniYAML..." + ./OpenRA.Utility.exe cnc --check-yaml + echo "Testing Dune 2000 mod MiniYAML..." + ./OpenRA.Utility.exe d2k --check-yaml + echo "Testing Tiberian Sun mod MiniYAML..." + ./OpenRA.Utility.exe ts --check-yaml + } + else + { + UtilityNotFound + } } elseif ($command -eq "check") { - echo "Checking for code style violations in OpenRA.Renderer.Null..." - ./OpenRA.Utility.exe ra --check-code-style OpenRA.Renderer.Null - echo "Checking for code style violations in OpenRA.GameMonitor..." - ./OpenRA.Utility.exe ra --check-code-style OpenRA.GameMonitor - echo "Checking for code style violations in OpenRA.Game..." - ./OpenRA.Utility.exe ra --check-code-style OpenRA.Game - echo "Checking for code style violations in OpenRA.Mods.Common..." - ./OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.Common - echo "Checking for code style violations in OpenRA.Mods.RA..." - ./OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.RA - echo "Checking for code style violations in OpenRA.Mods.Cnc..." - ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.Cnc - echo "Checking for code style violations in OpenRA.Mods.D2k..." - ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.D2k - echo "Checking for code style violations in OpenRA.Mods.TS..." - ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.TS - echo "Checking for code style violations in OpenRA.Editor..." - ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Editor - echo "Checking for code style violations in OpenRA.Renderer.Sdl2..." - ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Renderer.Sdl2 - echo "Checking for code style violations in OpenRA.Utility..." - ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Utility - echo "Checking for code style violations in OpenRA.Test..." - ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Test + if (Test-Path OpenRA.Utility.exe) + { + echo "Checking for code style violations in OpenRA.Renderer.Null..." + ./OpenRA.Utility.exe ra --check-code-style OpenRA.Renderer.Null + echo "Checking for code style violations in OpenRA.GameMonitor..." + ./OpenRA.Utility.exe ra --check-code-style OpenRA.GameMonitor + echo "Checking for code style violations in OpenRA.Game..." + ./OpenRA.Utility.exe ra --check-code-style OpenRA.Game + echo "Checking for code style violations in OpenRA.Mods.Common..." + ./OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.Common + echo "Checking for code style violations in OpenRA.Mods.RA..." + ./OpenRA.Utility.exe ra --check-code-style OpenRA.Mods.RA + echo "Checking for code style violations in OpenRA.Mods.Cnc..." + ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.Cnc + echo "Checking for code style violations in OpenRA.Mods.D2k..." + ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.D2k + echo "Checking for code style violations in OpenRA.Mods.TS..." + ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Mods.TS + echo "Checking for code style violations in OpenRA.Editor..." + ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Editor + echo "Checking for code style violations in OpenRA.Renderer.Sdl2..." + ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Renderer.Sdl2 + echo "Checking for code style violations in OpenRA.Utility..." + ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Utility + echo "Checking for code style violations in OpenRA.Test..." + ./OpenRA.Utility.exe cnc --check-code-style OpenRA.Test + } + else + { + UtilityNotFound + } } elseif ($command -eq "docs") { - ./make.ps1 version - ./OpenRA.Utility.exe all --docs | Out-File -Encoding "UTF8" DOCUMENTATION.md - ./OpenRA.Utility.exe ra --lua-docs | Out-File -Encoding "UTF8" Lua-API.md + if (Test-Path OpenRA.Utility.exe) + { + ./make.ps1 version + ./OpenRA.Utility.exe all --docs | Out-File -Encoding "UTF8" DOCUMENTATION.md + ./OpenRA.Utility.exe ra --lua-docs | Out-File -Encoding "UTF8" Lua-API.md + } + else + { + UtilityNotFound + } } else {