cnc should run 'ralint cnc' after build, not 'ralint ra'. ralint no longer allows exceptions to escape.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
@@ -87,6 +87,6 @@
|
|||||||
<PostBuildEvent>mkdir "$(SolutionDir)mods/cnc/"
|
<PostBuildEvent>mkdir "$(SolutionDir)mods/cnc/"
|
||||||
copy "$(TargetPath)" "$(SolutionDir)mods/cnc/"
|
copy "$(TargetPath)" "$(SolutionDir)mods/cnc/"
|
||||||
cd "$(SolutionDir)"
|
cd "$(SolutionDir)"
|
||||||
ralint ra</PostBuildEvent>
|
ralint cnc</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -33,29 +33,37 @@ namespace RALint
|
|||||||
|
|
||||||
static int Main(string[] args)
|
static int Main(string[] args)
|
||||||
{
|
{
|
||||||
// bind some nonfatal error handling into FieldLoader, so we don't just *explode*.
|
try
|
||||||
Game.MissingTypeAction = s => EmitError("Missing Type: {0}".F(s));
|
|
||||||
FieldLoader.UnknownFieldAction = (s, f) => EmitError("FieldLoader: Missing field `{0}` on `{1}`".F(s, f.Name));
|
|
||||||
|
|
||||||
Game.InitializeEngineWithMods(args);
|
|
||||||
|
|
||||||
// all the @something names which actually EXIST.
|
|
||||||
var psuedoPrereqs = Rules.Info.Values.Select(a => a.Traits.GetOrDefault<BuildableInfo>()).Where(b => b != null)
|
|
||||||
.Select(b => b.AlternateName).Where(n => n != null).SelectMany(a => a).Select(a => a.ToLowerInvariant()).Distinct();
|
|
||||||
|
|
||||||
ValidPrereqs = Rules.Info.Keys.Concat(psuedoPrereqs).ToDictionary(a => a, a => 0);
|
|
||||||
|
|
||||||
foreach (var actorInfo in Rules.Info)
|
|
||||||
foreach (var traitInfo in actorInfo.Value.Traits.WithInterface<ITraitInfo>())
|
|
||||||
CheckTrait(actorInfo.Value, traitInfo);
|
|
||||||
|
|
||||||
if (errors > 0)
|
|
||||||
{
|
{
|
||||||
Console.WriteLine("Errors: {0}", errors);
|
// bind some nonfatal error handling into FieldLoader, so we don't just *explode*.
|
||||||
|
Game.MissingTypeAction = s => EmitError("Missing Type: {0}".F(s));
|
||||||
|
FieldLoader.UnknownFieldAction = (s, f) => EmitError("FieldLoader: Missing field `{0}` on `{1}`".F(s, f.Name));
|
||||||
|
|
||||||
|
Game.InitializeEngineWithMods(args);
|
||||||
|
|
||||||
|
// all the @something names which actually EXIST.
|
||||||
|
var psuedoPrereqs = Rules.Info.Values.Select(a => a.Traits.GetOrDefault<BuildableInfo>()).Where(b => b != null)
|
||||||
|
.Select(b => b.AlternateName).Where(n => n != null).SelectMany(a => a).Select(a => a.ToLowerInvariant()).Distinct();
|
||||||
|
|
||||||
|
ValidPrereqs = Rules.Info.Keys.Concat(psuedoPrereqs).ToDictionary(a => a, a => 0);
|
||||||
|
|
||||||
|
foreach (var actorInfo in Rules.Info)
|
||||||
|
foreach (var traitInfo in actorInfo.Value.Traits.WithInterface<ITraitInfo>())
|
||||||
|
CheckTrait(actorInfo.Value, traitInfo);
|
||||||
|
|
||||||
|
if (errors > 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Errors: {0}", errors);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Failed with exception: {0}".F(e));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CheckTrait(ActorInfo actorInfo, ITraitInfo traitInfo)
|
static void CheckTrait(ActorInfo actorInfo, ITraitInfo traitInfo)
|
||||||
|
|||||||
Reference in New Issue
Block a user