Browse Source

Configure download for the service template.

pull/570/head 0.7.1
Halil ibrahim Kalkan 8 years ago
parent
commit
a1d81ad949
  1. 1
      abp_io/src/Volo.AbpWebSite.Web/Pages/Templates.cshtml
  2. 3
      abp_io/src/Volo.AbpWebSite.Web/Pages/Templates.cshtml.cs
  3. 3
      abp_io/src/Volo.AbpWebSite.Web/Templates/MvcModuleTemplate.cs
  4. 17
      abp_io/src/Volo.AbpWebSite.Web/Templates/ServiceTemplate.cs
  5. 9
      abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/NugetReferenceReplaceStep.cs
  6. 2
      abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Github/GithubManager.cs
  7. 1
      abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/StandardVersions.cs

1
abp_io/src/Volo.AbpWebSite.Web/Pages/Templates.cshtml

@ -32,6 +32,7 @@
<select class="form-control" id="ProjectType" name="ProjectType">
<option value="MvcApp">ASP.NET Core Mvc Application</option>
<option value="MvcModule">ASP.NET Core Mvc Module</option>
<option value="Service">ASP.NET Core API Module (without UI)</option>
</select>
</div>

3
abp_io/src/Volo.AbpWebSite.Web/Pages/Templates.cshtml.cs

@ -63,6 +63,9 @@ namespace Volo.AbpWebSite.Pages
case "MvcModule":
DatabaseProvider = DatabaseProvider.Irrelevant;
return new MvcModuleTemplate(_configurationAccessor.Configuration);
case "Service":
DatabaseProvider = DatabaseProvider.Irrelevant;
return new ServiceTemplate(_configurationAccessor.Configuration);
case "MvcApp":
default:
return new MvcApplicationTemplate(_configurationAccessor.Configuration);

3
abp_io/src/Volo.AbpWebSite.Web/Templates/MvcModuleTemplate.cs

@ -1,5 +1,4 @@

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration;
using Volo.Utils.SolutionTemplating.Building;
namespace Volo.AbpWebSite.Templates

17
abp_io/src/Volo.AbpWebSite.Web/Templates/ServiceTemplate.cs

@ -0,0 +1,17 @@
using Microsoft.Extensions.Configuration;
using Volo.Utils.SolutionTemplating.Building;
namespace Volo.AbpWebSite.Templates
{
public class ServiceTemplate : TemplateInfo
{
public ServiceTemplate(IConfigurationRoot configuration)
: base(
"abp-service",
new GithubRepositoryInfo("abpframework/abp", configuration["GithubAccessToken"]),
"/templates/service")
{
}
}
}

9
abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Building/Steps/NugetReferenceReplaceStep.cs

@ -54,7 +54,14 @@ namespace Volo.Utils.SolutionTemplating.Building.Steps
doc.Load(GenerateStreamFromString(content));
return ProcessReferenceNodes(doc.DocumentNode.SelectNodes("//projectreference[@include]"), content);
var nodes = doc.DocumentNode.SelectNodes("//projectreference[@include]");
if (nodes == null)
{
return content;
}
return ProcessReferenceNodes(nodes, content);
}
private string ProcessReferenceNodes(HtmlNodeCollection nodes, string content)

2
abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/Github/GithubManager.cs

@ -15,7 +15,7 @@ namespace Volo.Utils.SolutionTemplating.Github
public string GetVersion(ProjectBuildContext context)
{
if (context.Request.Version.StartsWith("Branch:"))
if (context.Request.Version.StartsWith("Branch:", StringComparison.OrdinalIgnoreCase))
{
//TODO: Should not cache branch files!
return context.Request.Version.Substring("Branch:".Length);

1
abp_io/src/Volo.Utils.SolutionTemplating/Volo/Utils/SolutionTemplating/StandardVersions.cs

@ -3,6 +3,7 @@
public static class StandardVersions
{
public const string LatestStable = "LatestStable";
public const string LatestUnstable = "LatestUnstable";
}
}

Loading…
Cancel
Save