Update dotnet new template builder to match tooling preview 4 file structure

This commit is contained in:
SteveSandersonMS
2017-02-13 13:12:44 +00:00
parent 85dcc66723
commit fadc5d7b98
2 changed files with 20 additions and 18 deletions

View File

@@ -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