mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Update dotnet new template builder to match tooling preview 4 file structure
This commit is contained in:
@@ -139,12 +139,14 @@ function buildDotNetNewNuGetPackage() {
|
||||
{ from: /\s*<OutputPath.*?<\/OutputPath>/g, to: '' },
|
||||
];
|
||||
_.forEach(templates, (templateConfig, templateName) => {
|
||||
const templateOutputDir = path.join(outputRoot, 'templates', templateName);
|
||||
const templateOutputProjectDir = path.join(templateOutputDir, sourceProjectName);
|
||||
writeTemplate(templateConfig.dir, templateOutputProjectDir, contentReplacements, filenameReplacements, templateConfig.forceInclusion);
|
||||
const templateOutputDir = path.join(outputRoot, 'Content', templateName);
|
||||
writeTemplate(templateConfig.dir, templateOutputDir, contentReplacements, filenameReplacements, templateConfig.forceInclusion);
|
||||
|
||||
// Add a .netnew.json file
|
||||
fs.writeFileSync(path.join(templateOutputDir, '.netnew.json'), JSON.stringify({
|
||||
// Add the .template.config dir and its contents
|
||||
const templateConfigDir = path.join(templateOutputDir, '.template.config');
|
||||
mkdirp.sync(templateConfigDir);
|
||||
|
||||
fs.writeFileSync(path.join(templateConfigDir, 'template.json'), JSON.stringify({
|
||||
author: 'Microsoft',
|
||||
classifications: [ 'Standard>>Quick Starts' ],
|
||||
name: `ASP.NET Core SPA with ${templateConfig.displayName}`,
|
||||
@@ -155,6 +157,10 @@ function buildDotNetNewNuGetPackage() {
|
||||
guids: [ projectGuid ],
|
||||
sourceName: sourceProjectName
|
||||
}, null, 2));
|
||||
|
||||
fs.writeFileSync(path.join(templateConfigDir, 'dotnetcli.host.json'), JSON.stringify({
|
||||
symbolInfo: {}
|
||||
}, null, 2));
|
||||
});
|
||||
|
||||
// Invoke NuGet to create the final package
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Microsoft.AspNetCore.Spa.Templates</id>
|
||||
<version>{version}</version>
|
||||
<title>Class Library and Console Application Templates for .NET Core</title>
|
||||
<description>Single Page Application templates for ASP.NET Core</description>
|
||||
<authors>Microsoft</authors>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>My package description.</description>
|
||||
<dependencies>
|
||||
<group targetFramework=".NETCoreApp,Version=v1.0">
|
||||
<dependency id="Microsoft.TemplateEngine.Orchestrator.RunnableProjects" version="1.0.0" />
|
||||
</group>
|
||||
</dependencies>
|
||||
<language>en-US</language>
|
||||
<projectUrl>https://github.com/aspnet/javascriptservices</projectUrl>
|
||||
<licenseUrl>https://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm</licenseUrl>
|
||||
<packageTypes>
|
||||
<packageType name="Template" />
|
||||
</packageTypes>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="templates/**" />
|
||||
</files>
|
||||
</package>
|
||||
</package>
|
||||
|
||||
Reference in New Issue
Block a user