Added version option while creating a new solution

pull/1557/head
Halil İbrahim Kalkan 6 years ago
parent 2a7c482f31
commit 4a2cd6c661

@ -46,6 +46,7 @@ namespace Volo.Abp.Cli.Commands
new ProjectBuildArgs(
SolutionName.Parse(commandLineArgs.Target),
commandLineArgs.Options.GetOrNull(Options.Template.Short, Options.Template.Long),
commandLineArgs.Options.GetOrNull(Options.Version.Short, Options.Version.Long),
GetDatabaseProviderOrNull(commandLineArgs),
commandLineArgs.Options
)
@ -111,13 +112,14 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(" abp new <project-name> [-t|--template] [-d|--database-provider] [-o|--output-folder]");
sb.AppendLine("");
sb.AppendLine("Options:");
sb.AppendLine("-t|--template <template-name>");
sb.AppendLine("-o|--output-folder <output-folder>");
sb.AppendLine("-t|--template <template-name> (default: app)");
sb.AppendLine("-o|--output-folder <output-folder> (default: current folder)");
sb.AppendLine("-v|--version <version> (default: latest version)");
sb.AppendLine("-d|--database-provider <database-provider> (if supported by the template)");
sb.AppendLine("--tiered (if supported by the template)");
sb.AppendLine("--no-ui (if supported by the template)");
sb.AppendLine("");
sb.AppendLine("Some examples:");
sb.AppendLine("Examples:");
sb.AppendLine(" abp new Acme.BookStore");
sb.AppendLine(" abp new Acme.BookStore --tiered");
sb.AppendLine(" abp new Acme.BookStore -t mvc-module");
@ -169,6 +171,12 @@ namespace Volo.Abp.Cli.Commands
public const string Short = "o";
public const string Long = "output-folder";
}
public static class Version
{
public const string Short = "v";
public const string Long = "version";
}
}
}
}

@ -7,9 +7,9 @@ namespace Volo.Abp.Cli.Http
{
public class CliHttpClient : HttpClient
{
public CliHttpClient() : base(new CliHttpClientHandler())
public CliHttpClient(TimeSpan? timeout = null) : base(new CliHttpClientHandler())
{
Timeout = TimeSpan.FromSeconds(30);
Timeout = timeout ?? TimeSpan.FromMinutes(1);
AddAuthentication(this);
}

@ -102,7 +102,7 @@ namespace Volo.Abp.Cli.ProjectBuilding
{
var postData = JsonSerializer.Serialize(input);
using (var client = new CliHttpClient())
using (var client = new CliHttpClient(TimeSpan.FromMinutes(10)))
{
var responseMessage = await client.PostAsync(
$"{CliUrls.WwwAbpIo}api/download/template/",

@ -18,7 +18,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps
string projectFolderPath = null)
{
_projectName = projectName;
_solutionFilePath = solutionFilePath ?? "/MyCompanyName.MyProjectName.sln";
_solutionFilePath = solutionFilePath ?? "/aspnet-core/MyCompanyName.MyProjectName.sln";
_projectFolderPath = projectFolderPath ?? ("/aspnet-core/src/" + projectName);
}

@ -1,21 +0,0 @@
using System;
using Newtonsoft.Json;
namespace Volo.Abp.Cli.ProjectBuilding.Github
{
[JsonObject]
public class GithubRelease
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("prerelease")]
public bool IsPrerelease { get; set; }
[JsonProperty("published_at")]
public DateTime PublishTime { get; set; }
}
}

@ -12,6 +12,9 @@ namespace Volo.Abp.Cli.ProjectBuilding
[CanBeNull]
public string TemplateName { get; set; }
[CanBeNull]
public string Version { get; set; }
public DatabaseProvider DatabaseProvider { get; set; }
[NotNull]
@ -20,13 +23,14 @@ namespace Volo.Abp.Cli.ProjectBuilding
public ProjectBuildArgs(
[NotNull] SolutionName solutionName,
[CanBeNull] string templateName = null,
[CanBeNull] string version = null,
DatabaseProvider databaseProvider = DatabaseProvider.NotSpecified,
Dictionary<string, string> extraProperties = null)
{
DatabaseProvider = databaseProvider;
TemplateName = templateName;
SolutionName = Check.NotNull(solutionName, nameof(solutionName));
TemplateName = templateName;
Version = version;
DatabaseProvider = databaseProvider;
ExtraProperties = extraProperties ?? new Dictionary<string, string>();
}
}

@ -1,9 +1,10 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Cli.ProjectBuilding.Analyticses;
using Volo.Abp.Cli.ProjectBuilding.Building;
using Volo.Abp.DependencyInjection;
@ -53,7 +54,8 @@ namespace Volo.Abp.Cli.ProjectBuilding
var templateFile = await TemplateStore.GetAsync(
args.TemplateName,
args.DatabaseProvider,
args.SolutionName.FullName
args.SolutionName.FullName,
args.Version
);
var context = new ProjectBuildContext(

Loading…
Cancel
Save