diff --git a/build/NuSpecs/UmbracoCms.SqlCe.nuspec b/build/NuSpecs/UmbracoCms.SqlCe.nuspec index 184928f127..02c3dff9b9 100644 --- a/build/NuSpecs/UmbracoCms.SqlCe.nuspec +++ b/build/NuSpecs/UmbracoCms.SqlCe.nuspec @@ -24,21 +24,20 @@ not want this to happen as the alpha of the next major is, really, the next major already. --> - - - + - + + - + - + diff --git a/build/NuSpecs/UmbracoCms.Web.nuspec b/build/NuSpecs/UmbracoCms.Web.nuspec index dcbc547b6d..3ba1fa3573 100644 --- a/build/NuSpecs/UmbracoCms.Web.nuspec +++ b/build/NuSpecs/UmbracoCms.Web.nuspec @@ -30,10 +30,9 @@ - - + - + diff --git a/build/build.ps1 b/build/build.ps1 index aa8b93bf64..4b06cbaebb 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -183,7 +183,7 @@ $this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI.NetCore\Config", "*", "$($this.BuildTemp)\WebApp\config") $this.RemoveFile("$($this.BuildTemp)\WebApp\Config\*.Release.*") $this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI.NetCore\Umbraco", "*", "$($this.BuildTemp)\WebApp\umbraco") - $excludeUmbracoDirs = @("$($this.BuildTemp)\WebApp\umbraco\config","$($this.BuildTemp)\WebApp\umbraco\lib") + $excludeUmbracoDirs = @("$($this.BuildTemp)\WebApp\umbraco\lib") $this.RemoveDirectory($excludeUmbracoDirs) $this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI.NetCore\Views", "*", "$($this.BuildTemp)\WebApp\Views") Copy-Item "$($this.SolutionRoot)\src\Umbraco.Web.UI.NetCore\appsettings.json" "$($this.BuildTemp)\WebApp" @@ -262,6 +262,7 @@ $src = "$($this.SolutionRoot)\src" $tmp = "$($this.BuildTemp)" $out = "$($this.BuildOutput)" + $templates = "$($this.SolutionRoot)\build\templates" $buildConfiguration = "Release" @@ -282,6 +283,7 @@ mkdir "$tmp\Configs" > $null mkdir "$tmp\Configs\Lang" > $null mkdir "$tmp\WebApp\App_Data" > $null + mkdir "$tmp\Templates" > $null #mkdir "$tmp\WebApp\Media" > $null #mkdir "$tmp\WebApp\Views" > $null @@ -326,10 +328,25 @@ $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\wwwroot\umbraco\js", "*", "$tmp\WebApp\wwwroot\umbraco\js") $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\wwwroot\umbraco\lib", "*", "$tmp\WebApp\wwwroot\umbraco\lib") $this.CopyFiles("$src\Umbraco.Web.UI.NetCore\wwwroot\umbraco\views", "*", "$tmp\WebApp\wwwroot\umbraco\views") + + + + # Prepare templates + Write-Host "Copy template files" + $this.CopyFiles("$templates", "*", "$tmp\Templates") + + Write-Host "Copy program.cs and startup.cs for templates" + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "Program.cs", "$tmp\Templates\UmbracoSolution") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "Startup.cs", "$tmp\Templates\UmbracoSolution") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "appsettings.json", "$tmp\Templates\UmbracoSolution") + $this.CopyFiles("$src\Umbraco.Web.UI.NetCore", "appsettings.Development.json", "$tmp\Templates\UmbracoSolution") + + $this.RemoveDirectory("$tmp\Templates\UmbracoSolution\bin") }) $ubuild.DefineMethod("PackageZip", { + Write-Host "Create Zip packages" $src = "$($this.SolutionRoot)\src" @@ -392,6 +409,7 @@ $ubuild.DefineMethod("PackageNuGet", { $nuspecs = "$($this.SolutionRoot)\build\NuSpecs" + $templates = "$($this.BuildTemp)\Templates" Write-Host "Create NuGet packages" @@ -419,6 +437,12 @@ -Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cmssqlce.log" if (-not $?) { throw "Failed to pack NuGet UmbracoCms.SqlCe." } + &$this.BuildEnv.NuGet Pack "$templates\Umbraco.Templates.nuspec" ` + -Properties BuildTmp="$($this.BuildTemp)" ` + -Version "$($this.Version.Semver.ToString())" ` + -Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.templates.log" + if (-not $?) { throw "Failed to pack NuGet Umbraco.Templates." } + # run hook if ($this.HasMethod("PostPackageNuGet")) { diff --git a/build/templates/Umbraco.Templates.nuspec b/build/templates/Umbraco.Templates.nuspec new file mode 100644 index 0000000000..6a559d190e --- /dev/null +++ b/build/templates/Umbraco.Templates.nuspec @@ -0,0 +1,20 @@ + + + + Umbraco.Templates + 1.0.0 + Umbraco HQ + Umbraco HQ + MIT + https://umbraco.com/ + https://umbraco.com/dist/nuget/logo-small.png + false + Umbraco Cms templates for .NET Core Template Engine available through the dotnet CLI's new command + en-US + umbraco + + + + + + diff --git a/build/templates/UmbracoSolution/.template.config/template.json b/build/templates/UmbracoSolution/.template.config/template.json new file mode 100644 index 0000000000..7d0a22ee25 --- /dev/null +++ b/build/templates/UmbracoSolution/.template.config/template.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Umbraco HQ", + "classifications": [ "Web", "CMS", "Umbraco"], + "identity": "Umbraco.Templates", + "name": "Umbraco - Empty Solution", + "shortName": "umbraco", + "tags": { + "language": "C#", + "type": "project" + }, + "sourceName": "UmbracoSolution", // Will be replaced with the value provided via -n + "preferNameDirectory": true, + "symbols": { + "version": { + "type": "parameter", + "datatype": "string", + "defaultValue": "9.0.0", + "description": "The version of Umbraco to load using NuGet", + "replaces": "UMBRACO_VERSION_FROM_TEMPLATE" + }, + "namespaceReplacer": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "name", + "defaultValue": "UmbracoSolution", + "fallbackVariableName": "name" + }, + "replaces":"Umbraco.Web.UI.NetCore" + }, + "UseSqlCe":{ + "type": "parameter", + "datatype":"bool", + "defaultValue": "false" + } + } +} diff --git a/build/templates/UmbracoSolution/UmbracoSolution.csproj b/build/templates/UmbracoSolution/UmbracoSolution.csproj new file mode 100644 index 0000000000..2eff0931f3 --- /dev/null +++ b/build/templates/UmbracoSolution/UmbracoSolution.csproj @@ -0,0 +1,13 @@ + + + + netcoreapp3.1 + + + + + + + + + diff --git a/src/Umbraco.Tests.Integration/TestServerTest/UmbracoWebApplicationFactory.cs b/src/Umbraco.Tests.Integration/TestServerTest/UmbracoWebApplicationFactory.cs index e74cb15ba0..ea2b64c790 100644 --- a/src/Umbraco.Tests.Integration/TestServerTest/UmbracoWebApplicationFactory.cs +++ b/src/Umbraco.Tests.Integration/TestServerTest/UmbracoWebApplicationFactory.cs @@ -20,7 +20,7 @@ using Umbraco.Core.Mapping; using Umbraco.Core.Models.Membership; using Umbraco.Core.Services; using Umbraco.Web.Common.Security; -using Umbraco.Web.UI.BackOffice; +using Umbraco.Web.UI.NetCore; namespace Umbraco.Tests.Integration.TestServerTest { diff --git a/src/Umbraco.Web.UI.NetCore/Program.cs b/src/Umbraco.Web.UI.NetCore/Program.cs index 1151f16be8..30aced6469 100644 --- a/src/Umbraco.Web.UI.NetCore/Program.cs +++ b/src/Umbraco.Web.UI.NetCore/Program.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; using Umbraco.Core.Composing; -namespace Umbraco.Web.UI.BackOffice +namespace Umbraco.Web.UI.NetCore { public class Program { diff --git a/src/Umbraco.Web.UI.NetCore/Startup.cs b/src/Umbraco.Web.UI.NetCore/Startup.cs index 7ccbdd6ab4..deba559ed1 100644 --- a/src/Umbraco.Web.UI.NetCore/Startup.cs +++ b/src/Umbraco.Web.UI.NetCore/Startup.cs @@ -7,7 +7,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Umbraco.Extensions; -namespace Umbraco.Web.UI.BackOffice +namespace Umbraco.Web.UI.NetCore { public class Startup { diff --git a/src/umbraco.sln b/src/umbraco.sln index 21186643b0..71ffe73ca4 100644 --- a/src/umbraco.sln +++ b/src/umbraco.sln @@ -34,6 +34,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuSpecs", "NuSpecs", "{227C ..\build\NuSpecs\UmbracoCms.Core.nuspec = ..\build\NuSpecs\UmbracoCms.Core.nuspec ..\build\NuSpecs\UmbracoCms.nuspec = ..\build\NuSpecs\UmbracoCms.nuspec ..\build\NuSpecs\UmbracoCms.Web.nuspec = ..\build\NuSpecs\UmbracoCms.Web.nuspec + ..\build\NuSpecs\UmbracoCms.SqlCe.nuspec = ..\build\NuSpecs\UmbracoCms.SqlCe.nuspec EndProjectSection EndProject Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Umbraco.Web.UI.Client", "http://localhost:3961", "{3819A550-DCEC-4153-91B4-8BA9F7F0B9B4}"