Remove obsolete --check-runtime-assemblies utility command.

This commit is contained in:
Paul Chote
2020-12-28 21:46:29 +00:00
committed by abcdefg30
parent 0984de6bea
commit 868736fe1a
2 changed files with 0 additions and 73 deletions

View File

@@ -25,18 +25,6 @@
# make help
#
############################## TOOLCHAIN ###############################
#
# List of .NET assemblies that we can guarantee exist
WHITELISTED_OPENRA_ASSEMBLIES = OpenRA.dll OpenRA.Utility.dll OpenRA.Server.dll OpenRA.Platforms.Default.dll OpenRA.Game.dll OpenRA.Mods.Common.dll OpenRA.Mods.Cnc.dll OpenRA.Mods.D2k.dll
# These are explicitly shipped alongside our core files by the packaging script
WHITELISTED_THIRDPARTY_ASSEMBLIES = ICSharpCode.SharpZipLib.dll FuzzyLogicLibrary.dll Eluant.dll BeaconLib.dll Open.Nat.dll SDL2-CS.dll OpenAL-CS.Core.dll DiscordRPC.dll Newtonsoft.Json.dll
# These are shipped in our custom minimal mono runtime and also available in the full system-installed .NET/mono stack
# This list *must* be kept in sync with the files packaged by the AppImageSupport and OpenRALauncherOSX repositories
WHITELISTED_CORE_ASSEMBLIES = mscorlib.dll System.dll System.Configuration.dll System.Core.dll System.Numerics.dll System.Security.dll System.Xml.dll Mono.Security.dll netstandard.dll Microsoft.Win32.Registry.dll System.Security.AccessControl.dll System.Security.Principal.Windows.dll System.Xml.Linq.dll System.Runtime.Serialization.dll
######################### UTILITIES/SETTINGS ###########################
#
# Install locations for local installs and downstream packaging
@@ -100,9 +88,6 @@ check:
@echo "Compiling in debug mode..."
@$(MSBUILD) -t:build -restore -p:Configuration=Debug -p:TargetPlatform=$(TARGETPLATFORM) -p:Mono=true -p:DefineConstants="MONO"
@echo
@echo "Checking runtime assemblies..."
@$(OPENRA_UTILITY) all --check-runtime-assemblies $(WHITELISTED_OPENRA_ASSEMBLIES) $(WHITELISTED_THIRDPARTY_ASSEMBLIES) $(WHITELISTED_CORE_ASSEMBLIES)
@echo
@echo "Checking for explicit interface violations..."
@$(OPENRA_UTILITY) all --check-explicit-interfaces
@echo

View File

@@ -1,58 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
namespace OpenRA.Mods.Common.UtilityCommands
{
public class CheckRuntimeAssembliesCommand : IUtilityCommand
{
string IUtilityCommand.Name { get { return "--check-runtime-assemblies"; } }
bool IUtilityCommand.ValidateArguments(string[] args)
{
return true;
}
[Desc("ASSEMBLY [ASSEMBLY ...]", "Check the runtime dependencies of the mod against a given whitelist of " +
"assembly (dll and exe) names and generate an error if any unlisted files are required.")]
void IUtilityCommand.Run(Utility utility, string[] args)
{
var whitelist = args
.Skip(1)
.Select(a => Path.GetFileName(a))
.ToArray();
// Load the renderer assembly so we can check its dependencies
Assembly.LoadFile(Path.Combine(Platform.BinDir, "OpenRA.Platforms.Default.dll"));
var missing = new List<string>();
foreach (var a in AppDomain.CurrentDomain.GetAssemblies())
{
var assemblyName = Path.GetFileName(a.Location);
if (!whitelist.Contains(assemblyName))
missing.Add(assemblyName);
}
if (missing.Any())
{
Console.WriteLine("error: The following assemblies are referenced but not whitelisted:");
foreach (var m in missing)
Console.WriteLine(" " + m);
Environment.Exit(1);
}
}
}
}