Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made GetShortDescription methods static #20861

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Add a multi-package module to a solution by finding all packages of the module, " +
"finding related projects in the solution and adding each package to the corresponding project in the solution.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Add a new ABP package to a project by adding related NuGet package dependencies and [DependsOn(...)] attributes.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Builds a dotnet repository and dependent repositories or a solution.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
await BundlingService.BundleAsync(workingDirectory, forceBuild, projectType);
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Bundles all third party styles and scripts required by modules and updates index.html file.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Delete all BIN and OBJ folders in current folder.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Clears the templates download cache.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Update or remove ABP CLI. See https://abp.io/docs/latest/cli";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public string GetUsageInfo()
return string.Empty;
}

public string GetShortDescription()
public static string GetShortDescription()
{
return string.Empty;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override string GetUsageInfo()
return sb.ToString();
}

public override string GetShortDescription()
public static string GetShortDescription()
{
return "Generates client service proxies and DTOs to consume HTTP APIs.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Download the source code of the specified module.";
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -66,13 +67,13 @@

foreach (var command in AbpCliOptions.Commands.ToArray())
{
string shortDescription;

using (var scope = ServiceScopeFactory.CreateScope())
var method = command.Value.GetMethod("GetShortDescription", BindingFlags.Static | BindingFlags.Public);

Check warning on line 70 in framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs

View check run for this annotation

Codecov / codecov/patch

framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs#L70

Added line #L70 was not covered by tests
if (method == null)
{
shortDescription = ((IConsoleCommand)scope.ServiceProvider
.GetRequiredService(command.Value)).GetShortDescription();
continue;

Check warning on line 73 in framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs

View check run for this annotation

Codecov / codecov/patch

framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs#L73

Added line #L73 was not covered by tests
}

var shortDescription = (string) method.Invoke(null, null);

Check warning on line 76 in framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs

View check run for this annotation

Codecov / codecov/patch

framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/HelpCommand.cs#L76

Added line #L76 was not covered by tests

sb.Append(" > ");
sb.Append(command.Key);
Expand All @@ -91,7 +92,7 @@
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Show command line help. Write ` abp help <command> `";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ public interface IConsoleCommand
Task ExecuteAsync(CommandLineArgs commandLineArgs);

string GetUsageInfo();

string GetShortDescription();
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Install NPM Packages for MVC / Razor Pages and Blazor Server UI types.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public string GetUsageInfo()
return GetShortDescription();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "This is a internal command. Please run 'abp recreate-initial-migration' command in abp or volo root directory.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "List open source application modules";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Lists available templates to be created.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Sign in to " + CliUrls.AccountAbpIo + ".";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Show your login info.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public string GetUsageInfo()
return string.Empty;
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Sign out from " + CliUrls.AccountAbpIo + ".";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Generate a new solution based on the ABP startup templates.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Starts with prompt mode.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ public virtual string GetUsageInfo()
return sb.ToString();
}

public abstract string GetShortDescription();

public static class Options
{
public static class Module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override string GetUsageInfo()
return sb.ToString();
}

public override string GetShortDescription()
public static string GetShortDescription()
{
return "Remove client service proxies and DTOs to consume HTTP APIs.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Install, update, remove or start ABP Suite. See https://abp.io/suite.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private string GetWorkingDirectory(CommandLineArgs commandLineArgs)
return path;
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Changes all NuGet package references to local project references for all the .csproj files in the specified folder" +
" (and all its subfolders with any deep)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Switches packages to nightly preview ABP version.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Switches npm packages to pre-rc ABP version.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Switches packages to preview ABP version.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Switches packages to stable ABP version from preview version.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Mainly used to translate ABP's resources (JSON files) easier.";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public string GetUsageInfo()
return sb.ToString();
}

public string GetShortDescription()
public static string GetShortDescription()
{
return "Update all ABP related NuGet packages and NPM packages in a solution or project to the latest version.";
}
Expand Down
Loading