From 60f6a07014a126883eb88c69c676c97c2cf1a6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 5 Dec 2013 19:58:48 +0100 Subject: [PATCH 1/4] verbose RALint for make test --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index aec7f8ba0c..0fec946245 100644 --- a/Makefile +++ b/Makefile @@ -219,14 +219,14 @@ PROGRAMS += ralint ralint: $(ralint_TARGET) test: - @mono --debug OpenRA.Lint.exe ra - @echo "OpenRA.Lint: ra mod yaml checks passed." - @mono --debug OpenRA.Lint.exe cnc - @echo "OpenRA.Lint: cnc mod yaml checks passed." - @mono --debug OpenRA.Lint.exe d2k - @echo "OpenRA.Lint: d2k mod yaml checks passed." - @mono --debug OpenRA.Lint.exe ts - @echo "OpenRA.Lint: ts mod yaml checks passed." + @echo "OpenRA.Lint: checking Red Alert mod MiniYAML..." + @mono --debug OpenRA.Lint.exe --verbose ra + @echo "OpenRA.Lint: checking Tiberian Dawn mod MiniYAML..." + @mono --debug OpenRA.Lint.exe --verbose cnc + @echo "OpenRA.Lint: checking Dune 2000 mod MiniYAML..." + @mono --debug OpenRA.Lint.exe --verbose d2k + @echo "OpenRA.Lint: checking Tiberian Sun mod MiniYAML..." + @mono --debug OpenRA.Lint.exe --verbose ts # Builds and exports tilesets from a bitmap tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs') From e05e17c22eaf361acb52db438ff547daeba8dd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 5 Dec 2013 20:31:52 +0100 Subject: [PATCH 2/4] optionally lint check a mod + map.yaml closes #3850 --- OpenRA.Lint/YamlChecker.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Lint/YamlChecker.cs b/OpenRA.Lint/YamlChecker.cs index f917921793..946ed8cff5 100644 --- a/OpenRA.Lint/YamlChecker.cs +++ b/OpenRA.Lint/YamlChecker.cs @@ -36,7 +36,7 @@ namespace OpenRA.Lint { var options = args.Where(a => a.StartsWith("-")); var mod = args.Where(a => !options.Contains(a)).First(); - + var map = args.Where(a => !options.Contains(a)).Skip(1).FirstOrDefault(); var verbose = options.Contains("-v") || options.Contains("--verbose"); // bind some nonfatal error handling into FieldLoader, so we don't just *explode*. @@ -45,7 +45,11 @@ namespace OpenRA.Lint AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly; Game.modData = new ModData(mod); - Rules.LoadRules(Game.modData.Manifest, new Map()); + + var testMap = string.IsNullOrEmpty(map) ? new Map() : new Map(map); + if (verbose && !string.IsNullOrEmpty(map)) + Console.WriteLine("Map: {0}".F(testMap.Title)); + Rules.LoadRules(Game.modData.Manifest, testMap); foreach (var customPassType in Game.modData.ObjectCreator .GetTypesImplementing()) From 16edd98300e8151a3d7a29772ad5988ea308aec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 5 Dec 2013 20:32:15 +0100 Subject: [PATCH 3/4] self-document it --- OpenRA.Lint/YamlChecker.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Lint/YamlChecker.cs b/OpenRA.Lint/YamlChecker.cs index 946ed8cff5..9481491345 100644 --- a/OpenRA.Lint/YamlChecker.cs +++ b/OpenRA.Lint/YamlChecker.cs @@ -32,6 +32,12 @@ namespace OpenRA.Lint static int Main(string[] args) { + if (args.Length == 0) + { + Console.WriteLine("Usage: OpenRA.Lint.exe MOD [MAP] [--verbose]"); + return 0; + } + try { var options = args.Where(a => a.StartsWith("-")); From e65cfe00c1e70f9b3b254fe49f83ee8da45e8823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 6 Dec 2013 11:07:56 +0100 Subject: [PATCH 4/4] update CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 7d6b8c7976..4c27d382eb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -98,6 +98,7 @@ NEW: Fixed 'make docs' crashing when the game assets are not installed. Renamed Game.Mods launch argument to Game.Mod. Linux packages now install to /usr/lib/openra for consistency with other Mono applications. + Added an optional map.yaml check to the OpenRA.Lint.exe command line tool. Mod / Custom map compatibility: Mods can now include traits from TD and D2K in RA. Mods can now customize UI text settings like font type/color/contrast for most widgets and set global defaults in metrics.yaml.