diff --git a/Makefile b/Makefile
index 384e550d12..b4941623c4 100644
--- a/Makefile
+++ b/Makefile
@@ -67,7 +67,7 @@ INSTALL_PROGRAM = $(INSTALL) -m755
INSTALL_DATA = $(INSTALL) -m644
# program targets
-CORE = rsdl2 rnull game utility ralint
+CORE = rsdl2 rnull game utility
TOOLS = editor tsbuild crashdialog
VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`)
@@ -112,7 +112,7 @@ mod_common: $(mod_common_TARGET)
##### Official Mods #####
STD_MOD_LIBS = $(game_TARGET)
-STD_MOD_DEPS = $(STD_MOD_LIBS) $(ralint_TARGET)
+STD_MOD_DEPS = $(STD_MOD_LIBS)
# Red Alert
mod_ra_SRCS := $(shell find OpenRA.Mods.RA/ -iname '*.cs')
@@ -168,24 +168,15 @@ OpenRA.Editor.Form1.resources:
resgen2 OpenRA.Editor/Form1.resx OpenRA.Editor.Form1.resources 1> /dev/null
editor: OpenRA.Editor.MapSelect.resources OpenRA.Editor.Form1.resources $(editor_TARGET)
-# Analyses mod yaml for easy to detect errors
-ralint_SRCS := $(shell find OpenRA.Lint/ -iname '*.cs')
-ralint_TARGET = OpenRA.Lint.exe
-ralint_KIND = exe
-ralint_DEPS = $(game_TARGET)
-ralint_LIBS = $(COMMON_LIBS) $(ralint_DEPS)
-PROGRAMS += ralint
-ralint: $(ralint_TARGET)
-
test:
- @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
+ @echo "Testing Red Alert mod MiniYAML..."
+ @mono --debug OpenRA.Utility.exe ra --check-yaml
+ @echo "Testing Tiberian Dawn mod MiniYAML..."
+ @mono --debug OpenRA.Utility.exe cnc --check-yaml
+ @echo "Testing Dune 2000 mod MiniYAML..."
+ @mono --debug OpenRA.Utility.exe d2k --check-yaml
+ @echo "Testing Tiberian Sun mod MiniYAML..."
+ @mono --debug OpenRA.Utility.exe ts --check-yaml
# Builds and exports tilesets from a bitmap
tsbuild_SRCS := $(shell find OpenRA.TilesetBuilder/ -iname '*.cs')
@@ -254,7 +245,7 @@ $(foreach prog,$(PROGRAMS),$(eval $(call BUILD_ASSEMBLY,$(prog))))
#
default: cli-dependencies core
-core: game renderers mods utility ralint
+core: game renderers mods utility
tools: editor tsbuild gamemonitor
diff --git a/OpenRA.Lint/OpenRA.Lint.csproj b/OpenRA.Lint/OpenRA.Lint.csproj
deleted file mode 100644
index f5aef68227..0000000000
--- a/OpenRA.Lint/OpenRA.Lint.csproj
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
- Debug
- AnyCPU
- {F9FA4D9F-2302-470A-8A07-6E37F488C124}
- Exe
- Properties
- OpenRA
- OpenRA.Lint
- 512
-
-
- 3.5
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- ..\
- DEBUG;TRACE
- prompt
- x86
- false
- AllRules.ruleset
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {0DFB103F-2962-400F-8C6D-E2C28CCBA633}
- OpenRA.Game
- False
-
-
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
-
\ No newline at end of file
diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
index 9526687c40..8cefe7899b 100644
--- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
+++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
@@ -243,6 +243,7 @@
+
diff --git a/OpenRA.Lint/YamlChecker.cs b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs
similarity index 66%
rename from OpenRA.Lint/YamlChecker.cs
rename to OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs
index c8686378bb..d9f1deea25 100644
--- a/OpenRA.Lint/YamlChecker.cs
+++ b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs
@@ -14,52 +14,43 @@ using System.Linq;
using OpenRA.FileSystem;
using OpenRA.Traits;
-namespace OpenRA.Lint
+namespace OpenRA.Mods.Common.UtilityCommands
{
- static class YamlChecker
+ class CheckYaml : IUtilityCommand
{
+ public string Name { get { return "--check-yaml"; } }
+
static int errors = 0;
// mimic Windows compiler error format
static void EmitError(string e)
{
- Console.WriteLine("OpenRA.Lint(1,1): Error: {0}", e);
+ Console.WriteLine("OpenRA.Utility(1,1): Error: {0}", e);
++errors;
}
static void EmitWarning(string e)
{
- Console.WriteLine("OpenRA.Lint(1,1): Warning: {0}", e);
+ Console.WriteLine("OpenRA.Utility(1,1): Warning: {0}", e);
}
- static int Main(string[] args)
+ [Desc("[MAPFILE]", "Check a mod or map for certain yaml errors.")]
+ public void Run(ModData modData, string[] args)
{
- if (args.Length == 0)
- {
- Console.WriteLine("Usage: OpenRA.Lint.exe MOD [MAP] [--verbose]");
- return 0;
- }
+ // HACK: The engine code assumes that Game.modData is set.
+ Game.modData = modData;
try
{
Log.AddChannel("debug", null);
Log.AddChannel("perf", null);
- 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*.
ObjectCreator.MissingTypeAction = s => EmitError("Missing Type: {0}".F(s));
FieldLoader.UnknownFieldAction = (s, f) => EmitError("FieldLoader: Missing field `{0}` on `{1}`".F(s, f.Name));
- AppDomain.CurrentDomain.AssemblyResolve += GlobalFileSystem.ResolveAssembly;
- Game.InitializeSettings(Arguments.Empty);
- Game.modData = new ModData(mod);
-
IEnumerable