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/build/DependencyVersions.props b/build/DependencyVersions.props index ea428a8ba..96bacec45 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -46,7 +46,7 @@ 1.3.1 $(MicrosoftDotNetProjectJsonMigrationPackageVersion) 0.2.0-beta-63027-01 - 4.8.0-rtm.5362 + 4.9.0-preview3.5473 $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) $(NuGetBuildTasksPackageVersion) diff --git a/src/dotnet/CommonLocalizableStrings.resx b/src/dotnet/CommonLocalizableStrings.resx index d922c877f..967e72914 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 file to operate on. If a file is not specified, the command will search the current directory for one. + + + 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..6ac1f8866 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommand.cs @@ -0,0 +1,154 @@ +// 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.Cli.Utils; +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)); + } + + _fileOrDirectory = PathUtility.GetAbsolutePath(PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()), + appliedCommand.Arguments.Single()); + + _appliedCommand = appliedCommand["package"]; + } + + public override int Execute() + { + return NuGetCommand.Run(TransformArgs()); + } + + private string[] TransformArgs() + { + var args = new List + { + "package", + "list", + }; + + args.Add(GetProjectOrSolution()); + + args.AddRange(_appliedCommand.OptionValuesToBeForwarded()); + + if (_appliedCommand.HasOption("include-prerelease")) + { + CheckForOutdated("--include-prerelease"); + } + + if (_appliedCommand.HasOption("highest-patch")) + { + CheckForOutdated("--highest-patch"); + } + + if (_appliedCommand.HasOption("highest-minor")) + { + CheckForOutdated("--highest-minor"); + } + + if (_appliedCommand.HasOption("config")) + { + CheckForOutdated("--config"); + } + + if (_appliedCommand.HasOption("source")) + { + CheckForOutdated("--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 GracefulException(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; + + if (Directory.Exists(resultPath)) + { + 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 GracefulException(CommonLocalizableStrings.MoreThanOneSolutionInDirectory, resultPath); + } + //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 GracefulException(LocalizableStrings.NoProjectsOrSolutions, resultPath); + } + //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 GracefulException(CommonLocalizableStrings.MoreThanOneProjectInDirectory, resultPath); + } + } + } + + if (!File.Exists(resultPath)) + { + throw new GracefulException(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..b273db472 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/ListPackageReferencesCommandParser.cs @@ -0,0 +1,58 @@ +// 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.Collections.Generic; +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.NoArguments(), + CommonOptions.HelpOption(), + Create.Option("--outdated", + LocalizableStrings.CmdOutdatedDescription, + Accept.NoArguments().ForwardAs("--outdated")), + Create.Option("--framework", + LocalizableStrings.CmdFrameworkDescription, + Accept.OneOrMoreArguments() + .With(name: LocalizableStrings.CmdFramework) + .ForwardAsMany(o => ForwardedArguments("--framework", o.Arguments))), + Create.Option("--include-transitive", + LocalizableStrings.CmdTransitiveDescription, + Accept.NoArguments().ForwardAs("--include-transitive")), + Create.Option("--include-prerelease", + LocalizableStrings.CmdPrereleaseDescription, + Accept.NoArguments().ForwardAs("--include-prerelease")), + Create.Option("--highest-patch", + LocalizableStrings.CmdHighestPatchDescription, + Accept.NoArguments().ForwardAs("--highest-patch")), + Create.Option("--highest-minor", + LocalizableStrings.CmdHighestMinorDescription, + Accept.NoArguments().ForwardAs("--highest-minor")), + Create.Option("--config", + LocalizableStrings.CmdConfigDescription, + Accept.ExactlyOneArgument() + .With(name: LocalizableStrings.CmdConfig) + .ForwardAsMany(o => new [] { "--config", o.Arguments.Single() })), + Create.Option("--source", + LocalizableStrings.CmdSourceDescription, + Accept.OneOrMoreArguments() + .With(name: LocalizableStrings.CmdSource) + .ForwardAsMany(o => ForwardedArguments("--source", o.Arguments)))); + + private static IEnumerable ForwardedArguments(string token, IEnumerable arguments) + { + foreach (var arg in arguments) + { + yield return token; + yield return arg; + } + } + } +} 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..4726d960e --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/LocalizableStrings.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 package references of the project or solution. + + + 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. + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + CONFIG_FILE + + + The path to the NuGet config file to use. Requires the '--outdated' option. + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + SOURCE + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + Option '{0}' requires the '--outdated' option to be specified. + + + Could not find file or directory '{0}'. + + 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..b650b4dda --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.cs.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..d4488607f --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.de.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..a02426371 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.es.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..6b56420a8 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.fr.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..d59cadcac --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.it.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..77ca49f69 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ja.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + プロジェクトのすべてのプロジェクト間参照をリストします。 + + + + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..89f428b61 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ko.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 프로젝트의 모든 프로젝트 간 참조를 나열합니다. + + + + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..d16a26728 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pl.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..ed902a9ba --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.pt-BR.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..a98f7b680 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.ru.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + Вывод списка всех ссылок из одного проекта на другой. + + + + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..c8d7503d5 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.tr.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..7471c4f3a --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hans.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 列出项目的所有项目到项目引用。 + + + + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..9abbfc884 --- /dev/null +++ b/src/dotnet/commands/dotnet-list/dotnet-list-package/xlf/LocalizableStrings.zh-Hant.xlf @@ -0,0 +1,82 @@ + + + + + + List all package references of the project or solution. + 列出專案的所有專案對專案參考。 + + + + 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. + + + + A project or solution file could not be found in {0}. Specify a project or solution file to use. + A project or solution file could not be found in {0}. Specify a project or solution file to use. + + + + CONFIG_FILE + CONFIG_FILE + + + + The path to the NuGet config file to use. Requires the '--outdated' option. + The path to the NuGet config file to use. Requires the '--outdated' option. + + + + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major version number when searching for newer packages. Requires the '--outdated' option. + + + + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + Consider only the packages with a matching major and minor version numbers when searching for newer packages. Requires the '--outdated' option. + + + + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + Consider packages with prerelease versions when searching for newer packages. Requires the '--outdated' option. + + + + SOURCE + SOURCE + + + + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + The NuGet sources to use when searching for newer packages. Requires the '--outdated' option. + + + + Option '{0}' requires the '--outdated' option to be specified. + Option '{0}' requires the '--outdated' option to be specified. + + + + Could not find file or directory '{0}'. + Could not find file or directory '{0}'. + + + + + 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..6f2fceab0 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..38b4f5eb5 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..bc995bcb0 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..6546b6413 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..6463ac8a0 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..615af95a9 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..7062fdb43 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..d7adf7323 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..1bac8d564 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..6d54fb08f 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..050190c04 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..bacdb9138 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + 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..3c7fd9ece 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 file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. + + + + PROJECT | SOLUTION + PROJECT | SOLUTION + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Cli.Tests.sln b/test/Microsoft.DotNet.Cli.Tests.sln index c1ce1757e..2667b081f 100644 --- a/test/Microsoft.DotNet.Cli.Tests.sln +++ b/test/Microsoft.DotNet.Cli.Tests.sln @@ -93,6 +93,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-install-tool.Tests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InsertionTests", "InsertionTests\InsertionTests.csproj", "{A9713391-3D44-4664-9C41-75765218FD6C}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-list-package.Tests", "dotnet-list-package.Tests\dotnet-list-package.Tests.csproj", "{377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -607,6 +609,18 @@ Global {A9713391-3D44-4664-9C41-75765218FD6C}.Release|x64.Build.0 = Release|Any CPU {A9713391-3D44-4664-9C41-75765218FD6C}.Release|x86.ActiveCfg = Release|Any CPU {A9713391-3D44-4664-9C41-75765218FD6C}.Release|x86.Build.0 = Release|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Debug|x64.ActiveCfg = Debug|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Debug|x64.Build.0 = Debug|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Debug|x86.ActiveCfg = Debug|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Debug|x86.Build.0 = Debug|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Release|Any CPU.Build.0 = Release|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Release|x64.ActiveCfg = Release|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Release|x64.Build.0 = Release|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Release|x86.ActiveCfg = Release|Any CPU + {377363FE-0B87-4ACB-AEF3-3FF6454EC8D4}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE 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..8fbfcf51c --- /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 ItListsAutoReferencedPackages() + { + 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 ItRunOnSolution() + { + 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 ItListsTransitivePackage() + { + 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("", "[net451]", null)] + [InlineData("", "[netcoreapp2.2]", null)] + [InlineData("--framework netcoreapp2.2 --framework net451", "[net451]", null)] + [InlineData("--framework netcoreapp2.2 --framework net451", "[netcoreapp2.2]", null)] + [InlineData("--framework netcoreapp2.2", "[netcoreapp2.2]", "[net451]")] + [InlineData("--framework net451", "[net451]", "[netcoreapp2.2]")] + public void ItListsValidFrameworks(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 ItDoesNotAcceptInvalidFramework() + { + 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 ItListsFSharpProject() + { + 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/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 + + + + + + + + + + + + + + + + diff --git a/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs b/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs index 3590c57a2..9fd455460 100644 --- a/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs +++ b/test/dotnet-list-reference.Tests/GivenDotnetListReference.cs @@ -14,23 +14,24 @@ namespace Microsoft.DotNet.Cli.List.Reference.Tests { public class GivenDotnetListReference : TestBase { - private const string HelpText = @"Usage: dotnet list reference [options] + private const string HelpText = @"Usage: dotnet list reference [options] Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. Options: -h, --help Show command line help."; - private const string ListCommandHelpText = @"Usage: dotnet list [options] [command] + private const string ListCommandHelpText = @"Usage: dotnet list [options] [command] Arguments: - The project file to operate on. If a file is not specified, the command will search the current directory for one. + The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. Options: -h, --help Show command line help. Commands: + package List all package references of the project or solution. reference List all project-to-project references of the project."; const string FrameworkNet451Arg = "-f net451";