diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index 0988307b9..e94f627be 100644 --- a/Microsoft.DotNet.Cli.sln +++ b/Microsoft.DotNet.Cli.sln @@ -243,6 +243,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-install-tool.Tests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdkResolver.Tests", "test\Microsoft.DotNet.MSBuildSdkResolver.Tests\Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj", "{B7C82980-F01D-4B8A-A746-BFA0032CB152}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-list-package.Tests", "test\dotnet-list-package.Tests\dotnet-list-package.Tests.csproj", "{14C91E15-BD00-4218-9674-6AD216D89AB8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1747,6 +1749,30 @@ Global {B7C82980-F01D-4B8A-A746-BFA0032CB152}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {B7C82980-F01D-4B8A-A746-BFA0032CB152}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {B7C82980-F01D-4B8A-A746-BFA0032CB152}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Debug|x64.ActiveCfg = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Debug|x64.Build.0 = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Debug|x86.ActiveCfg = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Debug|x86.Build.0 = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Release|Any CPU.Build.0 = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Release|x64.ActiveCfg = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Release|x64.Build.0 = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Release|x86.ActiveCfg = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.Release|x86.Build.0 = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {14C91E15-BD00-4218-9674-6AD216D89AB8}.RelWithDebInfo|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1824,6 +1850,7 @@ Global {EDF19BE6-F20F-4AD0-8E3B-E837030726A5} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {8FE9D802-57F3-493B-9E14-72DF905E3838} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {B7C82980-F01D-4B8A-A746-BFA0032CB152} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} + {14C91E15-BD00-4218-9674-6AD216D89AB8} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B526D2CE-EE2D-4AD4-93EF-1867D90FF1F5} diff --git a/src/dotnet/CommonLocalizableStrings.resx b/src/dotnet/CommonLocalizableStrings.resx index d922c877f..4b8c4d0c5 100644 --- a/src/dotnet/CommonLocalizableStrings.resx +++ b/src/dotnet/CommonLocalizableStrings.resx @@ -646,4 +646,10 @@ setx PATH "%PATH%;{0}" VERSION_SUFFIX - + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/ListCommand.cs b/src/dotnet/commands/dotnet-list/ListCommand.cs index 40c33c89b..845460e78 100644 --- a/src/dotnet/commands/dotnet-list/ListCommand.cs +++ b/src/dotnet/commands/dotnet-list/ListCommand.cs @@ -7,6 +7,7 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.CommandLine; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.List.ProjectToProjectReferences; +using Microsoft.DotNet.Tools.List.PackageReferences; namespace Microsoft.DotNet.Tools.List { @@ -23,6 +24,10 @@ namespace Microsoft.DotNet.Tools.List { "reference", o => new ListProjectToProjectReferencesCommand(o, ParseResult) + }, + { + "package", + o => new ListPackageReferencesCommand(o, ParseResult) } }; diff --git a/src/dotnet/commands/dotnet-list/ListCommandParser.cs b/src/dotnet/commands/dotnet-list/ListCommandParser.cs index ed23ed609..6ea7f6a52 100644 --- a/src/dotnet/commands/dotnet-list/ListCommandParser.cs +++ b/src/dotnet/commands/dotnet-list/ListCommandParser.cs @@ -14,11 +14,12 @@ namespace Microsoft.DotNet.Cli "list", LocalizableStrings.NetListCommand, Accept.ZeroOrOneArgument() - .With( - name: CommonLocalizableStrings.ProjectArgumentName, - description: CommonLocalizableStrings.ProjectArgumentDescription) - .DefaultToCurrentDirectory(), - CommonOptions.HelpOption(), - ListProjectToProjectReferencesCommandParser.ListProjectToProjectReferences()); + .With( + name: CommonLocalizableStrings.SolutionOrProjectArgumentName, + description: CommonLocalizableStrings.SolutionOrProjectArgumentDescription) + .DefaultToCurrentDirectory(), + ListPackageReferencesCommandParser.ListPackageReferences(), + ListProjectToProjectReferencesCommandParser.ListProjectToProjectReferences(), + CommonOptions.HelpOption()); } } diff --git a/src/dotnet/commands/dotnet-list/LocalizableStrings.resx b/src/dotnet/commands/dotnet-list/LocalizableStrings.resx index 054105893..79ba54c7b 100644 --- a/src/dotnet/commands/dotnet-list/LocalizableStrings.resx +++ b/src/dotnet/commands/dotnet-list/LocalizableStrings.resx @@ -118,6 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - List references of a .NET project. + List references or packages of a .NET project. \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommand.cs b/src/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommand.cs new file mode 100644 index 000000000..f3cafd3a9 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommand.cs @@ -0,0 +1,197 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.CommandLine; +using Microsoft.DotNet.Tools.Common; +using Microsoft.DotNet.Tools.NuGet; + +namespace Microsoft.DotNet.Tools.List.PackageReferences +{ + internal class ListPackageReferencesCommand : CommandBase + { + //The file or directory passed down by the command + private readonly string _fileOrDirectory; + private AppliedOption _appliedCommand; + + public ListPackageReferencesCommand( + AppliedOption appliedCommand, + ParseResult parseResult) : base(parseResult) + { + if (appliedCommand == null) + { + throw new ArgumentNullException(nameof(appliedCommand)); + } + + // Gets the absolute path of the given path + _fileOrDirectory = PathUtility.GetAbsolutePath(PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()), + appliedCommand.Arguments.Single()); + + FileAttributes attr = File.GetAttributes(_fileOrDirectory); + + if (attr.HasFlag(FileAttributes.Directory)) + { + _fileOrDirectory = PathUtility.EnsureTrailingSlash(_fileOrDirectory); + } + + _appliedCommand = appliedCommand["package"]; + } + + public override int Execute() + { + var result = NuGetCommand.Run(TransformArgs()); + + return result; + } + + private string[] TransformArgs() + { + var args = new List + { + "package", + "list", + }; + + args.Add(GetProjectOrSolution()); + + if (_appliedCommand.HasOption("outdated")) + { + args.Add("--outdated"); + } + + if (_appliedCommand.HasOption("include-transitive")) + { + args.Add("--include-transitive"); + } + + if (_appliedCommand.HasOption("framework")) + { + //Forward framework as multiple flags + foreach (var framework in _appliedCommand.AppliedOptions["framework"].Arguments) + { + args.Add("--framework"); + args.Add(framework); + } + } + + if (_appliedCommand.HasOption("include-prerelease")) + { + CheckForOutdated("--include-prerelease"); + args.Add("--include-prerelease"); + } + + if (_appliedCommand.HasOption("highest-patch")) + { + CheckForOutdated("--highest-patch"); + args.Add("--highest-patch"); + } + + if (_appliedCommand.HasOption("highest-minor")) + { + CheckForOutdated("--highest-minor"); + args.Add("--highest-minor"); + } + + if (_appliedCommand.HasOption("config")) + { + CheckForOutdated("--config"); + args.Add("--config"); + //Config path absolute path + var configPath = PathUtility.GetAbsolutePath(PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()), + _appliedCommand.AppliedOptions["config"].Arguments.Single()); + args.Add(configPath); + } + + if (_appliedCommand.HasOption("source")) + { + CheckForOutdated("--source"); + //Forward source as multiple flags + foreach (var source in _appliedCommand.AppliedOptions["source"].Arguments) + { + args.Add("--source"); + args.Add(source); + } + } + + return args.ToArray(); + } + + /// + /// A check for the outdated specific options. If --outdated not present, + /// these options must not be used, so error is thrown + /// + /// + private void CheckForOutdated(string option) + { + if (!_appliedCommand.HasOption("outdated")) + { + throw new Exception(string.Format(LocalizableStrings.OutdatedOptionOnly, option)); + + } + + } + + /// + /// Gets a solution file or a project file from a given directory. + /// If the given path is a file, it just returns it after checking + /// it exists. + /// + /// Path to send to the command + private string GetProjectOrSolution() + { + string resultPath = _fileOrDirectory; + FileAttributes attr = File.GetAttributes(resultPath); + + if (attr.HasFlag(FileAttributes.Directory)) + { + var possibleSolutionPath = Directory.GetFiles(resultPath, "*.sln", SearchOption.TopDirectoryOnly); + + //If more than a single sln file is found, an error is thrown since we can't determine which one to choose. + if (possibleSolutionPath.Count() > 1) + { + throw new Exception(LocalizableStrings.MultipleSolutionsFound + Environment.NewLine + string.Join(Environment.NewLine, possibleSolutionPath.ToArray())); + } + //If a single solution is found, use it. + else if (possibleSolutionPath.Count() == 1) + { + return possibleSolutionPath[0]; + } + //If no solutions are found, look for a project file + else + { + var possibleProjectPath = Directory.GetFiles(resultPath, "*.*proj", SearchOption.TopDirectoryOnly) + .Where(path => !path.EndsWith(".xproj", StringComparison.OrdinalIgnoreCase)) + .ToList(); + + //No projects found throws an error that no sln nor projs were found + if (possibleProjectPath.Count() == 0) + { + throw new Exception(LocalizableStrings.NoProjectsOrSolutions); + } + //A single project found, use it + else if (possibleProjectPath.Count() == 1) + { + return possibleProjectPath[0]; + } + //More than one project found. Not sure which one to choose + else + { + throw new Exception(LocalizableStrings.MultipleProjectsFound + Environment.NewLine + string.Join(Environment.NewLine, possibleProjectPath.ToArray())); + } + } + } + + //Make sure the file exists + if (!File.Exists(resultPath)) + { + throw new FileNotFoundException(LocalizableStrings.FileNotFound, resultPath); + } + + return resultPath; + } + } +} diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs b/src/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs new file mode 100644 index 000000000..803dd014c --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs @@ -0,0 +1,43 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Linq; +using Microsoft.DotNet.Cli.CommandLine; +using LocalizableStrings = Microsoft.DotNet.Tools.List.PackageReferences.LocalizableStrings; + +namespace Microsoft.DotNet.Cli +{ + internal static class ListPackageReferencesCommandParser + { + public static Command ListPackageReferences() => Create.Command( + "package", + LocalizableStrings.AppFullName, + Accept.ZeroOrOneArgument(), + CommonOptions.HelpOption(), + Create.Option("--outdated", + LocalizableStrings.CmdOutdatedDescription), + Create.Option("--framework", + LocalizableStrings.CmdFrameworkDescription, + Accept.OneOrMoreArguments() + .With(name: LocalizableStrings.CmdFramework) + .ForwardAsSingle(o => $"--framework {string.Join("%3B", o.Arguments)}")), + Create.Option("--include-transitive", + LocalizableStrings.CmdTransitiveDescription), + Create.Option("--include-prerelease", + LocalizableStrings.CmdPrereleaseDescription), + Create.Option("--highest-patch", + LocalizableStrings.CmdHighestPatchDescription), + Create.Option("--highest-minor", + LocalizableStrings.CmdHighestMinorDescription), + Create.Option("--config", + LocalizableStrings.CmdConfigDescription, + Accept.ExactlyOneArgument() + .With(name: LocalizableStrings.CmdConfig) + .ForwardAsSingle(o => $"--config {o.Arguments.Single()}")), + Create.Option("--source", + LocalizableStrings.CmdSourceDescription, + Accept.OneOrMoreArguments() + .With(name: LocalizableStrings.CmdSource) + .ForwardAsSingle(o => $"--source {string.Join("%3B", o.Arguments)}"))); + } +} diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx b/src/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx new file mode 100644 index 000000000..4d431c4ba --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + List all packages references of the project. + + + FRAMEWORK | FRAMEWORK\RID + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + Lists packages that have newer versions. + + + Lists transitive and top-level packages. + + + The directory given includes multiple projects. Please specify one of the following projects: + + + The directory given includes multiple solutions. Please specify one of the following solutions: + + + The given directory does not include any solution or project. + + + CONFIG FILE + + + A path to a config file to specify sources. Works only with `--outdated`. + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + SOURCE + + + Sources to lookup for latest versions. Works only with `--outdated`. + + + This option `{0}` can only be used with `--outdated` present. + + + The given file was not found. Please make sure that you are passing the correct path. + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.cs.xlf new file mode 100644 index 000000000..fb06f3036 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.cs.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Zobrazí všechny odkazy mezi projekty v projektu. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.de.xlf new file mode 100644 index 000000000..59c58ea0c --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.de.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Hiermit listen Sie alle Projekt-zu-Projekt-Verweise des Projekts auf. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.es.xlf new file mode 100644 index 000000000..0a97198ce --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.es.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Enumera referencias de proyecto a proyecto del proyecto. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.fr.xlf new file mode 100644 index 000000000..29d8b06a7 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.fr.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Listez toutes les références projet à projet du projet. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.it.xlf new file mode 100644 index 000000000..c94dd796c --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.it.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Elenca tutti i riferimenti P2P (da progetto a progetto) del progetto. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ja.xlf new file mode 100644 index 000000000..a574a856f --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ja.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + プロジェクトのすべてのプロジェクト間参照をリストします。 + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ko.xlf new file mode 100644 index 000000000..b87e499c6 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ko.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + 프로젝트의 모든 프로젝트 간 참조를 나열합니다. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pl.xlf new file mode 100644 index 000000000..92aa3f78b --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pl.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Wyświetl listę wszystkich odwołań między projektami w projekcie. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pt-BR.xlf new file mode 100644 index 000000000..145a38558 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pt-BR.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Listar todas as referências de projeto a projeto do projeto. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ru.xlf new file mode 100644 index 000000000..e7f5e8ef1 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ru.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Вывод списка всех ссылок из одного проекта на другой. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.tr.xlf new file mode 100644 index 000000000..0b303a0e8 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.tr.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + Projenin tüm projeden projeye başvurularını listeleyin. + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.xlf new file mode 100644 index 000000000..7c015ba0b --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.xlf @@ -0,0 +1,21 @@ + + + + + + + .NET Core Project-to-Project dependency viewer + + + + Command to list project to project references + + + + There are no {0} references in project {1}. +{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hans.xlf new file mode 100644 index 000000000..73e8bb9a3 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hans.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + 列出项目的所有项目到项目引用。 + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hant.xlf new file mode 100644 index 000000000..65f66aaaa --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hant.xlf @@ -0,0 +1,92 @@ + + + + + + List all packages references of the project. + 列出專案的所有專案對專案參考。 + + + + FRAMEWORK | FRAMEWORK\RID + FRAMEWORK | FRAMEWORK\RID + + + + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + Chooses a framework to show its packages. Use the option multiple times for multiple frameworks. + + + + Lists packages that have newer versions. + Lists packages that have newer versions. + + + + Lists transitive and top-level packages. + Lists transitive and top-level packages. + + + + The directory given includes multiple projects. Please specify one of the following projects: + The directory given includes multiple projects. Please specify one of the following projects: + + + + The directory given includes multiple solutions. Please specify one of the following solutions: + The directory given includes multiple solutions. Please specify one of the following solutions: + + + + The given directory does not include any solution or project. + The given directory does not include any solution or project. + + + + CONFIG FILE + CONFIG FILE + + + + A path to a config file to specify sources. Works only with `--outdated`. + A path to a config file to specify sources. Works only with `--outdated`. + + + + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching major when looking for latest version. Works only with `--outdated`. + + + + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + Considers only the versions that have matching minor and major when looking for latest version. Works only with `--outdated`. + + + + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + Considers prerelease versions when looking for latest version. Works only with `--outdated`. + + + + SOURCE + SOURCE + + + + Sources to lookup for latest versions. Works only with `--outdated`. + Sources to lookup for latest versions. Works only with `--outdated`. + + + + This option `{0}` can only be used with `--outdated` present. + This option `{0}` can only be used with `--outdated` present. + + + + The given file was not found. Please make sure that you are passing the correct path. + The given file was not found. Please make sure that you are passing the correct path. + + + + + \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.cs.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.cs.xlf index 8b172feb9..b90b17140 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.cs.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.cs.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Zobrazí odkazy projektu .NET. + List references or packages of a .NET project. + Zobrazí odkazy projektu .NET. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.de.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.de.xlf index 6a3b54dbb..942d37a57 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.de.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.de.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Hiermit listen Sie die Verweise eines .NET-Projekts auf. + List references or packages of a .NET project. + Hiermit listen Sie die Verweise eines .NET-Projekts auf. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.es.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.es.xlf index bfa88eae8..bfb01b2df 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.es.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.es.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Enumera las referencias de un proyecto de .NET. + List references or packages of a .NET project. + Enumera las referencias de un proyecto de .NET. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.fr.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.fr.xlf index 03ccd6153..4eccc8ebe 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.fr.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.fr.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Listez les références d'un projet .NET. + List references or packages of a .NET project. + Listez les références d'un projet .NET. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.it.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.it.xlf index 187b7e6c0..01666acc4 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.it.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.it.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Elenca i riferimenti di un progetto .NET. + List references or packages of a .NET project. + Elenca i riferimenti di un progetto .NET. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ja.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ja.xlf index 15a7943f2..3800c39aa 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ja.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ja.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - .NET プロジェクトの参照を一覧表示します。 + List references or packages of a .NET project. + .NET プロジェクトの参照を一覧表示します。 diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ko.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ko.xlf index fd3816690..5f1bdb599 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ko.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ko.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - .NET 프로젝트의 참조를 나열합니다. + List references or packages of a .NET project. + .NET 프로젝트의 참조를 나열합니다. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pl.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pl.xlf index bb29eb8ca..98a1e4e7e 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pl.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pl.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Wyświetl listę odwołań projektu .NET. + List references or packages of a .NET project. + Wyświetl listę odwołań projektu .NET. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pt-BR.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pt-BR.xlf index edd56cd49..a9752b773 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pt-BR.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.pt-BR.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Liste as referências de um projeto do .NET. + List references or packages of a .NET project. + Liste as referências de um projeto do .NET. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ru.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ru.xlf index def5802b8..fbc32e51b 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ru.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.ru.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Вывод списка ссылок для проекта .NET. + List references or packages of a .NET project. + Вывод списка ссылок для проекта .NET. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.tr.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.tr.xlf index 8d76ddf33..b3db13301 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.tr.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.tr.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - Bir .NET projesinin başvurularını listeleyin. + List references or packages of a .NET project. + Bir .NET projesinin başvurularını listeleyin. diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hans.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hans.xlf index 9a5dcccbe..fdb6ebc83 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hans.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - 列出 .NET 项目的引用。 + List references or packages of a .NET project. + 列出 .NET 项目的引用。 diff --git a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hant.xlf b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hant.xlf index 15daea02b..d6c69e9ad 100644 --- a/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/commands/dotnet-list/xlf/LocalizableStrings.zh-Hant.xlf @@ -3,8 +3,8 @@ - List references of a .NET project. - 列出 .NET 專案的參考。 + List references or packages of a .NET project. + 列出 .NET 專案的參考。 diff --git a/src/dotnet/dotnet.csproj b/src/dotnet/dotnet.csproj index 7fadc1773..2c44e5b97 100644 --- a/src/dotnet/dotnet.csproj +++ b/src/dotnet/dotnet.csproj @@ -26,6 +26,7 @@ + diff --git a/src/dotnet/xlf/CommonLocalizableStrings.cs.xlf b/src/dotnet/xlf/CommonLocalizableStrings.cs.xlf index b78b17195..5ab5ea5ad 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.cs.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.cs.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" VERSION_SUFFIX + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.de.xlf b/src/dotnet/xlf/CommonLocalizableStrings.de.xlf index 10f17ac59..ea51e81a0 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.de.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.de.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" VERSION_SUFFIX + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.es.xlf b/src/dotnet/xlf/CommonLocalizableStrings.es.xlf index ac50774db..300cb039e 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.es.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.es.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" SUFIJO_DE_VERSIÓN + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.fr.xlf b/src/dotnet/xlf/CommonLocalizableStrings.fr.xlf index 69f6616d8..c8f9eda0e 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.fr.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.fr.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" SUFFIXE_VERSION + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.it.xlf b/src/dotnet/xlf/CommonLocalizableStrings.it.xlf index 73fb8c222..64fa8d1f8 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.it.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.it.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" SUFFISSO_VERSIONE + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.ja.xlf b/src/dotnet/xlf/CommonLocalizableStrings.ja.xlf index 5bf946ba8..4b66cdf0b 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.ja.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.ja.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" VERSION_SUFFIX + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.ko.xlf b/src/dotnet/xlf/CommonLocalizableStrings.ko.xlf index db8af1c45..0d2454ef5 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.ko.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.ko.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" VERSION_SUFFIX + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.pl.xlf b/src/dotnet/xlf/CommonLocalizableStrings.pl.xlf index bb9cb09c3..d35e9ecf5 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.pl.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.pl.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" SUFIKS_WERSJI + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.pt-BR.xlf b/src/dotnet/xlf/CommonLocalizableStrings.pt-BR.xlf index 56469a675..ae24edce1 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.pt-BR.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.pt-BR.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" SUFIXO_DA_VERSÃO + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.ru.xlf b/src/dotnet/xlf/CommonLocalizableStrings.ru.xlf index cb618ce63..0aef6105a 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.ru.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.ru.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" VERSION_SUFFIX + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.tr.xlf b/src/dotnet/xlf/CommonLocalizableStrings.tr.xlf index 659e1120c..7e3c0c27a 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.tr.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.tr.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" SÜRÜM_SONEKİ + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.zh-Hans.xlf b/src/dotnet/xlf/CommonLocalizableStrings.zh-Hans.xlf index 2c8cb2ee9..4bc3bd612 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.zh-Hans.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.zh-Hans.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" VERSION_SUFFIX + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/src/dotnet/xlf/CommonLocalizableStrings.zh-Hant.xlf b/src/dotnet/xlf/CommonLocalizableStrings.zh-Hant.xlf index 74ec37dd4..364d5199d 100644 --- a/src/dotnet/xlf/CommonLocalizableStrings.zh-Hant.xlf +++ b/src/dotnet/xlf/CommonLocalizableStrings.zh-Hant.xlf @@ -893,6 +893,16 @@ setx PATH "%PATH%;{0}" VERSION_SUFFIX + + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + The project (or solution only with package command) file to operate on. If a file is not specified, the command will search the current directory for a (solution if used with package command then a) project. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs index bdb460302..7301d9a81 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs @@ -62,6 +62,17 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return new AndConstraint(this); } + public AndConstraint HaveStdOutContainingIgnoreSpaces(string pattern) + { + string commandResultNoSpaces = _commandResult.StdOut.Replace(" ", ""); + + Execute.Assertion + .ForCondition(commandResultNoSpaces.Contains(pattern)) + .FailWith(AppendDiagnosticsTo($"The command output did not contain expected result: {pattern}{Environment.NewLine}")); + + return new AndConstraint(this); + } + public AndConstraint HaveStdOutContainingIgnoreCase(string pattern) { Execute.Assertion.ForCondition(_commandResult.StdOut.IndexOf(pattern, StringComparison.OrdinalIgnoreCase) >= 0) diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/ListPackageCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/ListPackageCommand.cs new file mode 100644 index 000000000..fba6d712a --- /dev/null +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/ListPackageCommand.cs @@ -0,0 +1,24 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.DotNet.Cli.Utils; + +namespace Microsoft.DotNet.Tools.Test.Utilities +{ + public sealed class ListPackageCommand : DotnetCommand + { + private string _path = null; + + public override CommandResult Execute(string args = "") + { + args = $"list {_path} package {args}"; + return base.ExecuteWithCapturedOutput(args); + } + + public ListPackageCommand WithPath(string path) + { + _path = path; + return this; + } + } +} diff --git a/test/dotnet-list-package.Tests/GivenDotnetListPackage.cs b/test/dotnet-list-package.Tests/GivenDotnetListPackage.cs new file mode 100644 index 000000000..03fc999ea --- /dev/null +++ b/test/dotnet-list-package.Tests/GivenDotnetListPackage.cs @@ -0,0 +1,262 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using FluentAssertions; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; +using Xunit.Abstractions; + +namespace Microsoft.DotNet.Cli.List.Package.Tests +{ + public class GivenDotnetListPackage : TestBase + { + private readonly ITestOutputHelper _output; + + public GivenDotnetListPackage(ITestOutputHelper output) + { + _output = output; + } + + [Fact] + public void RequestedAndResolvedVersionsMatch() + { + var testAsset = "TestAppSimple"; + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + var packageName = "Newtonsoft.Json"; + var packageVersion = "9.0.1"; + var cmd = new DotnetCommand() + .WithWorkingDirectory(projectDirectory) + .ExecuteWithCapturedOutput($"add package {packageName} --version {packageVersion}"); + cmd.Should().Pass(); + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr(); + + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr() + .And.HaveStdOutContainingIgnoreSpaces(packageName+packageVersion+packageVersion); + } + + [Fact] + public void AutoReferencedPackages() + { + var testAsset = "TestAppSimple"; + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr(); + + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr() + .And.HaveStdOutContainingIgnoreSpaces("Microsoft.NETCore.App(A)") + .And.HaveStdOutContainingIgnoreSpaces("(A):Auto-referencedpackage"); + } + + [Fact] + public void RunOnSolution() + { + var sln = "TestAppWithSlnAndSolutionFolders"; + var projectDirectory = TestAssets + .Get(sln) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr(); + + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr() + .And.HaveStdOutContainingIgnoreSpaces("Microsoft.NETCore.App"); + } + + [Fact] + public void AssetsPathExistsButNotRestored() + { + var testAsset = "NewtonSoftDependentProject"; + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute() + .Should() + .Pass() + .And.HaveStdErr(); + } + + [Fact] + public void TransitivePackagePrinted() + { + var testAsset = "NewtonSoftDependentProject"; + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr(); + + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr() + .And.NotHaveStdOutContaining("System.IO.FileSystem"); + + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute(args:"--include-transitive") + .Should() + .Pass() + .And.NotHaveStdErr() + .And.HaveStdOutContaining("System.IO.FileSystem"); + } + + [Theory] + [InlineData("", "[.NETFramework,Version=v4.5.1]", null)] + [InlineData("", "[.NETCoreApp,Version=v2.2]", null)] + [InlineData("--framework netcoreapp2.2 --framework net451", "[.NETFramework,Version=v4.5.1]", null)] + [InlineData("--framework netcoreapp2.2 --framework net451", "[.NETCoreApp,Version=v2.2]", null)] + [InlineData("--framework netcoreapp2.2", "[.NETCoreApp,Version=v2.2]", "[.NETFramework,Version=v4.5.1]")] + [InlineData("--framework net451", "[.NETFramework,Version=v4.5.1]", "[.NETCoreApp,Version=v2.2]")] + public void FrameworkSpecificList_Success(string args, string shouldInclude, string shouldntInclude) + { + var testAsset = "MSBuildAppWithMultipleFrameworks"; + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr(); + + if (shouldntInclude == null) + { + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute(args) + .Should() + .Pass() + .And.NotHaveStdErr() + .And.HaveStdOutContainingIgnoreSpaces(shouldInclude.Replace(" ", "")); + } + else + { + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute(args) + .Should() + .Pass() + .And.NotHaveStdErr() + .And.HaveStdOutContainingIgnoreSpaces(shouldInclude.Replace(" ", "")) + .And.NotHaveStdOutContaining(shouldntInclude.Replace(" ", "")); + } + + } + + [Fact] + public void FrameworkSpecificList_Fail() + { + var testAsset = "MSBuildAppWithMultipleFrameworks"; + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should() + .Pass(); + + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute("--framework invalid") + .Should() + .Fail(); + } + + [Fact] + public void FSharpProject() + { + var testAsset = "FSharpTestAppSimple"; + var projectDirectory = TestAssets + .Get(testAsset) + .CreateInstance() + .WithSourceFiles() + .Root + .FullName; + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr(); + + new ListPackageCommand() + .WithPath(projectDirectory) + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr(); + } + + } +} diff --git a/test/dotnet-list-package.Tests/MSBuild.exe b/test/dotnet-list-package.Tests/MSBuild.exe new file mode 100644 index 000000000..2b4d0f999 --- /dev/null +++ b/test/dotnet-list-package.Tests/MSBuild.exe @@ -0,0 +1 @@ +https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-list-package.Tests/MSBuild.exe.config b/test/dotnet-list-package.Tests/MSBuild.exe.config new file mode 100644 index 000000000..2b4d0f999 --- /dev/null +++ b/test/dotnet-list-package.Tests/MSBuild.exe.config @@ -0,0 +1 @@ +https://github.com/Microsoft/msbuild/issues/927 \ No newline at end of file diff --git a/test/dotnet-list-package.Tests/dotnet-list-package.Tests.csproj b/test/dotnet-list-package.Tests/dotnet-list-package.Tests.csproj new file mode 100644 index 000000000..fee23c6ec --- /dev/null +++ b/test/dotnet-list-package.Tests/dotnet-list-package.Tests.csproj @@ -0,0 +1,26 @@ + + + $(CliTargetFramework) + $(MicrosoftNETCoreAppPackageVersion) + true + dotnet-list-package.Tests + ../../tools/Key.snk + true + true + $(AssetTargetFallback);dotnet5.4;portable-net451+win8 + + + + + + + + + + + + + + + +