/// <summary> /// Extracts the events and delegates from the specified target frameworks. /// </summary> /// <param name="writer">The writer where to output to.</param> /// <param name="frameworks">The frameworks we are adapting to.</param> /// <returns>A task to monitor the progress.</returns> public static async Task ExtractEventsFromTargetFramework(TextWriter writer, IReadOnlyList <NuGetFramework> frameworks) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } if (frameworks == null) { throw new ArgumentNullException(nameof(frameworks)); } if (frameworks.Count == 0) { throw new ArgumentOutOfRangeException(nameof(frameworks)); } var mainFramework = frameworks[0]; LogHost.Default.Info(CultureInfo.InvariantCulture, "Processing target framework {0}", mainFramework); var input = new InputAssembliesGroup(); input.IncludeGroup.AddFiles(FileSystemHelpers.GetFilesWithinSubdirectories(mainFramework.GetNuGetFrameworkFolders(), AssemblyHelpers.AssemblyFileExtensionsSet)); await ExtractEventsFromAssemblies(writer, input, mainFramework).ConfigureAwait(false); LogHost.Default.Info(CultureInfo.InvariantCulture, "Finished target framework {0}", mainFramework); }
/// <summary> /// Extracts the events and delegates from the specified platform. /// </summary> /// <param name="writer">The writer where to output to.</param> /// <param name="assemblies">The assemblies to extract.</param> /// <param name="searchDirectories">Directories to search.</param> /// <param name="targetFramework">The name of the TFM to extract for.</param> /// <returns>A task to monitor the progress.</returns> public static async Task ExtractEventsFromAssemblies(TextWriter writer, IEnumerable <string> assemblies, IEnumerable <string> searchDirectories, string targetFramework) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } var input = new InputAssembliesGroup(); input.IncludeGroup.AddFiles(assemblies); input.SupportGroup.AddFiles(FileSystemHelpers.GetFilesWithinSubdirectories(searchDirectories, AssemblyHelpers.AssemblyFileExtensionsSet)); var framework = targetFramework.ToFrameworks(); await ExtractEventsFromAssemblies(writer, input, framework[0]).ConfigureAwait(false); }
/// <inheritdoc /> public override Task Extract(string referenceAssembliesLocation) { Input.IncludeGroup.AddFiles(FileSystemHelpers.GetFilesWithinSubdirectories(Framework.GetNuGetFrameworkFolders(), AssemblyHelpers.AssemblyFileExtensionsSet).Where(x => Path.GetFileName(x).IndexOf("Xamarin.Mac", StringComparison.InvariantCultureIgnoreCase) >= 0)); return(Task.CompletedTask); }