Merge branch 'dev'
|
@ -0,0 +1,15 @@
|
|||
# =============================================================================
|
||||
# https://EditorConfig.org
|
||||
# =============================================================================
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
|
||||
[*.{csproj,xml,yml}]
|
||||
indent_size = 2
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29318.209
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.Initializr", "src\Steeltoe.Initializr.csproj", "{945A8C33-08A6-4D07-A3B6-51D7802A4DC0}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.Initializr.WebApp", "src\Steeltoe.Initializr.WebApp\Steeltoe.Initializr.WebApp.csproj", "{945A8C33-08A6-4D07-A3B6-51D7802A4DC0}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{42A583D3-DB7F-49E9-A89B-58FE16391C6C}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
|
@ -11,13 +11,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{42A583
|
|||
stylecop.json = stylecop.json
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.Initializr.Tests", "tests\Steeltoe.Initializr.Tests.csproj", "{69971BFE-F4F4-42D2-8AC8-6D9723EBE09F}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Steeltoe.Initializr.WebApp.Test", "test\Steeltoe.Initializr.WebApp.Test\Steeltoe.Initializr.WebApp.Test.csproj", "{69971BFE-F4F4-42D2-8AC8-6D9723EBE09F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F9866E9A-16DD-4AAF-A43A-1E08001E9942}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
azure-pipelines.yml = azure-pipelines.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steeltoe.Initializr.TemplateEngine", "src\Steeltoe.Initializr.TemplateEngine\Steeltoe.Initializr.TemplateEngine.csproj", "{6FD3B4A0-5EF2-4C0C-A039-781B287338A1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Steeltoe.Initializr.TemplateEngine.Test", "test\Steeltoe.Initializr.TemplateEngine.Test\Steeltoe.Initializr.TemplateEngine.Test.csproj", "{60E5F7E7-B412-4E52-B9D0-4FCA04311EC2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -32,6 +36,14 @@ Global
|
|||
{69971BFE-F4F4-42D2-8AC8-6D9723EBE09F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{69971BFE-F4F4-42D2-8AC8-6D9723EBE09F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{69971BFE-F4F4-42D2-8AC8-6D9723EBE09F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6FD3B4A0-5EF2-4C0C-A039-781B287338A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6FD3B4A0-5EF2-4C0C-A039-781B287338A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6FD3B4A0-5EF2-4C0C-A039-781B287338A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6FD3B4A0-5EF2-4C0C-A039-781B287338A1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{60E5F7E7-B412-4E52-B9D0-4FCA04311EC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{60E5F7E7-B412-4E52-B9D0-4FCA04311EC2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{60E5F7E7-B412-4E52-B9D0-4FCA04311EC2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{60E5F7E7-B412-4E52-B9D0-4FCA04311EC2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -11,11 +11,13 @@ variables:
|
|||
solution: '**/*.sln'
|
||||
buildPlatform: 'Any CPU'
|
||||
buildConfiguration: 'Release'
|
||||
sourceDir: 'src/Steeltoe.Initializr.WebApp'
|
||||
templateDir: 'src/templates'
|
||||
|
||||
stages:
|
||||
- stage: Initializr_Website
|
||||
- stage: Initializr_Website
|
||||
jobs:
|
||||
- job: BuildTestAndPublishJob
|
||||
- job: BuildTestAndPublishJob
|
||||
displayName: Build Test and Publish to PWS
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
|
@ -53,7 +55,7 @@ stages:
|
|||
arguments: '-f netcoreapp2.2 -r ubuntu.14.04-x64'
|
||||
zipAfterPublish: false
|
||||
modifyOutputPath: false
|
||||
workingDirectory: 'src'
|
||||
workingDirectory: $(sourceDir)
|
||||
- task: CloudFoundryCLIInstall@0
|
||||
displayName: Install CF Cli
|
||||
inputs:
|
||||
|
@ -67,11 +69,11 @@ stages:
|
|||
org: 'steeltoe.io'
|
||||
space: 'steeltoe.io'
|
||||
deploymentOptions: 'manifest'
|
||||
cfManifest: 'src/manifest.yml'
|
||||
cfManifest: '$(sourceDir)/manifest.yml'
|
||||
additionalDeployArgs: '-p bin/Debug/netcoreapp2.2/ubuntu.14.04-x64/publish'
|
||||
createServices: false
|
||||
bindServices: false
|
||||
workingDirectory: 'src'
|
||||
workingDirectory: $(sourceDir)
|
||||
- task: CloudFoundry@1
|
||||
displayName: publish to Staging
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
|
||||
|
@ -81,20 +83,20 @@ stages:
|
|||
org: 'steeltoe.io'
|
||||
space: 'development'
|
||||
deploymentOptions: 'manifest'
|
||||
cfManifest: 'src/manifest-dev.yml'
|
||||
cfManifest: '$(sourceDir)/manifest-dev.yml'
|
||||
additionalDeployArgs: '-p bin/Debug/netcoreapp2.2/ubuntu.14.04-x64/publish'
|
||||
createServices: false
|
||||
bindServices: false
|
||||
workingDirectory: 'src'
|
||||
- stage: template_nugets
|
||||
workingDirectory: '$(sourceDir)'
|
||||
- stage: template_nugets
|
||||
jobs:
|
||||
- job: PackAndPublishNuget
|
||||
displayName: Build and Publish Template Nugets
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
steps:
|
||||
- script: 'cd templates/DotNetTemplating/2.x'
|
||||
|
||||
- script: 'cd $(templateDir)/DotNetTemplating/2.x'
|
||||
|
||||
- task: UseDotNet@2
|
||||
inputs:
|
||||
packageType: 'sdk'
|
||||
|
@ -103,12 +105,12 @@ stages:
|
|||
displayName: Dotnet build
|
||||
inputs:
|
||||
command: 'build'
|
||||
workingDirectory: 'templates/DotNetTemplating/2.x'
|
||||
workingDirectory: '$(templateDir)/DotNetTemplating/2.x'
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Dotnet pack
|
||||
inputs:
|
||||
command: 'pack'
|
||||
packagesToPack: 'templates/DotNetTemplating/2.x/TemplatePack.csproj'
|
||||
packagesToPack: '$(templateDir)/DotNetTemplating/2.x/TemplatePack.csproj'
|
||||
versioningScheme: 'off'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<Project>
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<NoWarn>SA1101;SA1124;SA1201;SA1309;SA1310;SA1401;SA1600;SA1652;1591;CS8002;TS1127</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="../stylecop.json">
|
||||
<AdditionalFiles Include="../../stylecop.json">
|
||||
<Link>stylecop.json</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</AdditionalFiles>
|
||||
|
|
|
@ -12,13 +12,11 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Steeltoe.Initializr.Services.Mustache;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services;
|
||||
|
||||
namespace Steeltoe.Initializr.Models
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Models
|
||||
{
|
||||
public class GeneratorModel
|
||||
{
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
namespace Steeltoe.Initializr.Models
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Models
|
||||
{
|
||||
public class ProjectDependency
|
||||
{
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Steeltoe.Initializr.Models
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Models
|
||||
{
|
||||
public class ProjectNameValidationAttribute : RegularExpressionAttribute
|
||||
{
|
|
@ -12,9 +12,9 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Steeltoe.Initializr.Services.Mustache;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services;
|
||||
|
||||
namespace Steeltoe.Initializr.Models
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Models
|
||||
{
|
||||
public class TemplateViewModel
|
||||
{
|
||||
|
@ -30,4 +30,4 @@ namespace Steeltoe.Initializr.Models
|
|||
|
||||
public TemplateVersion TemplateVersion { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// <autogenerated />
|
||||
// <autogenerated />
|
||||
// Doesn't follow stylecop rules; best to keep it similar to original from
|
||||
|
||||
using System;
|
||||
|
@ -14,7 +14,7 @@ using Microsoft.TemplateEngine.Edge.Mount.Archive;
|
|||
using Microsoft.TemplateEngine.Edge.Mount.FileSystem;
|
||||
using Microsoft.TemplateEngine.Edge.Settings;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.DotNetTemplateEngine
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.DotNetTemplateEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// Copy of https://github.com/dotnet/templating/blob/stabilize/src/Microsoft.TemplateEngine.Edge/Settings/ComponentManager.cs
|
||||
|
@ -89,7 +89,7 @@ namespace Steeltoe.Initializr.Services.DotNetTemplateEngine
|
|||
if (!ids.Contains(InitializrSettingsLoader.FactoryId))
|
||||
{
|
||||
ids.Add(InitializrSettingsLoader.FactoryId);
|
||||
|
||||
|
||||
Cache<IMountPointFactory>.Instance.AddPart(new FileSystemMountPointFactory());
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ using Microsoft.TemplateEngine.Edge.Settings;
|
|||
using Microsoft.TemplateEngine.Utils;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.DotNetTemplateEngine
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.DotNetTemplateEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// from: https://github.com/dotnet/templating/blob/master/src/Microsoft.TemplateEngine.Edge/Settings/SettingsLoader.cs
|
|
@ -12,7 +12,7 @@ using Microsoft.TemplateEngine.Utils;
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.DotNetTemplateEngine
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.DotNetTemplateEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// From: https://github.com/dotnet/templating/blob/master/src/Microsoft.TemplateEngine.Edge/Settings/TemplateCache.cs
|
|
@ -6,7 +6,7 @@ using Microsoft.TemplateEngine.Abstractions;
|
|||
using Microsoft.TemplateEngine.Abstractions.Mount;
|
||||
using Microsoft.TemplateEngine.Utils;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.DotNetTemplateEngine
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.DotNetTemplateEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// from: https://github.com/dotnet/templating/blob/master/src/Microsoft.TemplateEngine.Edge/Settings/MountPointManager.cs
|
|
@ -12,6 +12,12 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
@ -19,16 +25,9 @@ using Microsoft.TemplateEngine.Abstractions;
|
|||
using Microsoft.TemplateEngine.Edge.Settings;
|
||||
using Microsoft.TemplateEngine.Edge.Template;
|
||||
using Microsoft.TemplateEngine.Utils;
|
||||
using Steeltoe.Initializr.Models;
|
||||
using Steeltoe.Initializr.Services.Mustache;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Steeltoe.Initializr.TemplateEngine.Models;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.DotNetTemplateEngine
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.DotNetTemplateEngine
|
||||
{
|
||||
public class TemplateService : ITemplateService
|
||||
{
|
||||
|
@ -273,4 +272,4 @@ namespace Steeltoe.Initializr.Services.DotNetTemplateEngine
|
|||
return FriendlyNames?.ContainsKey(name) == true ? FriendlyNames[name] : name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,12 +12,11 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Steeltoe.Initializr.Models;
|
||||
using Steeltoe.Initializr.Services.Mustache;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Steeltoe.Initializr.TemplateEngine.Models;
|
||||
|
||||
namespace Steeltoe.Initializr.Services
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services
|
||||
{
|
||||
public interface ITemplateService
|
||||
{
|
||||
|
@ -31,4 +30,4 @@ namespace Steeltoe.Initializr.Services
|
|||
|
||||
void ClearCache();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,14 +12,13 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.Utilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.TemplateEngine.Utilities;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions
|
||||
{
|
||||
public class AnyExpression : IExpression
|
||||
{
|
||||
|
@ -41,9 +40,9 @@ namespace Steeltoe.Initializr.Services.Mustache
|
|||
{
|
||||
var keys = _param.Expression.Split(',');
|
||||
return dataView => dataView.Any(kvp =>
|
||||
keys.Contains(kvp.Key)
|
||||
&& bool.TryParse(kvp.Value.ToString(), out var boolValue)
|
||||
&& boolValue).ToString();
|
||||
keys.Contains(kvp.Key)
|
||||
&& bool.TryParse(kvp.Value.ToString(), out var boolValue)
|
||||
&& boolValue).ToString();
|
||||
}
|
||||
}
|
||||
|
|
@ -12,17 +12,17 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Scripting;
|
||||
using Microsoft.CodeAnalysis.Scripting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.Utilities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Scripting;
|
||||
using Microsoft.CodeAnalysis.Scripting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.TemplateEngine.Utilities;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions
|
||||
{
|
||||
/// <summary>
|
||||
/// Build a boolean Expression from string notation
|
|
@ -12,13 +12,13 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.Utilities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.TemplateEngine.Utilities;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions
|
||||
{
|
||||
public class CaseExpression : IExpression
|
||||
{
|
|
@ -15,7 +15,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions
|
||||
{
|
||||
public delegate string EvaluationExpression(Dictionary<string, string> dataView);
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions
|
||||
{
|
||||
public class InclusionExpression
|
||||
{
|
|
@ -12,14 +12,13 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.Utilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.TemplateEngine.Utilities;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions
|
||||
{
|
||||
public class MoreThanOneExpression : IExpression
|
||||
{
|
|
@ -12,15 +12,15 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.CodeAnalysis.CSharp.Scripting;
|
||||
using Microsoft.CodeAnalysis.Scripting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.Utilities;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis.CSharp.Scripting;
|
||||
using Microsoft.CodeAnalysis.Scripting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.TemplateEngine.Utilities;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions
|
||||
{
|
||||
public class StringExpression : IExpression
|
||||
{
|
|
@ -12,16 +12,17 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.Models;
|
||||
using Steeltoe.Initializr.Utilities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.TemplateEngine.Models;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions;
|
||||
using Steeltoe.Initializr.TemplateEngine.Utilities;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache
|
||||
{
|
||||
public class MustacheConfig
|
||||
{
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache
|
||||
{
|
||||
public class MustacheConfigSchema
|
||||
{
|
|
@ -12,13 +12,6 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.Models;
|
||||
using Steeltoe.Initializr.Utilities;
|
||||
using Stubble.Core;
|
||||
using Stubble.Core.Builders;
|
||||
using Stubble.Extensions.JsonNet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
@ -26,8 +19,15 @@ using System.IO.Compression;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.TemplateEngine.Models;
|
||||
using Steeltoe.Initializr.TemplateEngine.Utilities;
|
||||
using Stubble.Core;
|
||||
using Stubble.Core.Builders;
|
||||
using Stubble.Extensions.JsonNet;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache
|
||||
{
|
||||
/// <summary>
|
||||
/// An implementation of a Dotnet Template service via Mustache (Stubble).
|
||||
|
@ -193,10 +193,4 @@ namespace Steeltoe.Initializr.Services.Mustache
|
|||
return FriendlyNames?.ContainsKey(name) == true ? FriendlyNames[name] : name;
|
||||
}
|
||||
}
|
||||
|
||||
public enum TemplateVersion
|
||||
{
|
||||
V2,
|
||||
V3,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,14 +12,15 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Newtonsoft.Json;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services.Mustache.Expressions;
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache
|
||||
{
|
||||
public class MustacheTemplateSettings
|
||||
{
|
||||
|
@ -106,4 +107,4 @@ namespace Steeltoe.Initializr.Services.Mustache
|
|||
return evalExpressions;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache
|
||||
{
|
||||
public class SourceFile
|
||||
{
|
|
@ -12,7 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
namespace Steeltoe.Initializr.Services.Mustache
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services.Mustache
|
||||
{
|
||||
public class TemplateKey
|
||||
{
|
||||
|
@ -36,4 +36,4 @@ namespace Steeltoe.Initializr.Services.Mustache
|
|||
return obj is TemplateKey key && (Name.Equals(key.Name) && Version.Equals(key.Version));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2020 the original author or authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Services
|
||||
{
|
||||
public enum TemplateVersion
|
||||
{
|
||||
V2,
|
||||
V3,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\shared.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="$(ProjectDir)..\templates\**\*.*" Exclude="$(ProjectDir)..\templates\**\TemplatePack.csproj;$(ProjectDir)..\templates\**\TemplatePack.sln;$(ProjectDir)..\templates\**\bin\**;$(ProjectDir)..\templates\**\obj\**;">
|
||||
<Link>templates\%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.TemplateEngine.Edge" Version="0.2.3-alpha" />
|
||||
<PackageReference Include="Microsoft.TemplateEngine.Orchestrator.RunnableProjects" Version="0.2.1-alpha" />
|
||||
<PackageReference Include="Stubble.Core" Version="1.2.7" />
|
||||
<PackageReference Include="Stubble.Extensions.JsonNet" Version="1.0.18" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -12,12 +12,12 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Steeltoe.Initializr.Utilities
|
||||
namespace Steeltoe.Initializr.TemplateEngine.Utilities
|
||||
{
|
||||
public class Timing : IDisposable
|
||||
{
|
До Ширина: | Высота: | Размер: 55 KiB После Ширина: | Высота: | Размер: 55 KiB |
До Ширина: | Высота: | Размер: 4.6 KiB После Ширина: | Высота: | Размер: 4.6 KiB |
До Ширина: | Высота: | Размер: 8.1 KiB После Ширина: | Высота: | Размер: 8.1 KiB |
|
@ -13,30 +13,26 @@
|
|||
// limitations under the License.
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Steeltoe.Initializr.Models;
|
||||
using Steeltoe.Initializr.Services;
|
||||
using Steeltoe.Initializr.Services.Mustache;
|
||||
using System;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services.Mustache;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Steeltoe.Initializr.Controllers
|
||||
namespace Steeltoe.Initializr.WebApp.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class HomeController : ControllerBase
|
||||
{
|
||||
private const string LOGO = @" (
|
||||
)\ ) ) ( )
|
||||
(()/( ( /( ( ( )\ ( /( (
|
||||
/(_)))\()) ))\ ))\((_))\()) ( ))\
|
||||
____ (_)) (_))/ /((_)/((_)_ (_))/ )\ /((_)__ __ __
|
||||
/ /\ \ / __|| |_ (_)) (_)) | || |_ ((_)(_)) \ \\ \\ \
|
||||
< < > > \__ \| _|/ -_)/ -_)| || _|/ _ \/ -_) > >> >> >
|
||||
\_\/_/ |___/ \__|\___|\___||_| \__|\___/\___| /_//_//_/
|
||||
private const string LOGO = @" (
|
||||
)\ ) ) ( )
|
||||
(()/( ( /( ( ( )\ ( /( (
|
||||
/(_)))\()) ))\ ))\((_))\()) ( ))\
|
||||
____ (_)) (_))/ /((_)/((_)_ (_))/ )\ /((_)__ __ __
|
||||
/ /\ \ / __|| |_ (_)) (_)) | || |_ ((_)(_)) \ \\ \\ \
|
||||
< < > > \__ \| _|/ -_)/ -_)| || _|/ _ \/ -_) > >> >> >
|
||||
\_\/_/ |___/ \__|\___|\___||_| \__|\___/\___| /_//_//_/
|
||||
";
|
||||
|
||||
private readonly MustacheTemplateService _templateService;
|
||||
|
@ -62,15 +58,15 @@ namespace Steeltoe.Initializr.Controllers
|
|||
private string GetExamples()
|
||||
{
|
||||
return @"
|
||||
Get Dependencies:
|
||||
Get Dependencies:
|
||||
curl https://start.steeltoe.io/api/templates/dependencies | jq .
|
||||
|
||||
Get Versions:
|
||||
curl https://start.steeeltoe.io/api/templates/templates | jq .
|
||||
|
||||
Get project:
|
||||
Get project:
|
||||
curl https://start.steeltoe.io/starter.zip -d dependencies=actuators,cloudfoundry -o myProject.zip
|
||||
|
||||
|
||||
curl https://start.steeltoe.io/starter.zip -d dependencies=actuators,cloudfoundry -d templateShortName=Steeltoe-React -d targetFrameworkVersion=netcoreapp3.1 -d projectName=MyCompany.MySample -o myProject.zip
|
||||
";
|
||||
}
|
|
@ -15,12 +15,9 @@
|
|||
using Microsoft.AspNetCore.Mvc.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc.ActionConstraints;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Steeltoe.Initializr.Controllers
|
||||
namespace Steeltoe.Initializr.WebApp.Controllers
|
||||
{
|
||||
public class IsCurlRequestAttribute : ActionMethodSelectorAttribute
|
||||
{
|
|
@ -13,9 +13,9 @@
|
|||
// limitations under the License.
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Steeltoe.Initializr.Models;
|
||||
using Steeltoe.Initializr.Services;
|
||||
using Steeltoe.Initializr.Services.Mustache;
|
||||
using Steeltoe.Initializr.TemplateEngine.Models;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services.Mustache;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -23,7 +23,7 @@ using System.Net;
|
|||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Steeltoe.Initializr.Controllers
|
||||
namespace Steeltoe.Initializr.WebApp.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
|
@ -15,7 +15,7 @@
|
|||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace Steeltoe.Initializr
|
||||
namespace Steeltoe.Initializr.WebApp
|
||||
{
|
||||
public static class Program
|
||||
{
|
|
@ -21,11 +21,11 @@ using Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer;
|
|||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Steeltoe.Initializr.Services;
|
||||
using Steeltoe.Initializr.Services.DotNetTemplateEngine;
|
||||
using Steeltoe.Initializr.Services.Mustache;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services.DotNetTemplateEngine;
|
||||
using Steeltoe.Initializr.TemplateEngine.Services.Mustache;
|
||||
|
||||
namespace Steeltoe.Initializr
|
||||
namespace Steeltoe.Initializr.WebApp
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
|
@ -99,4 +99,4 @@ namespace Steeltoe.Initializr
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Import Project="..\shared.props" />
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Import Project="..\..\shared.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
|
||||
|
@ -17,47 +17,40 @@
|
|||
<Content Remove="$(SpaRoot)**" />
|
||||
<None Remove="$(SpaRoot)**" />
|
||||
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
||||
|
||||
<None Include="$(ProjectDir)..\templates\**\*.*" Exclude="$(ProjectDir)..\templates\**\TemplatePack.csproj;$(ProjectDir)..\templates\**\TemplatePack.sln;$(ProjectDir)..\templates\**\bin\**;$(ProjectDir)..\templates\**\obj\**;">
|
||||
<Link>templates\%(RecursiveDir)%(Filename)%(Extension)</Link>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
|
||||
</None>
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="C:\Users\Hananiel\projects\SteeltoeOSS\initializr\src\..\templates\DotNetTemplating\2.x\.vs\TemplatePack\**" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.TemplateEngine.Edge" Version="0.2.3-alpha" />
|
||||
<PackageReference Include="Microsoft.TemplateEngine.Orchestrator.RunnableProjects" Version="0.2.1-alpha" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
<PackageReference Include="Stubble.Core" Version="1.2.7" />
|
||||
<PackageReference Include="Stubble.Extensions.JsonNet" Version="1.0.18" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Steeltoe.Initializr.TemplateEngine\Steeltoe.Initializr.TemplateEngine.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
Make sure any documentation comments which are included in code get checked for syntax during the build, but do
|
||||
not report warnings for missing comments.
|
||||
|
||||
|
||||
CS1573: Parameter 'parameter' has no matching param tag in the XML comment for 'parameter' (but other parameters do)
|
||||
CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member'
|
||||
-->
|
||||
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
|
||||
<NoWarn>$(NoWarn),1573,1591,1712</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
|
||||
<!-- Ensure Node.js is installed -->
|
||||
<Exec Command="node --version" ContinueOnError="true">
|
||||
|
@ -69,9 +62,9 @@
|
|||
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
|
||||
</Exec>
|
||||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
|
||||
|
||||
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
|
||||
<Exec Command="node --version" ContinueOnError="true">
|
||||
|
@ -93,7 +86,7 @@
|
|||
</ResolvedFileToPublish>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
<ProjectExtensions><VisualStudio><UserProperties /></VisualStudio></ProjectExtensions>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Steeltoe.Initializr.WebApp</name>
|
||||
</assembly>
|
||||
<members>
|
||||
</members>
|
||||
</doc>
|
|
@ -1,11 +1,9 @@
|
|||
---
|
||||
---
|
||||
applications:
|
||||
- name: startsteeltoe-stage
|
||||
buildpacks:
|
||||
- dotnet_core_buildpack
|
||||
memory: 1024M
|
||||
command: cd ${HOME} && ./Steeltoe.Initializr
|
||||
command: cd ${HOME} && ./Steeltoe.Initializr.WebApp
|
||||
env:
|
||||
ASPNETCORE_ENVIRONMENT: Production
|
||||
services:
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Steeltoe.Initializr</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Steeltoe.Initializr.Services.DotNetTemplateEngine.InitializrComponentManager">
|
||||
<summary>
|
||||
Copy of https://github.com/dotnet/templating/blob/stabilize/src/Microsoft.TemplateEngine.Edge/Settings/ComponentManager.cs
|
||||
Internal class and used by <see cref="T:Steeltoe.Initializr.Services.DotNetTemplateEngine.InitializrSettingsLoader"/>
|
||||
No changes made
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Steeltoe.Initializr.Services.DotNetTemplateEngine.InitializrSettingsLoader">
|
||||
<summary>
|
||||
from: https://github.com/dotnet/templating/blob/master/src/Microsoft.TemplateEngine.Edge/Settings/SettingsLoader.cs
|
||||
Needed a new method to rebuild Cache from settings
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Steeltoe.Initializr.Services.DotNetTemplateEngine.InitializrTemplateCache">
|
||||
<summary>
|
||||
From: https://github.com/dotnet/templating/blob/master/src/Microsoft.TemplateEngine.Edge/Settings/TemplateCache.cs
|
||||
Need access to the Write Template Cache methods
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Steeltoe.Initializr.Services.DotNetTemplateEngine.InitializrMountPointManager">
|
||||
<summary>
|
||||
from: https://github.com/dotnet/templating/blob/master/src/Microsoft.TemplateEngine.Edge/Settings/MountPointManager.cs
|
||||
Need access to internal class
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Steeltoe.Initializr.Services.Mustache.BooleanExpression">
|
||||
<summary>
|
||||
Build a boolean Expression from string notation
|
||||
for example A || B && C
|
||||
where A, B, C are parameters provided earlier in the context.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:Steeltoe.Initializr.Services.Mustache.MustacheTemplateService">
|
||||
<summary>
|
||||
An implementation of a Dotnet Template service via Mustache (Stubble).
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
До Ширина: | Высота: | Размер: 2.4 KiB После Ширина: | Высота: | Размер: 2.4 KiB |
До Ширина: | Высота: | Размер: 523 B После Ширина: | Высота: | Размер: 523 B |
До Ширина: | Высота: | Размер: 31 KiB После Ширина: | Высота: | Размер: 31 KiB |