xamarin-macios/tools/common/Assembly.cs

863 строки
28 KiB
C#
Исходник Обычный вид История

2016-04-21 15:57:02 +03:00
using System;
using System.Collections;
2016-04-21 15:57:02 +03:00
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Xml;
2016-04-21 15:57:02 +03:00
using Mono.Cecil;
using Mono.Tuner;
2016-04-21 15:57:02 +03:00
using MonoTouch.Tuner;
using ObjCRuntime;
using Xamarin;
using Xamarin.Utils;
2016-04-21 15:57:02 +03:00
namespace Xamarin.Bundler {
struct NativeReferenceMetadata
{
public bool ForceLoad;
public string Frameworks;
public string WeakFrameworks;
public string LibraryName;
public string LinkerFlags;
public LinkTarget LinkTarget;
public bool NeedsGccExceptionHandling;
public bool IsCxx;
public bool SmartLink;
public DlsymOption Dlsym;
// Optional
public LinkWithAttribute Attribute;
public NativeReferenceMetadata (LinkWithAttribute attribute)
{
ForceLoad = attribute.ForceLoad;
Frameworks = attribute.Frameworks;
WeakFrameworks = attribute.WeakFrameworks;
LibraryName = attribute.LibraryName;
LinkerFlags = attribute.LinkerFlags;
LinkTarget = attribute.LinkTarget;
NeedsGccExceptionHandling = attribute.NeedsGccExceptionHandling;
IsCxx = attribute.IsCxx;
SmartLink = attribute.SmartLink;
Dlsym = attribute.Dlsym;
Attribute = attribute;
}
}
2016-04-21 15:57:02 +03:00
public partial class Assembly
{
public AssemblyBuildTarget BuildTarget;
public string BuildTargetName;
public bool IsCodeShared;
public List<string> Satellites;
2016-04-21 15:57:02 +03:00
public Application App { get { return Target.App; } }
string full_path;
bool? is_framework_assembly;
public AssemblyDefinition AssemblyDefinition;
public Target Target;
public bool? IsFrameworkAssembly { get { return is_framework_assembly; } }
2016-04-21 15:57:02 +03:00
public string FullPath {
get {
return full_path;
}
set {
full_path = value;
if (!is_framework_assembly.HasValue && !string.IsNullOrEmpty (full_path)) {
#if NET
[dotnet] Define and implement a 'framework' or 'sdk' assembly as an assembly that comes from the .NET BCL NuGet. (#9571) The Assembly.IsFrameworkAssembly property is used in two places: * In Driver.IsBoundAssembly to return early when determining if an assembly has any NSObject subclasses: https://github.com/xamarin/xamarin-macios/blob/c1c5b9aac67461122a3b66334876ed9aeb4cd63c/tools/mtouch/mtouch.cs#L1155-L1168 * In Assembly.ExtractNativeLinkInfo to return early when looking for assemblies with LinkWith attributes: https://github.com/xamarin/xamarin-macios/blob/c1c5b9aac67461122a3b66334876ed9aeb4cd63c/tools/common/Assembly.cs#L150-L154 In both cases this definition of framework assembly works today and seems likely to work in the future as well. I also went through and looked at all the usages of Profile.IsSdkAssembly, and it's used to: * Decide which assemblies are selected for "link sdk" * Decide which assemblies are considered an 'sdk' assembly for creating a user framework of all the sdk assemblies * Bail out early when deciding whether: * An assembly references the product assembly (Xamarin.iOS.dll, etc.) * An assembly can contain references to UIWebView * An assembly can contain user resources * An assembly is a binding project / has third-party native resources * An assembly needs the dynamic registrar * An assembly has FieldAttributes whose native fields must be preserved by the native linker In all cases our .NET definition of 'SDK' seems to work both for now and in the future. There are also a few usages which does not apply to .NET, so I've ignored them: * When looking for a few BCL APIs that must be preserved (MobileApplyPreserveAttribute.cs): this is to be done in the upstream .NET linker now, so it doesn't apply to our own code * When linking away parameter names (MonoTouchMarkStep.cs): this is to be done in the upstream .NET linker now, so it doesn't apply to our own code
2020-09-07 19:33:53 +03:00
is_framework_assembly = Target.App.Configuration.FrameworkAssemblies.Contains (GetIdentity (full_path));
#else
[dotnet] Define and implement a 'framework' or 'sdk' assembly as an assembly that comes from the .NET BCL NuGet. (#9571) The Assembly.IsFrameworkAssembly property is used in two places: * In Driver.IsBoundAssembly to return early when determining if an assembly has any NSObject subclasses: https://github.com/xamarin/xamarin-macios/blob/c1c5b9aac67461122a3b66334876ed9aeb4cd63c/tools/mtouch/mtouch.cs#L1155-L1168 * In Assembly.ExtractNativeLinkInfo to return early when looking for assemblies with LinkWith attributes: https://github.com/xamarin/xamarin-macios/blob/c1c5b9aac67461122a3b66334876ed9aeb4cd63c/tools/common/Assembly.cs#L150-L154 In both cases this definition of framework assembly works today and seems likely to work in the future as well. I also went through and looked at all the usages of Profile.IsSdkAssembly, and it's used to: * Decide which assemblies are selected for "link sdk" * Decide which assemblies are considered an 'sdk' assembly for creating a user framework of all the sdk assemblies * Bail out early when deciding whether: * An assembly references the product assembly (Xamarin.iOS.dll, etc.) * An assembly can contain references to UIWebView * An assembly can contain user resources * An assembly is a binding project / has third-party native resources * An assembly needs the dynamic registrar * An assembly has FieldAttributes whose native fields must be preserved by the native linker In all cases our .NET definition of 'SDK' seems to work both for now and in the future. There are also a few usages which does not apply to .NET, so I've ignored them: * When looking for a few BCL APIs that must be preserved (MobileApplyPreserveAttribute.cs): this is to be done in the upstream .NET linker now, so it doesn't apply to our own code * When linking away parameter names (MonoTouchMarkStep.cs): this is to be done in the upstream .NET linker now, so it doesn't apply to our own code
2020-09-07 19:33:53 +03:00
var real_full_path = Target.GetRealPath (full_path);
is_framework_assembly = real_full_path.StartsWith (Path.GetDirectoryName (Path.GetDirectoryName (Target.Resolver.FrameworkDirectory)), StringComparison.Ordinal);
#endif
}
2016-04-21 15:57:02 +03:00
}
}
public string FileName { get { return Path.GetFileName (FullPath); } }
public string Identity { get { return GetIdentity (AssemblyDefinition); } }
public static string GetIdentity (AssemblyDefinition ad)
{
if (!string.IsNullOrEmpty (ad.MainModule.FileName))
return Path.GetFileNameWithoutExtension (ad.MainModule.FileName);
return ad.Name.Name;
}
public static string GetIdentity (string path)
{
return Path.GetFileNameWithoutExtension (path);
}
2016-04-21 15:57:02 +03:00
public bool EnableCxx;
public bool NeedsGccExceptionHandling;
public bool ForceLoad;
public HashSet<string> Frameworks = new HashSet<string> ();
public HashSet<string> WeakFrameworks = new HashSet<string> ();
public List<string> LinkerFlags = new List<string> (); // list of extra linker flags
[mtouch] Make sure native symbols from third-party libraries are preserved in dylibs. Fixes #51548. The native linker treats object files (.o) and static libraries (.a files, which are archives of .o files) differently. The native linker will always include object files into the executable: $ echo "void xxx () {}" > foo.m $ clang -c foo.m -o foo.o -arch x86_64 $ ld foo.o -dylib -o foo.dylib -macosx_version_min 10.12 -arch x86_64 $ nm foo.dylib 0000000000000fe0 T _xxx However, if the object file is inside a static library: $ echo "void xxx () {}" > foo.m $ clang -c foo.m -o foo.o -arch x86_64 $ ar cru foo.a foo.o $ ld foo.a -dylib -o foo.dylib -macosx_version_min 10.12 -arch x86_64 $ nm foo.dylib <no output> This means that our testing library (libtest.a) which is a fat library of _object files_, do not show the problems reported in bug #51548. So: a) I've fixed the creation of libtest.a to be a fat library of _static libraries_. This causes the `FastDev_LinkWithTest` test to fail exactly like in bug #51548. b) I've made mtouch pass `-u <native symbol>` to the native linker, for every native symbol referenced in a managed assembly, when creating a dylib. Amazingly this seems to work fine even with symbols to Objective-C classes (`_OBJC_CLASS_$_<class name>`). c) This also required adding support for collecting the Objective-C names of all managed types registered with Objective-C to the linker. The information is already available in the static registrar, but that would require us to make sure the static registrar is executed before compiling dylibs, which means those two tasks won't be able to run in parallel (also there's no guarantee we'll even run the static registrar). https://bugzilla.xamarin.com/show_bug.cgi?id=51548
2017-01-18 12:25:58 +03:00
public List<string> LinkWith = new List<string> (); // list of paths to native libraries to link with, from LinkWith attributes
2016-04-21 15:57:02 +03:00
public HashSet<ModuleReference> UnresolvedModuleReferences;
[mtouch] Make sure native symbols from third-party libraries are preserved in dylibs. Fixes #51548. The native linker treats object files (.o) and static libraries (.a files, which are archives of .o files) differently. The native linker will always include object files into the executable: $ echo "void xxx () {}" > foo.m $ clang -c foo.m -o foo.o -arch x86_64 $ ld foo.o -dylib -o foo.dylib -macosx_version_min 10.12 -arch x86_64 $ nm foo.dylib 0000000000000fe0 T _xxx However, if the object file is inside a static library: $ echo "void xxx () {}" > foo.m $ clang -c foo.m -o foo.o -arch x86_64 $ ar cru foo.a foo.o $ ld foo.a -dylib -o foo.dylib -macosx_version_min 10.12 -arch x86_64 $ nm foo.dylib <no output> This means that our testing library (libtest.a) which is a fat library of _object files_, do not show the problems reported in bug #51548. So: a) I've fixed the creation of libtest.a to be a fat library of _static libraries_. This causes the `FastDev_LinkWithTest` test to fail exactly like in bug #51548. b) I've made mtouch pass `-u <native symbol>` to the native linker, for every native symbol referenced in a managed assembly, when creating a dylib. Amazingly this seems to work fine even with symbols to Objective-C classes (`_OBJC_CLASS_$_<class name>`). c) This also required adding support for collecting the Objective-C names of all managed types registered with Objective-C to the linker. The information is already available in the static registrar, but that would require us to make sure the static registrar is executed before compiling dylibs, which means those two tasks won't be able to run in parallel (also there's no guarantee we'll even run the static registrar). https://bugzilla.xamarin.com/show_bug.cgi?id=51548
2017-01-18 12:25:58 +03:00
public bool HasLinkWithAttributes { get; private set; }
2016-04-21 15:57:02 +03:00
bool? symbols_loaded;
List<string> link_with_resources; // a list of resources that must be removed from the app
public Assembly (Target target, string path)
{
this.Target = target;
this.FullPath = path;
}
public Assembly (Target target, AssemblyDefinition definition)
{
this.Target = target;
this.AssemblyDefinition = definition;
this.FullPath = definition.MainModule.FileName;
2016-04-21 15:57:02 +03:00
}
public bool HasValidSymbols {
get {
return AssemblyDefinition.MainModule.HasSymbols;
}
}
2016-04-21 15:57:02 +03:00
public void LoadSymbols ()
{
if (symbols_loaded.HasValue)
return;
symbols_loaded = false;
try {
var pdb = Path.ChangeExtension (FullPath, ".pdb");
if (File.Exists (pdb) || File.Exists (FullPath + ".mdb")) {
2016-04-21 15:57:02 +03:00
AssemblyDefinition.MainModule.ReadSymbols ();
symbols_loaded = true;
}
}
catch {
// do not let stale file crash us
Driver.Log (3, "Invalid debugging symbols for {0} ignored", FullPath);
}
}
void AddResourceToBeRemoved (string resource)
{
if (link_with_resources == null)
link_with_resources = new List<string> ();
link_with_resources.Add (resource);
}
public void ExtractNativeLinkInfo ()
{
// ignore framework assemblies, they won't have any LinkWith attributes
if (IsFrameworkAssembly == true)
2016-04-21 15:57:02 +03:00
return;
2016-04-21 15:57:02 +03:00
var assembly = AssemblyDefinition;
if (!assembly.HasCustomAttributes)
return;
string resourceBundlePath = Path.ChangeExtension (FullPath, ".resources");
string manifestPath = Path.Combine (resourceBundlePath, "manifest");
if (File.Exists (manifestPath)) {
foreach (NativeReferenceMetadata metadata in ReadManifest (manifestPath)) {
LogNativeReference (metadata);
ProcessNativeReferenceOptions (metadata);
if (metadata.LibraryName.EndsWith (".framework", StringComparison.OrdinalIgnoreCase)) {
AssertiOSVersionSupportsUserFrameworks (metadata.LibraryName);
Frameworks.Add (metadata.LibraryName);
#if MMP // HACK - MMP currently doesn't respect Frameworks on non-App - https://github.com/xamarin/xamarin-macios/issues/5203
App.Frameworks.Add (metadata.LibraryName);
#endif
} else {
#if MMP // HACK - MMP currently doesn't respect LinkWith - https://github.com/xamarin/xamarin-macios/issues/5203
Driver.native_references.Add (metadata.LibraryName);
#endif
LinkWith.Add (metadata.LibraryName);
}
}
}
ProcessLinkWithAttributes (assembly);
// Make sure there are no duplicates between frameworks and weak frameworks.
// Keep the weak ones.
if (Frameworks != null && WeakFrameworks != null)
Frameworks.ExceptWith (WeakFrameworks);
if (NeedsGccExceptionHandling) {
if (LinkerFlags == null)
LinkerFlags = new List<string> ();
LinkerFlags.Add ("-lgcc_eh");
}
}
IEnumerable <NativeReferenceMetadata> ReadManifest (string manifestPath)
{
XmlDocument document = new XmlDocument ();
document.LoadWithoutNetworkAccess (manifestPath);
foreach (XmlNode referenceNode in document.GetElementsByTagName ("NativeReference")) {
NativeReferenceMetadata metadata = new NativeReferenceMetadata ();
metadata.LibraryName = Path.Combine (Path.GetDirectoryName (manifestPath), referenceNode.Attributes ["Name"].Value);
var attributes = new Dictionary<string, string> ();
foreach (XmlNode attribute in referenceNode.ChildNodes)
attributes [attribute.Name] = attribute.InnerText;
metadata.ForceLoad = ParseAttributeWithDefault (attributes ["ForceLoad"], false);
metadata.Frameworks = attributes ["Frameworks"];
metadata.WeakFrameworks = attributes ["WeakFrameworks"];
metadata.LinkerFlags = attributes ["LinkerFlags"];
metadata.NeedsGccExceptionHandling = ParseAttributeWithDefault (attributes ["NeedsGccExceptionHandling"], false);
metadata.IsCxx = ParseAttributeWithDefault (attributes ["IsCxx"], false);
metadata.SmartLink = ParseAttributeWithDefault (attributes ["SmartLink"], true);
// TODO - The project attributes do not contain these bits, is that OK?
//metadata.LinkTarget = (LinkTarget) Enum.Parse (typeof (LinkTarget), attributes ["LinkTarget"]);
//metadata.Dlsym = (DlsymOption)Enum.Parse (typeof (DlsymOption), attributes ["Dlsym"]);
yield return metadata;
}
}
static bool ParseAttributeWithDefault (string attribute, bool defaultValue) => string.IsNullOrEmpty (attribute) ? defaultValue : bool.Parse (attribute);
void ProcessLinkWithAttributes (AssemblyDefinition assembly)
{
2016-04-21 15:57:02 +03:00
//
// Tasks:
// * Remove LinkWith attribute: this is done in the linker.
// * Remove embedded resources related to LinkWith attribute from assembly: this is done at a later stage,
// here we just compile a list of resources to remove.
// * Extract embedded resources related to LinkWith attribute to a file
// * Modify the linker flags used to build/link the dylib (if fastdev) or the main binary (if !fastdev)
//
for (int i = 0; i < assembly.CustomAttributes.Count; i++) {
CustomAttribute attr = assembly.CustomAttributes [i];
2016-04-21 15:57:02 +03:00
if (attr.Constructor == null)
continue;
2016-04-21 15:57:02 +03:00
TypeReference type = attr.Constructor.DeclaringType;
if (!type.Is ("ObjCRuntime", "LinkWithAttribute"))
2016-04-21 15:57:02 +03:00
continue;
2016-04-21 15:57:02 +03:00
// Let the linker remove it the attribute from the assembly
[mtouch] Make sure native symbols from third-party libraries are preserved in dylibs. Fixes #51548. The native linker treats object files (.o) and static libraries (.a files, which are archives of .o files) differently. The native linker will always include object files into the executable: $ echo "void xxx () {}" > foo.m $ clang -c foo.m -o foo.o -arch x86_64 $ ld foo.o -dylib -o foo.dylib -macosx_version_min 10.12 -arch x86_64 $ nm foo.dylib 0000000000000fe0 T _xxx However, if the object file is inside a static library: $ echo "void xxx () {}" > foo.m $ clang -c foo.m -o foo.o -arch x86_64 $ ar cru foo.a foo.o $ ld foo.a -dylib -o foo.dylib -macosx_version_min 10.12 -arch x86_64 $ nm foo.dylib <no output> This means that our testing library (libtest.a) which is a fat library of _object files_, do not show the problems reported in bug #51548. So: a) I've fixed the creation of libtest.a to be a fat library of _static libraries_. This causes the `FastDev_LinkWithTest` test to fail exactly like in bug #51548. b) I've made mtouch pass `-u <native symbol>` to the native linker, for every native symbol referenced in a managed assembly, when creating a dylib. Amazingly this seems to work fine even with symbols to Objective-C classes (`_OBJC_CLASS_$_<class name>`). c) This also required adding support for collecting the Objective-C names of all managed types registered with Objective-C to the linker. The information is already available in the static registrar, but that would require us to make sure the static registrar is executed before compiling dylibs, which means those two tasks won't be able to run in parallel (also there's no guarantee we'll even run the static registrar). https://bugzilla.xamarin.com/show_bug.cgi?id=51548
2017-01-18 12:25:58 +03:00
HasLinkWithAttributes = true;
2016-04-21 15:57:02 +03:00
LinkWithAttribute linkWith = GetLinkWithAttribute (attr);
NativeReferenceMetadata metadata = new NativeReferenceMetadata (linkWith);
// If we've already processed this native library, skip it
if (LinkWith.Any (x => Path.GetFileName (x) == metadata.LibraryName) || Frameworks.Any (x => Path.GetFileName (x) == metadata.LibraryName))
continue;
2016-04-21 15:57:02 +03:00
// Remove the resource from the assembly at a later stage.
if (!string.IsNullOrEmpty (metadata.LibraryName))
AddResourceToBeRemoved (metadata.LibraryName);
ProcessNativeReferenceOptions (metadata);
if (!string.IsNullOrEmpty (linkWith.LibraryName)) {
if (linkWith.LibraryName.EndsWith (".framework", StringComparison.OrdinalIgnoreCase)) {
AssertiOSVersionSupportsUserFrameworks (linkWith.LibraryName);
Frameworks.Add (ExtractFramework (assembly, metadata));
} else {
LinkWith.Add (ExtractNativeLibrary (assembly, metadata));
2016-04-21 15:57:02 +03:00
}
}
}
}
2016-04-21 15:57:02 +03:00
void AssertiOSVersionSupportsUserFrameworks (string path)
{
if (App.Platform == ApplePlatform.iOS && App.DeploymentTarget.Major < 8) {
2020-01-31 23:02:52 +03:00
throw ErrorHelper.CreateError (1305, Errors.MT1305,
FileName, Path.GetFileName (path), App.DeploymentTarget);
}
}
void ProcessNativeReferenceOptions (NativeReferenceMetadata metadata)
{
// We can't add -dead_strip if there are any LinkWith attributes where smart linking is disabled.
if (!metadata.SmartLink)
App.DeadStrip = false;
// Don't add -force_load if the binding's SmartLink value is set and the static registrar is being used.
if (metadata.ForceLoad && !(metadata.SmartLink && App.Registrar == RegistrarMode.Static))
ForceLoad = true;
if (!string.IsNullOrEmpty (metadata.LinkerFlags)) {
if (LinkerFlags == null)
LinkerFlags = new List<string> ();
Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. (#7177) * Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. mono changed how quotes should be escaped when passed to System.Diagnostic.Process, so we need to change accordingly. The main difference is that single quotes don't have to be escaped anymore. This solves problems like this: System.ComponentModel.Win32Exception : ApplicationName='nuget', CommandLine='restore '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable/CellCustomTable.sln' -Verbosity detailed -SolutionDir '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable'', CurrentDirectory='/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories', Native error= Cannot find the specified file at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-08/external/bockbuild/builds/mono-x64/mcs/class/System/System.Diagnostics/Process.cs:778 ref: https://github.com/mono/mono/pull/15047 * Rework process arguments to pass arrays/lists around instead of quoted strings. And then only convert to a string at the very end when we create the Process instance. In the future there will be a ProcessStartInfo.ArgumentList property we can use to give the original array/list of arguments directly to the BCL so that we can avoid quoting at all. These changes gets us almost all the way there already (except that the ArgumentList property isn't available quite yet). We also have to bump to target framework version v4.7.2 from v4.5 in several places because of 'Array.Empty<T> ()' which is now used in more places. * Parse linker flags from LinkWith attributes. * [sampletester] Bump to v4.7.2 for Array.Empty<T> (). * Fix typo. * Rename GetVerbosity -> AddVerbosity. * Remove unnecessary string interpolation. * Remove unused variable. * [mtouch] Simplify code a bit. * Use implicitly typed arrays.
2019-10-14 17:18:46 +03:00
if (!StringUtils.TryParseArguments (metadata.LinkerFlags, out string [] args, out var ex))
2020-01-31 23:02:52 +03:00
throw ErrorHelper.CreateError (148, ex, Errors.MX0148, metadata.LinkerFlags, metadata.LibraryName, FileName, ex.Message);
Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. (#7177) * Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. mono changed how quotes should be escaped when passed to System.Diagnostic.Process, so we need to change accordingly. The main difference is that single quotes don't have to be escaped anymore. This solves problems like this: System.ComponentModel.Win32Exception : ApplicationName='nuget', CommandLine='restore '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable/CellCustomTable.sln' -Verbosity detailed -SolutionDir '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable'', CurrentDirectory='/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories', Native error= Cannot find the specified file at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-08/external/bockbuild/builds/mono-x64/mcs/class/System/System.Diagnostics/Process.cs:778 ref: https://github.com/mono/mono/pull/15047 * Rework process arguments to pass arrays/lists around instead of quoted strings. And then only convert to a string at the very end when we create the Process instance. In the future there will be a ProcessStartInfo.ArgumentList property we can use to give the original array/list of arguments directly to the BCL so that we can avoid quoting at all. These changes gets us almost all the way there already (except that the ArgumentList property isn't available quite yet). We also have to bump to target framework version v4.7.2 from v4.5 in several places because of 'Array.Empty<T> ()' which is now used in more places. * Parse linker flags from LinkWith attributes. * [sampletester] Bump to v4.7.2 for Array.Empty<T> (). * Fix typo. * Rename GetVerbosity -> AddVerbosity. * Remove unnecessary string interpolation. * Remove unused variable. * [mtouch] Simplify code a bit. * Use implicitly typed arrays.
2019-10-14 17:18:46 +03:00
LinkerFlags.AddRange (args);
}
if (!string.IsNullOrEmpty (metadata.Frameworks)) {
foreach (var f in metadata.Frameworks.Split (new char [] { ' ' })) {
if (Frameworks == null)
Frameworks = new HashSet<string> ();
Frameworks.Add (f);
}
}
if (!string.IsNullOrEmpty (metadata.WeakFrameworks)) {
foreach (var f in metadata.WeakFrameworks.Split (new char [] { ' ' })) {
if (WeakFrameworks == null)
WeakFrameworks = new HashSet<string> ();
WeakFrameworks.Add (f);
}
}
if (metadata.NeedsGccExceptionHandling)
NeedsGccExceptionHandling = true;
if (metadata.IsCxx)
EnableCxx = true;
2016-04-21 15:57:02 +03:00
#if MONOTOUCH
if (metadata.Dlsym != DlsymOption.Default)
App.SetDlsymOption (FullPath, metadata.Dlsym == DlsymOption.Required);
#endif
}
string ExtractNativeLibrary (AssemblyDefinition assembly, NativeReferenceMetadata metadata)
{
string path = Path.Combine (App.Cache.Location, metadata.LibraryName);
if (!Application.IsUptodate (FullPath, path)) {
Application.ExtractResource (assembly.MainModule, metadata.LibraryName, path, false);
Driver.Log (3, "Extracted third-party binding '{0}' from '{1}' to '{2}'", metadata.LibraryName, FullPath, path);
LogNativeReference (metadata);
} else {
Driver.Log (3, "Target '{0}' is up-to-date.", path);
2016-04-21 15:57:02 +03:00
}
if (!File.Exists (path))
2020-01-31 23:02:52 +03:00
ErrorHelper.Warning (1302, Errors.MT1302, metadata.LibraryName, path);
2016-04-21 15:57:02 +03:00
return path;
}
2016-04-21 15:57:02 +03:00
string ExtractFramework (AssemblyDefinition assembly, NativeReferenceMetadata metadata)
{
string path = Path.Combine (App.Cache.Location, metadata.LibraryName);
var zipPath = path + ".zip";
if (!Application.IsUptodate (FullPath, zipPath)) {
Application.ExtractResource (assembly.MainModule, metadata.LibraryName, zipPath, false);
Driver.Log (3, "Extracted third-party framework '{0}' from '{1}' to '{2}'", metadata.LibraryName, FullPath, zipPath);
LogNativeReference (metadata);
} else {
Driver.Log (3, "Target '{0}' is up-to-date.", path);
}
if (!File.Exists (zipPath)) {
2020-01-31 23:02:52 +03:00
ErrorHelper.Warning (1302, Errors.MT1302, metadata.LibraryName, zipPath);
} else {
if (!Directory.Exists (path))
Directory.CreateDirectory (path);
Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. (#7177) * Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. mono changed how quotes should be escaped when passed to System.Diagnostic.Process, so we need to change accordingly. The main difference is that single quotes don't have to be escaped anymore. This solves problems like this: System.ComponentModel.Win32Exception : ApplicationName='nuget', CommandLine='restore '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable/CellCustomTable.sln' -Verbosity detailed -SolutionDir '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable'', CurrentDirectory='/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories', Native error= Cannot find the specified file at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-08/external/bockbuild/builds/mono-x64/mcs/class/System/System.Diagnostics/Process.cs:778 ref: https://github.com/mono/mono/pull/15047 * Rework process arguments to pass arrays/lists around instead of quoted strings. And then only convert to a string at the very end when we create the Process instance. In the future there will be a ProcessStartInfo.ArgumentList property we can use to give the original array/list of arguments directly to the BCL so that we can avoid quoting at all. These changes gets us almost all the way there already (except that the ArgumentList property isn't available quite yet). We also have to bump to target framework version v4.7.2 from v4.5 in several places because of 'Array.Empty<T> ()' which is now used in more places. * Parse linker flags from LinkWith attributes. * [sampletester] Bump to v4.7.2 for Array.Empty<T> (). * Fix typo. * Rename GetVerbosity -> AddVerbosity. * Remove unnecessary string interpolation. * Remove unused variable. * [mtouch] Simplify code a bit. * Use implicitly typed arrays.
2019-10-14 17:18:46 +03:00
if (Driver.RunCommand ("/usr/bin/unzip", "-u", "-o", "-d", path, zipPath) != 0)
2020-01-31 23:02:52 +03:00
throw ErrorHelper.CreateError (1303, Errors.MT1303, metadata.LibraryName, zipPath);
2016-04-21 15:57:02 +03:00
}
return path;
2016-04-21 15:57:02 +03:00
}
static void LogNativeReference (NativeReferenceMetadata metadata)
{
Driver.Log (3, " LibraryName: {0}", metadata.LibraryName);
Driver.Log (3, " From: {0}", metadata.Attribute != null ? "LinkWith" : "Binding Manifest");
Driver.Log (3, " ForceLoad: {0}", metadata.ForceLoad);
Driver.Log (3, " Frameworks: {0}", metadata.Frameworks);
Driver.Log (3, " IsCxx: {0}", metadata.IsCxx);
Driver.Log (3, " LinkerFlags: {0}", metadata.LinkerFlags);
Driver.Log (3, " LinkTarget: {0}", metadata.LinkTarget);
Driver.Log (3, " NeedsGccExceptionHandling: {0}", metadata.NeedsGccExceptionHandling);
Driver.Log (3, " SmartLink: {0}", metadata.SmartLink);
Driver.Log (3, " WeakFrameworks: {0}", metadata.WeakFrameworks);
}
2016-04-21 15:57:02 +03:00
public static LinkWithAttribute GetLinkWithAttribute (CustomAttribute attr)
{
LinkWithAttribute linkWith;
var cargs = attr.ConstructorArguments;
switch (cargs.Count) {
case 3:
linkWith = new LinkWithAttribute ((string) cargs [0].Value, (LinkTarget) cargs [1].Value, (string) cargs [2].Value);
break;
case 2:
linkWith = new LinkWithAttribute ((string) cargs [0].Value, (LinkTarget) cargs [1].Value);
break;
case 0:
linkWith = new LinkWithAttribute ();
break;
2016-04-21 15:57:02 +03:00
default:
case 1:
linkWith = new LinkWithAttribute ((string) cargs [0].Value);
break;
}
foreach (var property in attr.Properties) {
switch (property.Name) {
case "NeedsGccExceptionHandling":
linkWith.NeedsGccExceptionHandling = (bool) property.Argument.Value;
break;
case "WeakFrameworks":
linkWith.WeakFrameworks = (string) property.Argument.Value;
break;
case "Frameworks":
linkWith.Frameworks = (string) property.Argument.Value;
break;
case "LinkerFlags":
linkWith.LinkerFlags = (string) property.Argument.Value;
break;
case "LinkTarget":
linkWith.LinkTarget = (LinkTarget) property.Argument.Value;
break;
case "ForceLoad":
linkWith.ForceLoad = (bool) property.Argument.Value;
break;
case "IsCxx":
linkWith.IsCxx = (bool) property.Argument.Value;
break;
case "SmartLink":
linkWith.SmartLink = (bool) property.Argument.Value;
break;
case "Dlsym":
linkWith.Dlsym = (DlsymOption) property.Argument.Value;
break;
2016-04-21 15:57:02 +03:00
default:
break;
}
}
return linkWith;
}
void AddFramework (string file)
{
if (Driver.GetFrameworks (App).TryGetValue (file, out var framework) && framework.Version > App.SdkVersion)
2020-01-31 23:02:52 +03:00
ErrorHelper.Warning (135, Errors.MX0135, file, FileName, App.PlatformName, framework.Version, App.SdkVersion);
else {
var strong = (framework == null) || (App.DeploymentTarget >= (App.IsSimulatorBuild ? framework.VersionAvailableInSimulator ?? framework.Version : framework.Version));
if (strong) {
if (Frameworks.Add (file))
Driver.Log (3, "Linking with the framework {0} because it's referenced by a module reference in {1}", file, FileName);
} else {
if (WeakFrameworks.Add (file))
Driver.Log (3, "Linking (weakly) with the framework {0} because it's referenced by a module reference in {1}", file, FileName);
}
}
}
public string GetCompressionLinkingFlag ()
{
switch(App.Platform) {
case ApplePlatform.MacOSX:
if (App.DeploymentTarget >= new Version (10, 11, 0))
return "-lcompression";
return "-weak-lcompression";
case ApplePlatform.iOS:
if (App.DeploymentTarget >= new Version (9,0))
return "-lcompression";
return "-weak-lcompression";
case ApplePlatform.TVOS:
case ApplePlatform.WatchOS:
return "-lcompression";
default:
2020-01-31 23:02:52 +03:00
throw ErrorHelper.CreateError (71, Errors.MX0071, App.Platform, App.SdkVersion);
}
}
2016-04-21 15:57:02 +03:00
public void ComputeLinkerFlags ()
{
foreach (var m in AssemblyDefinition.Modules) {
if (!m.HasModuleReferences)
continue;
foreach (var mr in m.ModuleReferences) {
string name = mr.Name;
if (string.IsNullOrEmpty (name))
continue; // obfuscated assemblies.
2016-04-21 15:57:02 +03:00
string file = Path.GetFileNameWithoutExtension (name);
if (App.IsSimulatorBuild && !App.IsFrameworkAvailableInSimulator (file)) {
Driver.Log (3, "Not linking with {0} (referenced by a module reference in {1}) because it's not available in the simulator.", file, FileName);
continue;
}
2016-04-21 15:57:02 +03:00
switch (file) {
// special case
case "__Internal":
2018-11-14 21:20:48 +03:00
case "System.Native":
case "System.Security.Cryptography.Native.Apple":
case "System.Net.Security.Native":
2016-04-21 15:57:02 +03:00
// well known libs
case "libc":
case "libSystem":
case "libobjc":
case "libdyld":
case "libsystem_kernel":
break;
case "sqlite3":
LinkerFlags.Add ("-lsqlite3");
Driver.Log (3, "Linking with {0} because it's referenced by a module reference in {1}", file, FileName);
break;
2016-04-21 15:57:02 +03:00
case "libsqlite3":
// remove lib prefix
LinkerFlags.Add ("-l" + file.Substring (3));
2016-04-21 15:57:02 +03:00
Driver.Log (3, "Linking with {0} because it's referenced by a module reference in {1}", file, FileName);
break;
case "libcompression":
LinkerFlags.Add (GetCompressionLinkingFlag ());
break;
2016-04-21 15:57:02 +03:00
case "libGLES":
case "libGLESv2":
// special case for OpenGLES.framework
if (Frameworks.Add ("OpenGLES"))
2016-04-21 15:57:02 +03:00
Driver.Log (3, "Linking with the framework OpenGLES because {0} is referenced by a module reference in {1}", file, FileName);
break;
case "vImage":
case "vecLib":
// sub-frameworks
if (Frameworks.Add ("Accelerate"))
2016-04-21 15:57:02 +03:00
Driver.Log (3, "Linking with the framework Accelerate because {0} is referenced by a module reference in {1}", file, FileName);
break;
case "openal32":
if (Frameworks.Add ("OpenAL"))
Driver.Log (3, "Linking with the framework OpenAL because {0} is referenced by a module reference in {1}", file, FileName);
2016-04-21 15:57:02 +03:00
break;
default:
if (App.Platform == ApplePlatform.MacOSX) {
string path = Path.GetDirectoryName (name);
if (!path.StartsWith ("/System/Library/Frameworks", StringComparison.Ordinal))
continue;
// CoreServices has multiple sub-frameworks that can be used by customer code
if (path.StartsWith ("/System/Library/Frameworks/CoreServices.framework/", StringComparison.Ordinal)) {
if (Frameworks.Add ("CoreServices"))
Driver.Log (3, "Linking with the framework CoreServices because {0} is referenced by a module reference in {1}", file, FileName);
break;
}
// ApplicationServices has multiple sub-frameworks that can be used by customer code
if (path.StartsWith ("/System/Library/Frameworks/ApplicationServices.framework/", StringComparison.Ordinal)) {
if (Frameworks.Add ("ApplicationServices"))
Driver.Log (3, "Linking with the framework ApplicationServices because {0} is referenced by a module reference in {1}", file, FileName);
break;
}
}
2016-04-21 15:57:02 +03:00
// detect frameworks
int f = name.IndexOf (".framework/", StringComparison.Ordinal);
if (f > 0) {
AddFramework (file);
2016-04-21 15:57:02 +03:00
} else {
if (UnresolvedModuleReferences == null)
UnresolvedModuleReferences = new HashSet<ModuleReference> ();
UnresolvedModuleReferences.Add (mr);
Driver.Log (3, "Could not resolve the module reference {0} in {1}", file, FileName);
}
break;
}
}
}
}
public override string ToString ()
{
return FileName;
}
// This returns the path to all related files:
// * The assembly itself
// * Any debug files (mdb/pdb)
// * Any config files
// * Any satellite assemblies
public IEnumerable<string> GetRelatedFiles ()
{
yield return FullPath;
var mdb = FullPath + ".mdb";
if (File.Exists (mdb))
yield return mdb;
var pdb = Path.ChangeExtension (FullPath, ".pdb");
if (File.Exists (pdb))
yield return pdb;
var config = FullPath + ".config";
if (File.Exists (config))
yield return config;
if (Satellites != null) {
foreach (var satellite in Satellites)
yield return satellite;
}
}
public void ComputeSatellites ()
{
var satellite_name = Path.GetFileNameWithoutExtension (FullPath) + ".resources.dll";
var path = Path.GetDirectoryName (FullPath);
// first look if satellites are located in subdirectories of the current location of the assembly
ComputeSatellites (satellite_name, path);
if (Satellites == null) {
// 2nd chance: satellite assemblies can come from different nugets (as dependencies)
// they will be copied (at build time) into the destination directory (making them work at runtime)
// but they won't be side-by-side the original assembly (which breaks our build time assumptions)
path = Path.GetDirectoryName (App.RootAssemblies [0]);
if (string.IsNullOrEmpty (path))
path = Environment.CurrentDirectory;
ComputeSatellites (satellite_name, path);
}
}
void ComputeSatellites (string satellite_name, string path)
{
foreach (var subdir in Directory.GetDirectories (path)) {
var culture_name = Path.GetFileName (subdir);
CultureInfo ci;
if (culture_name.IndexOf ('.') >= 0)
continue; // cultures can't have dots. This way we don't check every *.app directory
// well-known subdirectories (that are not cultures) to avoid (slow) exceptions handling
2018-10-15 22:39:29 +03:00
switch (culture_name) {
case "Facades":
case "repl":
case "device-builds":
case "Design": // XF
2018-10-15 22:39:29 +03:00
continue;
}
try {
ci = CultureInfo.GetCultureInfo (culture_name);
} catch {
// nope, not a resource language
continue;
}
if (ci == null)
continue;
var satellite = Path.Combine (subdir, satellite_name);
if (File.Exists (satellite)) {
if (Satellites == null)
Satellites = new List<string> ();
Satellites.Add (satellite);
}
}
}
public void CopySatellitesToDirectory (string directory)
{
if (Satellites == null)
return;
foreach (var a in Satellites) {
string target_dir = Path.Combine (directory, Path.GetFileName (Path.GetDirectoryName (a)));
string target_s = Path.Combine (target_dir, Path.GetFileName (a));
if (!Directory.Exists (target_dir))
Directory.CreateDirectory (target_dir);
CopyAssembly (a, target_s);
}
}
public delegate bool StripAssembly (string path);
// returns false if the assembly was not copied (because it was already up-to-date).
public bool CopyAssembly (string source, string target, bool copy_debug_symbols = true, StripAssembly strip = null)
{
var copied = false;
try {
var strip_assembly = strip != null && strip (source);
if (!Application.IsUptodate (source, target) && (strip_assembly || !Cache.CompareAssemblies (source, target))) {
copied = true;
if (strip_assembly) {
Driver.FileDelete (target);
Directory.CreateDirectory (Path.GetDirectoryName (target));
MonoTouch.Tuner.Stripper.Process (source, target);
} else {
Application.CopyFile (source, target);
}
} else {
Driver.Log (3, "Target '{0}' is up-to-date.", target);
}
// Update the debug symbols file even if the assembly didn't change.
if (copy_debug_symbols && HasValidSymbols) {
// Unfortunately Cecil won't tell us the path of the symbol file, so we have to try all we support (.pdb+.mdb)
if (File.Exists (source + ".mdb"))
Application.UpdateFile (source + ".mdb", target + ".mdb", true);
var spdb = Path.ChangeExtension (source, "pdb");
if (File.Exists (spdb))
Application.UpdateFile (spdb, Path.ChangeExtension (target, "pdb"), true);
}
CopyConfigToDirectory (Path.GetDirectoryName (target));
} catch (Exception e) {
throw new ProductException (1009, true, e, Errors.MX1009, source, target, e.Message);
}
return copied;
}
public void CopyConfigToDirectory (string directory)
{
string config_src = FullPath + ".config";
if (File.Exists (config_src)) {
string config_target = Path.Combine (directory, FileName + ".config");
Application.UpdateFile (config_src, config_target, true);
}
}
public bool IsAOTCompiled {
get {
return App.IsAOTCompiled (Identity);
}
}
2016-04-21 15:57:02 +03:00
}
public sealed class NormalizedStringComparer : IEqualityComparer<string>
{
public static readonly NormalizedStringComparer OrdinalIgnoreCase = new NormalizedStringComparer (StringComparer.OrdinalIgnoreCase);
StringComparer comparer;
public NormalizedStringComparer (StringComparer comparer)
{
this.comparer = comparer;
}
public bool Equals (string x, string y)
{
// From what I gather it doesn't matter which normalization form
// is used, but I chose Form D because HFS normalizes to Form D.
if (x != null)
x = x.Normalize (System.Text.NormalizationForm.FormD);
if (y != null)
y = y.Normalize (System.Text.NormalizationForm.FormD);
return comparer.Equals (x, y);
}
public int GetHashCode (string obj)
{
return comparer.GetHashCode (obj?.Normalize (System.Text.NormalizationForm.FormD));
}
}
public class AssemblyCollection : IEnumerable<Assembly>
{
Dictionary<string, Assembly> HashedAssemblies = new Dictionary<string, Assembly> (NormalizedStringComparer.OrdinalIgnoreCase);
public void Add (Assembly assembly)
{
Assembly other;
if (HashedAssemblies.TryGetValue (assembly.Identity, out other))
2020-01-31 23:02:52 +03:00
throw ErrorHelper.CreateError (2018, Errors.MT2018, assembly.Identity, other.FullPath, assembly.FullPath);
HashedAssemblies.Add (assembly.Identity, assembly);
}
public void AddRange (AssemblyCollection assemblies)
{
foreach (var a in assemblies)
Add (a);
}
public int Count {
get {
return HashedAssemblies.Count;
}
}
public IDictionary<string, Assembly> Hashed {
get { return HashedAssemblies; }
}
public bool TryGetValue (string identity, out Assembly assembly)
{
return HashedAssemblies.TryGetValue (identity, out assembly);
}
[mtouch] Improve how we make sure native symbols aren't stripped away. Fixes #51710 and #54417. (#2162) * [mtouch] Improve how we make sure native symbols aren't stripped away. Fixes #51710 and #54417. * Refactor required symbol collection to store more information about each symbol (field, function, Objective-C class), and in general make the code more straight forward. * Implement support for generating source code that references these symbols, and do this whenever we can't ask the native linker to keep these symbols (when using bitcode). Additionally make it possible to do this manually, so that the source code can be generated for non-bitcode platforms too (which is useful if the number of symbols is enormous, in which case we might surpass the maximum command-line length). * Also make it possible to completely ignore native symbols, or ignore them on a per-symbol basis. This provides a fallback for users if we get something right and we try to preserve something that shouldn't be preserved (for instance if it doesn't exist), and the user ends up with unfixable linker errors. * Don't collect Objective-C classes unless they're in an assembly with LinkWith attributes. We don't need to preserve Objective-C classes in any other circumstances. * Implement everything for both Xamarin.iOS and Xamarin.Mac, and share the code between them. * Remove previous workaround for bug #51710, since it's no longer needed. * Add tests. https://bugzilla.xamarin.com/show_bug.cgi?id=54417 https://bugzilla.xamarin.com/show_bug.cgi?id=51710 * [mtouch] Make sure to only keep symbols from the current app when code sharing. This fixes a build problem with the interdependent-binding-projects test when testing in Today Extension mode.
2017-06-02 19:29:19 +03:00
public bool TryGetValue (AssemblyDefinition asm, out Assembly assembly)
{
return HashedAssemblies.TryGetValue (Assembly.GetIdentity (asm), out assembly);
}
public bool Contains (AssemblyDefinition asm)
{
return HashedAssemblies.ContainsKey (Assembly.GetIdentity (asm));
}
public bool ContainsKey (string identity)
{
return HashedAssemblies.ContainsKey (identity);
}
public void Remove (string identity)
{
HashedAssemblies.Remove (identity);
}
public void Remove (Assembly assembly)
{
Remove (assembly.Identity);
}
public Assembly this [string key] {
get { return HashedAssemblies [key]; }
set { HashedAssemblies [key] = value; }
}
public void Update (Target target, IEnumerable<AssemblyDefinition> assemblies)
{
// This function will remove any assemblies not in 'assemblies', and add any new assemblies.
var current = new HashSet<string> (HashedAssemblies.Keys, HashedAssemblies.Comparer);
foreach (var assembly in assemblies) {
var identity = Assembly.GetIdentity (assembly);
if (!current.Remove (identity)) {
// new assembly
var asm = new Assembly (target, assembly);
Add (asm);
Driver.Log (1, "The linker added the assembly '{0}' to '{1}' to satisfy a reference.", asm.Identity, target.App.Name);
[mtouch] Implement support for sharing code between app extensions and container apps. Implement support for sharing both code and resources between app extensions and their container app: * AOT-compiled code. Each shared assembly is only AOT-compiled once, and if the assembly is built to a framework or dynamic library, it will also only be included once in the final app (as a framework or dynamic library in the container app, referenced directly by the app extension). If the assemblies are built to static objects there won't be any size improvements in the app, but the build will be much faster, because the assemblies will only be AOT- compiled once. * Any resources related to managed assemblies (debug files, config files, satellite assemblies) will be put in the container app only. Since these improvements are significant, code sharing will be enabled by default. Test results ============ For an extreme test project with 7 extensions (embedded-frameworks)[1]: with code sharing cycle 9 difference build time 1m 47s 3m 33s -1m 46s = ~50% faster app size 26 MB 131 MB -105 MB = ~80% smaller For a more normal test project (MyTabbedApplication)[2] - this is a simple application with 1 extension: with code sharing cycle 9 difference build time 0m 44s 0m 48s -4s = ~ 8% faster app size 23 MB 37 MB -15 MB = ~40% smaller Another tvOS app with one extension also show similar gains (MyTVApp)[3]: with code sharing cycle 9 difference build time 0m 22s 0m 48s -26s = ~54% faster app size 22 MB 62 MB -40 MB = ~65% smaller [1]: https://github.com/rolfbjarne/embedded-frameworks [2]: https://github.com/xamarin/xamarin-macios/tree/cycle9/msbuild/tests/MyTabbedApplication [3]: https://github.com/xamarin/xamarin-macios/tree/cycle9/msbuild/tests/MyTVApp
2017-01-24 13:10:20 +03:00
} else {
this [identity].AssemblyDefinition = assembly;
}
}
foreach (var removed in current) {
Driver.Log (1, "The linker removed the assembly '{0}' from '{1}' since there is no more reference to it.", this [removed].Identity, target.App.Name);
Remove (removed);
}
}
#region Interface implementations
IEnumerator IEnumerable.GetEnumerator ()
{
return GetEnumerator ();
}
public IEnumerator<Assembly> GetEnumerator ()
{
return HashedAssemblies.Values.GetEnumerator ();
}
#endregion
}
2016-04-21 15:57:02 +03:00
}