Feature: Build static assets conditionally for Backoffice and Login (#17527)
* feat: conditionally install and build the 'login' and 'backoffice' targets depending on source files * feat: remove the preconditions target, because we are now compiling a file list to check if we need to build * feat: remove the 'clean' targets, because the project will be cleaned if any of the compiled file lists do not exist * feat: remove the preserve.* files as they are no longer needed * Enable default content items again * Remove package.json from restore target inputs * Include generated files as static assets after build * Clean up project files * Exclude CS0618 warning as error and fix CA2264 * Exclude CS0612 warning as error * Suppress removal of test fixture * Use separate property/item groups for backoffice and login project --------- Co-authored-by: Ronald Barendse <ronald@barend.se>
This commit is contained in:
@@ -9,8 +9,40 @@
|
||||
<NoDefaultExcludes>true</NoDefaultExcludes>
|
||||
<IncludeContentInPack>true</IncludeContentInPack>
|
||||
<ContentTargetFolders>.</ContentTargetFolders>
|
||||
<NoWarn>NU5128</NoWarn>
|
||||
<NoWarn>$(NoWarn),NU5128</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Added project references as the sample API in umbraco-extension will fail -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\src\Umbraco.Cms.Api.Common\Umbraco.Cms.Api.Common.csproj" />
|
||||
<ProjectReference Include="..\src\Umbraco.Cms.Api.Management\Umbraco.Cms.Api.Management.csproj" />
|
||||
<ProjectReference Include="..\src\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
|
||||
<ProjectReference Include="..\src\Umbraco.Web.Website\Umbraco.Web.Website.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Update template.json files with the default UmbracoVersion value set to the current build version -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Umbraco.JsonSchema.Extensions" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="**\.template.config\template.json" Pack="false" />
|
||||
</ItemGroup>
|
||||
<Target Name="GetUpdatedTemplateJsonPackageFiles" BeforeTargets="GenerateNuspec" AfterTargets="GetUmbracoBuildVersion">
|
||||
<ItemGroup>
|
||||
<_TemplateJsonFiles Include="**\.template.config\template.json" Exclude="bin\**;obj\**" />
|
||||
<_TemplateJsonFiles>
|
||||
<DestinationFile>$(IntermediateOutputPath)%(RelativeDir)%(Filename)%(Extension)</DestinationFile>
|
||||
</_TemplateJsonFiles>
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(_TemplateJsonFiles)" DestinationFiles="%(DestinationFile)" />
|
||||
<JsonPathUpdateValue JsonFile="%(_TemplateJsonFiles.DestinationFile)" Path="$.symbols.FinalVersion.parameters.cases.[0].value" Value=""$(PackageVersion)"" />
|
||||
<ItemGroup>
|
||||
<_PackageFiles Include="%(_TemplateJsonFiles.DestinationFile)">
|
||||
<PackagePath>%(_TemplateJsonFiles.RelativeDir)</PackagePath>
|
||||
</_PackageFiles>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\src\Umbraco.Web.UI\Program.cs">
|
||||
<Link>UmbracoProject\Program.cs</Link>
|
||||
@@ -32,33 +64,4 @@
|
||||
<PackagePath>UmbracoProject\Views</PackagePath>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<!-- Update template.json files with the default UmbracoVersion value set to the current build version -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Umbraco.JsonSchema.Extensions" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="**\.template.config\template.json" Pack="false" />
|
||||
</ItemGroup>
|
||||
<!-- Added project references as the sample API in umbraco-extension will fail -->
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\src\Umbraco.Cms.Api.Common\Umbraco.Cms.Api.Common.csproj" />
|
||||
<ProjectReference Include="..\src\Umbraco.Cms.Api.Management\Umbraco.Cms.Api.Management.csproj" />
|
||||
<ProjectReference Include="..\src\Umbraco.Web.Common\Umbraco.Web.Common.csproj" />
|
||||
<ProjectReference Include="..\src\Umbraco.Web.Website\Umbraco.Web.Website.csproj" />
|
||||
</ItemGroup>
|
||||
<Target Name="GetUpdatedTemplateJsonPackageFiles" BeforeTargets="GenerateNuspec" AfterTargets="GetUmbracoBuildVersion">
|
||||
<ItemGroup>
|
||||
<_TemplateJsonFiles Include="**\.template.config\template.json" Exclude="bin\**;obj\**" />
|
||||
<_TemplateJsonFiles>
|
||||
<DestinationFile>$(IntermediateOutputPath)%(RelativeDir)%(Filename)%(Extension)</DestinationFile>
|
||||
</_TemplateJsonFiles>
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(_TemplateJsonFiles)" DestinationFiles="%(DestinationFile)" />
|
||||
<JsonPathUpdateValue JsonFile="%(_TemplateJsonFiles.DestinationFile)" Path="$.symbols.FinalVersion.parameters.cases.[0].value" Value=""$(PackageVersion)"" />
|
||||
<ItemGroup>
|
||||
<_PackageFiles Include="%(_TemplateJsonFiles.DestinationFile)">
|
||||
<PackagePath>%(_TemplateJsonFiles.RelativeDir)</PackagePath>
|
||||
</_PackageFiles>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user