Skip to content

Commit a1d81ad

Browse files
committed
Configure download for the service template.
1 parent 2263cda commit a1d81ad

File tree

7 files changed

+32
-4
lines changed

7 files changed

+32
-4
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<select class="form-control" id="ProjectType" name="ProjectType">
3333
<option value="MvcApp">ASP.NET Core Mvc Application</option>
3434
<option value="MvcModule">ASP.NET Core Mvc Module</option>
35+
<option value="Service">ASP.NET Core API Module (without UI)</option>
3536
</select>
3637
</div>
3738

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

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ private TemplateInfo CreateTemplateInfo()
6363
case "MvcModule":
6464
DatabaseProvider = DatabaseProvider.Irrelevant;
6565
return new MvcModuleTemplate(_configurationAccessor.Configuration);
66+
case "Service":
67+
DatabaseProvider = DatabaseProvider.Irrelevant;
68+
return new ServiceTemplate(_configurationAccessor.Configuration);
6669
case "MvcApp":
6770
default:
6871
return new MvcApplicationTemplate(_configurationAccessor.Configuration);

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-

2-
using Microsoft.Extensions.Configuration;
1+
using Microsoft.Extensions.Configuration;
32
using Volo.Utils.SolutionTemplating.Building;
43

54
namespace Volo.AbpWebSite.Templates
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.Extensions.Configuration;
2+
using Volo.Utils.SolutionTemplating.Building;
3+
4+
namespace Volo.AbpWebSite.Templates
5+
{
6+
public class ServiceTemplate : TemplateInfo
7+
{
8+
public ServiceTemplate(IConfigurationRoot configuration)
9+
: base(
10+
"abp-service",
11+
new GithubRepositoryInfo("abpframework/abp", configuration["GithubAccessToken"]),
12+
"/templates/service")
13+
{
14+
15+
}
16+
}
17+
}

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ private string ProcessFileContent(string content)
5454

5555
doc.Load(GenerateStreamFromString(content));
5656

57-
return ProcessReferenceNodes(doc.DocumentNode.SelectNodes("//projectreference[@include]"), content);
57+
var nodes = doc.DocumentNode.SelectNodes("//projectreference[@include]");
58+
59+
if (nodes == null)
60+
{
61+
return content;
62+
}
63+
64+
return ProcessReferenceNodes(nodes, content);
5865
}
5966

6067
private string ProcessReferenceNodes(HtmlNodeCollection nodes, string content)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class GithubManager
1515

1616
public string GetVersion(ProjectBuildContext context)
1717
{
18-
if (context.Request.Version.StartsWith("Branch:"))
18+
if (context.Request.Version.StartsWith("Branch:", StringComparison.OrdinalIgnoreCase))
1919
{
2020
//TODO: Should not cache branch files!
2121
return context.Request.Version.Substring("Branch:".Length);

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

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
public static class StandardVersions
44
{
55
public const string LatestStable = "LatestStable";
6+
67
public const string LatestUnstable = "LatestUnstable";
78
}
89
}

0 commit comments

Comments
 (0)