From 861b216d1377819cf37d432d009ec2dd9d2308fe Mon Sep 17 00:00:00 2001 From: Taylor Southwick Date: Fri, 10 Apr 2015 12:15:59 -0700 Subject: [PATCH] Add ApiPort to solution --- Microsoft.Fx.Portability.sln | 10 + README.md | 7 +- src/ApiPort/ApiPort.csproj | 97 +++++ src/ApiPort/App.config | 11 + src/ApiPort/AppCommands.cs | 15 + src/ApiPort/CommandLineOptions.cs | 81 ++++ src/ApiPort/ConsoleProgressReporter.cs | 140 +++++++ src/ApiPort/DependencyBuilder.cs | 40 ++ src/ApiPort/ICommandLineOptions.cs | 16 + src/ApiPort/Program.cs | 269 +++++++++++++ src/ApiPort/Properties/AssemblyInfo.cs | 36 ++ .../Resources/LocalizedStrings.Designer.cs | 356 ++++++++++++++++++ src/ApiPort/Resources/LocalizedStrings.resx | 224 +++++++++++ src/ApiPort/packages.config | 5 + 14 files changed, 1304 insertions(+), 3 deletions(-) create mode 100644 src/ApiPort/ApiPort.csproj create mode 100644 src/ApiPort/App.config create mode 100644 src/ApiPort/AppCommands.cs create mode 100644 src/ApiPort/CommandLineOptions.cs create mode 100644 src/ApiPort/ConsoleProgressReporter.cs create mode 100644 src/ApiPort/DependencyBuilder.cs create mode 100644 src/ApiPort/ICommandLineOptions.cs create mode 100644 src/ApiPort/Program.cs create mode 100644 src/ApiPort/Properties/AssemblyInfo.cs create mode 100644 src/ApiPort/Resources/LocalizedStrings.Designer.cs create mode 100644 src/ApiPort/Resources/LocalizedStrings.resx create mode 100644 src/ApiPort/packages.config diff --git a/Microsoft.Fx.Portability.sln b/Microsoft.Fx.Portability.sln index 7362359f3..5f578a69b 100644 --- a/Microsoft.Fx.Portability.sln +++ b/Microsoft.Fx.Portability.sln @@ -27,6 +27,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{F829 EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SearchFxApi", "samples\SearchFxApi\SearchFxApi.kproj", "{C556C618-D062-4988-9379-99A716D8F2C1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiPort", "src\ApiPort\ApiPort.csproj", "{5A2EAD0F-FF3E-4968-A865-7B29C4B10A72}" + ProjectSection(ProjectDependencies) = postProject + {C1E232EA-AC27-4D0B-9C71-7A24BE65636D} = {C1E232EA-AC27-4D0B-9C71-7A24BE65636D} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +50,10 @@ Global {C556C618-D062-4988-9379-99A716D8F2C1}.Debug|Any CPU.Build.0 = Debug|Any CPU {C556C618-D062-4988-9379-99A716D8F2C1}.Release|Any CPU.ActiveCfg = Release|Any CPU {C556C618-D062-4988-9379-99A716D8F2C1}.Release|Any CPU.Build.0 = Release|Any CPU + {5A2EAD0F-FF3E-4968-A865-7B29C4B10A72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5A2EAD0F-FF3E-4968-A865-7B29C4B10A72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5A2EAD0F-FF3E-4968-A865-7B29C4B10A72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5A2EAD0F-FF3E-4968-A865-7B29C4B10A72}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -53,5 +62,6 @@ Global {C1E232EA-AC27-4D0B-9C71-7A24BE65636D} = {6234AABE-C4F3-4094-9C0D-FFD589235DBE} {6900A49C-D463-43E2-AB21-487E8B73EF5C} = {7DC7AA2C-0401-495B-B42C-32F44085EBE6} {C556C618-D062-4988-9379-99A716D8F2C1} = {F8292A68-AF7C-4B26-B1B8-B232548EF118} + {5A2EAD0F-FF3E-4968-A865-7B29C4B10A72} = {6234AABE-C4F3-4094-9C0D-FFD589235DBE} EndGlobalSection EndGlobal diff --git a/README.md b/README.md index 879a94983..cef36396c 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ repository in order to be notified as we make changes to and expand it. Today, the repository contains the following components: -* **Microsoft.Fx.Portability**. Provides common types for API Port. - -* **Microsoft.Fx.Portability Tests**. Provides tests for Microsoft.Fx.Portability. +* **src/ApiPort** Console tool to access portability webservice. *Does not analyze assemblies yet.* +* **src/Microsoft.Fx.Portability** Provides common types for API Port. +* **src/Microsoft.Fx.Portability-net45** A project targeting .NET 4.5 of Microsoft.Fx.Portability to allow desktop apps to directly reference it. *Currently a work-around for beta VS 2015 behavior.* +* **tests/Microsoft.Fx.Portability** Provides tests for Microsoft.Fx.Portability. More libraries are coming soon. Stay tuned! diff --git a/src/ApiPort/ApiPort.csproj b/src/ApiPort/ApiPort.csproj new file mode 100644 index 000000000..5181cd64b --- /dev/null +++ b/src/ApiPort/ApiPort.csproj @@ -0,0 +1,97 @@ + + + + + Debug + AnyCPU + {5A2EAD0F-FF3E-4968-A865-7B29C4B10A72} + Exe + Properties + ApiPort + ApiPort + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + False + ..\Microsoft.Fx.Portability\bin\Debug\net45\Microsoft.Fx.Portability.dll + + + ..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll + + + ..\..\packages\Unity.3.5.1404.0\lib\net45\Microsoft.Practices.Unity.dll + + + ..\..\packages\Unity.3.5.1404.0\lib\net45\Microsoft.Practices.Unity.Configuration.dll + + + ..\..\packages\Unity.3.5.1404.0\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll + + + + + + + + + + + + + + + + + + + + True + True + LocalizedStrings.resx + + + + + + + + + PublicResXFileCodeGenerator + LocalizedStrings.Designer.cs + + + + + + + + + \ No newline at end of file diff --git a/src/ApiPort/App.config b/src/ApiPort/App.config new file mode 100644 index 000000000..4fc378dc4 --- /dev/null +++ b/src/ApiPort/App.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/ApiPort/AppCommands.cs b/src/ApiPort/AppCommands.cs new file mode 100644 index 000000000..5cff43ed2 --- /dev/null +++ b/src/ApiPort/AppCommands.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +namespace ApiPort +{ + public enum AppCommands + { + ListTargets, + AnalyzeAssemblies, + ListOutputFormats, +#if DOCID_SEARCH + DocIdSearch +#endif + } +} diff --git a/src/ApiPort/CommandLineOptions.cs b/src/ApiPort/CommandLineOptions.cs new file mode 100644 index 000000000..772a698c5 --- /dev/null +++ b/src/ApiPort/CommandLineOptions.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Fx.Portability.ObjectModel; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace ApiPort +{ + internal class CommandLineOptions : ICommandLineOptions + { + public static ICommandLineOptions ParseCommandLineOptions(string[] args) + { + return new CommandLineOptions(); + } + + public AppCommands Command + { + get { return AppCommands.ListTargets; } + } + + public string OutputFileName + { + get { return "ApiPort"; } + } + + public IEnumerable InvalidInputFiles + { + get + { + return Enumerable.Empty(); + } + } + + public string Description + { + get; set; + } + + public IEnumerable InputAssemblies + { + get + { + return Enumerable.Empty(); + } + } + + public IEnumerable OutputFormats + { + get + { + return Enumerable.Empty(); + } + } + + public AnalyzeRequestFlags RequestFlags + { + get + { + return AnalyzeRequestFlags.None; + } + } + + public string ServiceEndpoint + { + get + { + return "https://portability.cloudapp.net/"; + } + } + + public IEnumerable Targets + { + get + { + return Enumerable.Empty(); + } + } + } +} diff --git a/src/ApiPort/ConsoleProgressReporter.cs b/src/ApiPort/ConsoleProgressReporter.cs new file mode 100644 index 000000000..a397400b9 --- /dev/null +++ b/src/ApiPort/ConsoleProgressReporter.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using ApiPort.Resources; +using Microsoft.Fx.Portability; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; + +namespace ApiPort +{ + public class ConsoleProgressReporter : IProgressReporter + { + private readonly List _issuesReported = new List(); + + public IProgressTask StartTask(string taskName) + { + return new ConsoleProgressTask(taskName, null); + } + + public IProgressTask StartTask(string taskName, int total) + { + return new ConsoleProgressTask(taskName, total); + } + + public IReadOnlyCollection Issues { get { return _issuesReported.AsReadOnly(); } } + + public void ReportIssue(string issue) + { + _issuesReported.Add(issue); + } + + private static void WriteColor(string message, ConsoleColor color) + { + var previousColor = Console.ForegroundColor; + + try + { + Console.ForegroundColor = color; + Console.Write(message); + } + finally + { + Console.ForegroundColor = previousColor; + } + } + + private static void WriteColorLine(string message, ConsoleColor color) + { + WriteColor(message, color); + Console.WriteLine(); + } + + private sealed class ConsoleProgressTask : IProgressTask + { + private readonly static char[] s_chars = new char[] { '-', '\\', '|', '/' }; + + private readonly Task _animationTask; + private readonly CancellationTokenSource _cancellationSource = new CancellationTokenSource(); + private readonly int? _totalCount; + private readonly string _task; + + private bool _completed = false; + + public ConsoleProgressTask(string task, int? totalCount) + { + _task = task.TrimEnd().PadRight(50); + Console.Write(_task); + + _totalCount = totalCount; + _animationTask = RunBusyAnimation(_cancellationSource.Token); + } + + private async Task RunBusyAnimation(CancellationToken cancelToken) + { + await Task.Delay(1); + + { + var count = 0; + + // 'left' is the last character written after the task name was written. + var left = Console.CursorLeft; + while (!cancelToken.IsCancellationRequested) + { + Console.SetCursorPosition(left, Console.CursorTop); + + WriteColor(string.Format(LocalizedStrings.ProgressReportInProgress, new string('.', ++count % 4).PadRight(3)), ConsoleColor.Yellow); + + + await Task.Delay(350); + } + + // Make sure we remove the last characted that we wrote. + Console.SetCursorPosition(0, Console.CursorTop); + Console.Write(" ".PadLeft(Console.WindowWidth - 1)); + Console.SetCursorPosition(0, Console.CursorTop); + Console.Write(_task); + } + } + + public void ReportUnitComplete() + { + } + + public void Abort() + { + EndTask(Microsoft.Fx.Portability.Resources.LocalizedStrings.ProgressReportFailed, ConsoleColor.Red); + } + + public void Dispose() + { + EndTask(Microsoft.Fx.Portability.Resources.LocalizedStrings.ProgressReportDone, ConsoleColor.Green); + } + + private void EndTask(string message, ConsoleColor color) + { + if (_completed) + { + return; + } + + _completed = true; + + if (_cancellationSource != null) + { + _cancellationSource.Cancel(); + } + + if (_animationTask != null) + { + _animationTask.Wait(); + } + + WriteColorLine(message, color); + } + } + } +} diff --git a/src/ApiPort/DependencyBuilder.cs b/src/ApiPort/DependencyBuilder.cs new file mode 100644 index 000000000..0589b33d3 --- /dev/null +++ b/src/ApiPort/DependencyBuilder.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Fx.Portability; +using Microsoft.Fx.Portability.Reporting; +using Microsoft.Practices.Unity; +using System; + +namespace ApiPort +{ + internal static class DependencyBuilder + { + public static IUnityContainer Build(ICommandLineOptions options, ProductInformation productInformation) + { + var container = new UnityContainer(); + + var targetMapper = new TargetMapper(); + targetMapper.LoadFromConfig(); + + container.RegisterInstance(options); + container.RegisterInstance(targetMapper); + container.RegisterInstance(new ApiPortService(options.ServiceEndpoint, productInformation)); + container.RegisterType(new ContainerControlledLifetimeManager()); + container.RegisterType(new ContainerControlledLifetimeManager()); + container.RegisterType(new ContainerControlledLifetimeManager()); + container.RegisterType(new ContainerControlledLifetimeManager()); + + if (Console.IsOutputRedirected) + { + container.RegisterInstance(new TextWriterProgressReporter(Console.Out)); + } + else + { + container.RegisterType(new ContainerControlledLifetimeManager()); + } + + return container; + } + } +} diff --git a/src/ApiPort/ICommandLineOptions.cs b/src/ApiPort/ICommandLineOptions.cs new file mode 100644 index 000000000..34e6ca095 --- /dev/null +++ b/src/ApiPort/ICommandLineOptions.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.Fx.Portability; +using System.Collections.Generic; + +namespace ApiPort +{ + public interface ICommandLineOptions : IApiPortOptions + { + string ServiceEndpoint { get; } + string OutputFileName { get; } + AppCommands Command { get; } + IEnumerable InvalidInputFiles { get; } + } +} diff --git a/src/ApiPort/Program.cs b/src/ApiPort/Program.cs new file mode 100644 index 000000000..6cd30e1bd --- /dev/null +++ b/src/ApiPort/Program.cs @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using ApiPort.Resources; +using Microsoft.Fx.Portability; +using Microsoft.Fx.Portability.Reporting; +using Microsoft.Practices.Unity; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; + +namespace ApiPort +{ + public class Program + { + public static int Main(string[] args) + { + var productInformation = new ProductInformation("ApiPort_Console"); + + Console.WriteLine(LocalizedStrings.Header, LocalizedStrings.ApplicationName, productInformation.Version); + + var options = CommandLineOptions.ParseCommandLineOptions(args); + + if (options == null) + { + // we could not parse the options. nothing to do. + return -1; + } + + using (var container = DependencyBuilder.Build(options, productInformation)) + { + var progressReport = container.Resolve(); + + try + { + var apiPortClient = container.Resolve(); + + switch (options.Command) + { + case AppCommands.ListTargets: + ListTargets(apiPortClient, container.Resolve()).Wait(); + break; + case AppCommands.AnalyzeAssemblies: + AnalyzeAssembliesAsync(apiPortClient, options, progressReport, container.Resolve()).Wait(); + break; +#if DOCID_SEARCH + case AppCommands.DocIdSearch: + var docIdSearch = container.Resolve(); + docIdSearch.DocIdSearch(); + break; +#endif + case AppCommands.ListOutputFormats: + ListOutputFormats(apiPortClient).Wait(); + break; + } + + return 0; + } + catch (PortabilityAnalyzerException ex) + { + Trace.TraceError(ex.ToString()); + + // Display the message as it has already been localized + WriteError(ex.Message); + } + catch (AggregateException ex) + { + Trace.TraceError(ex.ToString()); + + // If the exception is known, display the message as it has already been localized + if (ex.InnerException is PortabilityAnalyzerException) + { + WriteError(ex.InnerException.Message); + } + else if (!IsWebSecurityFailureOnMono(ex)) + { + WriteError(LocalizedStrings.UnknownException); + } + } + catch (Exception ex) + { + Trace.TraceError(ex.ToString()); + + WriteError(LocalizedStrings.UnknownException); + } + finally + { + if (progressReport != null) + { + Console.WriteLine(); + + foreach (var issue in progressReport.Issues) + { + WriteWarning("* " + issue); + } + } + } + + return -1; + } + } + + private static void WriteColorLine(string message, ConsoleColor color) + { + var previousColor = Console.ForegroundColor; + + try + { + Console.ForegroundColor = color; + Console.WriteLine(message); + } + finally + { + Console.ForegroundColor = previousColor; + } + } + + private static void WriteError(string message) + { + Console.WriteLine(); + WriteColorLine(message, ConsoleColor.Red); + } + + private static void WriteWarning(string message) + { + WriteColorLine(message, ConsoleColor.Yellow); + } + + /// + /// Mono does not come installed with root certificates. If a user runs this without configuring them, + /// they will receive a Mono.Security.Protocol.Tls.TlsException. + /// + /// + /// + private static bool IsWebSecurityFailureOnMono(Exception ex) + { + if (ex.InnerException is System.Net.WebException && ex.InnerException.InnerException is System.IO.IOException && ex.InnerException.InnerException.InnerException != null) + { + var errorType = ex.InnerException.InnerException.InnerException.GetType(); + + if (String.Equals(errorType.FullName, "Mono.Security.Protocol.Tls.TlsException", StringComparison.Ordinal)) + { + Console.WriteLine(LocalizedStrings.MonoWebRequestsFailure); + + return true; + } + } + + return false; + } + + private static async Task ListOutputFormats(ApiPortClient apiPortClient) + { + var outputFormats = await apiPortClient.ListResultFormatsAsync(); + + if (outputFormats.Any()) + { + Console.WriteLine(); + Console.WriteLine(LocalizedStrings.AvailableOutputFormats); + + foreach (var outputFormat in outputFormats) + { + Console.WriteLine(string.Format(LocalizedStrings.TargetsListNoVersion, outputFormat)); + } + } + } + + private static async Task ListTargets(ApiPortClient apiPortClient, ITargetMapper targetMapper) + { + const string SelectedMarker = "*"; + + var targets = await apiPortClient.ListTargets(); + + if (targets.Any()) + { + Console.WriteLine(); + Console.WriteLine(LocalizedStrings.AvailableTargets); + + var expandableTargets = targets.Where(target => target.ExpandedTargets.Any()); + var groupedTargets = targets.Where(target => !target.ExpandedTargets.Any()).GroupBy(target => target.Name); + + foreach (var item in groupedTargets) + { + Console.WriteLine(LocalizedStrings.TargetsList, item.Key, String.Join(LocalizedStrings.VersionListJoin, item.Select(v => v.Version.ToString() + (v.IsSet ? SelectedMarker : String.Empty)))); + } + + if (expandableTargets.Any()) + { + Console.WriteLine(); + Console.WriteLine(Microsoft.Fx.Portability.Resources.LocalizedStrings.AvailableGroupedTargets); + + foreach (var item in expandableTargets) + { + Console.WriteLine(LocalizedStrings.TargetsListGrouped, item.Name, String.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator + " ", item.ExpandedTargets)); + } + } + } + + if (targetMapper.Aliases.Any()) + { + Console.WriteLine(); + Console.WriteLine(LocalizedStrings.AvailableAliases); + + foreach (var alias in targetMapper.Aliases) + { + Console.WriteLine(LocalizedStrings.TargetsListNoVersion, alias); + } + } + + Console.WriteLine(); + Console.WriteLine(LocalizedStrings.NotesOnUsage); + Console.WriteLine(LocalizedStrings.TargetsListNoVersion, Microsoft.Fx.Portability.Resources.LocalizedStrings.HowToSpecifyVersion); + Console.WriteLine(); + Console.WriteLine(LocalizedStrings.TargetsListNoVersion, LocalizedStrings.WhatAsteriskMeans); + } + + private static async Task AnalyzeAssembliesAsync(ApiPortClient apiPort, ICommandLineOptions options, IProgressReporter progressReport, IFileWriter writer) + { + foreach (var errorInput in options.InvalidInputFiles) + { + progressReport.ReportIssue(string.Format(Microsoft.Fx.Portability.Resources.LocalizedStrings.InvalidFileName, errorInput)); + } + + var results = await apiPort.GetAnalysisReportAsync(options); + var outputPaths = new List(); + + foreach (var resultAndFormat in results.Zip(options.OutputFormats, (r, f) => new { Result = r, Format = f })) + { + var outputPath = await CreateReport(resultAndFormat.Result, apiPort, options.OutputFileName, resultAndFormat.Format, progressReport, writer); + + outputPaths.Add(outputPath); + } + + Console.WriteLine(); + Console.WriteLine(LocalizedStrings.OutputWrittenTo); + + foreach (var outputPath in outputPaths) + { + Console.WriteLine(outputPath); + } + } + + private static async Task CreateReport(byte[] result, ApiPortClient apiPort, string suppliedOutputFileName, string outputFormat, IProgressReporter progressReport, IFileWriter writer) + { + var filePath = Path.GetFullPath(suppliedOutputFileName); + var outputDirectory = Path.GetDirectoryName(filePath); + var outputFileName = Path.GetFileName(filePath); + + using (var progressTask = progressReport.StartTask(LocalizedStrings.WritingReport)) + { + try + { + var extension = await apiPort.GetExtensionForFormat(outputFormat); + + return await writer.WriteReportAsync(result, extension, outputDirectory, outputFileName, overwrite: false); + } + catch (Exception) + { + progressTask.Abort(); + throw; + } + } + } + } +} diff --git a/src/ApiPort/Properties/AssemblyInfo.cs b/src/ApiPort/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5dc3867ba --- /dev/null +++ b/src/ApiPort/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ApiPort")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ApiPort")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5a2ead0f-ff3e-4968-a865-7b29c4b10a72")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/ApiPort/Resources/LocalizedStrings.Designer.cs b/src/ApiPort/Resources/LocalizedStrings.Designer.cs new file mode 100644 index 000000000..907b7738c --- /dev/null +++ b/src/ApiPort/Resources/LocalizedStrings.Designer.cs @@ -0,0 +1,356 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ApiPort.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class LocalizedStrings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal LocalizedStrings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ApiPort.Resources.LocalizedStrings", typeof(LocalizedStrings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Analyze. + /// + public static string Analyze { + get { + return ResourceManager.GetString("Analyze", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to API Portability Analyzer. + /// + public static string ApplicationName { + get { + return ResourceManager.GetString("ApplicationName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Available Aliases:. + /// + public static string AvailableAliases { + get { + return ResourceManager.GetString("AvailableAliases", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Available output formats:. + /// + public static string AvailableOutputFormats { + get { + return ResourceManager.GetString("AvailableOutputFormats", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Available Targets:. + /// + public static string AvailableTargets { + get { + return ResourceManager.GetString("AvailableTargets", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Calculate breaking changes on full .NET Framework. + /// + public static string CmdHelpShowBreakingChanges { + get { + return ResourceManager.GetString("CmdHelpShowBreakingChanges", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Calculate non-portable APIs. + /// + public static string CmdHelpShowNonPortableApis { + get { + return ResourceManager.GetString("CmdHelpShowNonPortableApis", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Description. + /// + public static string Description { + get { + return ResourceManager.GetString("Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Description of the submission. + /// + public static string DescriptionHelp { + get { + return ResourceManager.GetString("DescriptionHelp", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft (R) {0} v{1} + ///Copyright (C) Microsoft Corporation. All rights reserved. + /// + ///To learn more about how this tool works, including the data we are collecting, go here - http://go.microsoft.com/fwlink/?LinkId=397652 + ///. + /// + public static string Header { + get { + return ResourceManager.GetString("Header", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid argument was passed in. Please check your command line parameters. + ///{0}. + /// + public static string InvalidCommandLineArguments { + get { + return ResourceManager.GetString("InvalidCommandLineArguments", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of assemblies to analyze. + /// + public static string ListOfAssembliesToAnalyze { + get { + return ResourceManager.GetString("ListOfAssembliesToAnalyze", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use to see what output formats are supported for the generated report.. + /// + public static string ListOutputFormats { + get { + return ResourceManager.GetString("ListOutputFormats", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use to see the available targets against which you can validate your assemblies. + /// + public static string ListTargets { + get { + return ResourceManager.GetString("ListTargets", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If you are running on the mono runtime, you must configure root certificates before using this application. Please see http://www.mono-project.com/docs/faq/security/. + /// + public static string MonoWebRequestsFailure { + get { + return ResourceManager.GetString("MonoWebRequestsFailure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Notes on usage:. + /// + public static string NotesOnUsage { + get { + return ResourceManager.GetString("NotesOnUsage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Output file name. + /// + public static string OutputFileName { + get { + return ResourceManager.GetString("OutputFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wrote output to file:. + /// + public static string OutputWrittenTo { + get { + return ResourceManager.GetString("OutputWrittenTo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replaced output file "{0}". + /// + public static string OverwriteFile { + get { + return ResourceManager.GetString("OverwriteFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Done]. + /// + public static string ProgressReportDone { + get { + return ResourceManager.GetString("ProgressReportDone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Failed]. + /// + public static string ProgressReportFailed { + get { + return ResourceManager.GetString("ProgressReportFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [In Progress{0}]. + /// + public static string ProgressReportInProgress { + get { + return ResourceManager.GetString("ProgressReportInProgress", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The report output format. + /// + public static string ResultFormatHelp { + get { + return ResourceManager.GetString("ResultFormatHelp", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Targets. + /// + public static string Targets { + get { + return ResourceManager.GetString("Targets", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} [Version: {1}]. + /// + public static string TargetsList { + get { + return ResourceManager.GetString("TargetsList", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} ({1}). + /// + public static string TargetsListGrouped { + get { + return ResourceManager.GetString("TargetsListGrouped", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0}. + /// + public static string TargetsListNoVersion { + get { + return ResourceManager.GetString("TargetsListNoVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The targets you want to check against. To specify multiple targets separate them with ';'. + /// + public static string TargetsToCheckAgainst { + get { + return ResourceManager.GetString("TargetsToCheckAgainst", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an unexpected error. Please try again or contact NETAPIPort@Microsoft.com for help.. + /// + public static string UnknownException { + get { + return ResourceManager.GetString("UnknownException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ; . + /// + public static string VersionListJoin { + get { + return ResourceManager.GetString("VersionListJoin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Versions marked with an asterisk (*) implies that these are default targets if none are submitted.. + /// + public static string WhatAsteriskMeans { + get { + return ResourceManager.GetString("WhatAsteriskMeans", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Writing report. + /// + public static string WritingReport { + get { + return ResourceManager.GetString("WritingReport", resourceCulture); + } + } + } +} diff --git a/src/ApiPort/Resources/LocalizedStrings.resx b/src/ApiPort/Resources/LocalizedStrings.resx new file mode 100644 index 000000000..2580a69a5 --- /dev/null +++ b/src/ApiPort/Resources/LocalizedStrings.resx @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Analyze + + + Microsoft (R) {0} v{1} +Copyright (C) Microsoft Corporation. All rights reserved. + +To learn more about how this tool works, including the data we are collecting, go here - http://go.microsoft.com/fwlink/?LinkId=397652 + + + + List of assemblies to analyze + + + Use to see the available targets against which you can validate your assemblies + + + Description of the submission + + + Output file name + + + [Done] + + + The targets you want to check against. To specify multiple targets separate them with ';' + + + Writing report + + + Wrote output to file: + + + [Failed] + + + Available Targets: + Used to display list of available targets + + + Invalid argument was passed in. Please check your command line parameters. +{0} + {0} is the message from the parser with the actual error + + + Replaced output file "{0}" + Displayed when a file exists and will be overwritten + + + Available Aliases: + + + - {0} [Version: {1}] + + + API Portability Analyzer + + + - {0} + + + ; + + + There was an unexpected error. Please try again or contact NETAPIPort@Microsoft.com for help. + + + - {0} ({1}) + + + Notes on usage: + + + Versions marked with an asterisk (*) implies that these are default targets if none are submitted. + + + If you are running on the mono runtime, you must configure root certificates before using this application. Please see http://www.mono-project.com/docs/faq/security/ + + + The report output format + + + Targets + + + Description + + + [In Progress{0}] + + + Available output formats: + + + Use to see what output formats are supported for the generated report. + + + Calculate breaking changes on full .NET Framework + + + Calculate non-portable APIs + + \ No newline at end of file diff --git a/src/ApiPort/packages.config b/src/ApiPort/packages.config new file mode 100644 index 000000000..99a3293c9 --- /dev/null +++ b/src/ApiPort/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file