Skip to content

Commit

Permalink
Configure download for the service template.
Browse files Browse the repository at this point in the history
  • Loading branch information
hikalkan committed Oct 31, 2018
1 parent 2263cda commit a1d81ad
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions abp_io/src/Volo.AbpWebSite.Web/Pages/Templates.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
3 changes: 3 additions & 0 deletions abp_io/src/Volo.AbpWebSite.Web/Pages/Templates.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ private TemplateInfo CreateTemplateInfo()
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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration;
using Volo.Utils.SolutionTemplating.Building;

namespace Volo.AbpWebSite.Templates
Expand Down
17 changes: 17 additions & 0 deletions abp_io/src/Volo.AbpWebSite.Web/Templates/ServiceTemplate.cs
Original file line number Diff line number Diff line change
@@ -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")
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ private string ProcessFileContent(string content)

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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class GithubManager

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public static class StandardVersions
{
public const string LatestStable = "LatestStable";

public const string LatestUnstable = "LatestUnstable";
}
}

0 comments on commit a1d81ad

Please sign in to comment.