Fix build required before initial publish
This commit is contained in:
@@ -6,6 +6,16 @@
|
||||
<UmbracoWwwrootName Condition="'$(UmbracoWwwrootName)' == ''">umbraco</UmbracoWwwrootName>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins\**;</DefaultItemExcludes>
|
||||
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Data\**;</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Logs\**;</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\mediacache\**;</DefaultItemExcludes>
|
||||
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\media\**;</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CopyUmbracoAssets" BeforeTargets="BeforeBuild">
|
||||
<ItemGroup>
|
||||
<ContentFiles Include="$(ContentFilesPath)" />
|
||||
@@ -21,7 +31,42 @@
|
||||
SourceFiles="@(ContentWwwrootFiles)"
|
||||
DestinationFiles="@(ContentWwwrootFiles->'$(MSBuildProjectDirectory)\wwwroot\$(UmbracoWwwrootName)\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="IncludeAppPluginsContent" BeforeTargets="GetCopyToOutputDirectoryItems">
|
||||
<ItemGroup>
|
||||
<_AppPluginsFiles Include="App_Plugins\**" />
|
||||
|
||||
<ContentWithTargetPath
|
||||
Include="@(_AppPluginsFiles)"
|
||||
TargetPath="%(Identity)"
|
||||
CopyToOutputDirectory="Always" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
The set of files to publish is generated really early and doesn't currently account for files added by targets e.g. BeforeBuild.
|
||||
A fix was put in place in Web SDK to update for wwwwroot in case someone runs npm build etc in a target, we're borrowing their trick.
|
||||
https://github.com/dotnet/sdk/blob/e2b2b1a4ac56c955b84d62fe71cda3b6f258b42b/src/WebSdk/Publish/Targets/ComputeTargets/Microsoft.NET.Sdk.Publish.ComputeFiles.targets
|
||||
-->
|
||||
<Target Name="IncludeUmbracoFolderContent" BeforeTargets="GetCopyToOutputDirectoryItems">
|
||||
<ItemGroup>
|
||||
<_UmbracoFolderFiles Include="umbraco\config\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\PartialViewMacros\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\UmbracoBackOffice\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\UmbracoInstall\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\UmbracoWebsite\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\UmbracoWebsite\**" />
|
||||
<_UmbracoFolderFiles Include="umbraco\Licenses\**" />
|
||||
|
||||
<!-- This could be handled in deploy if it's not already -->
|
||||
<_UmbracoFolderFiles Include="umbraco\Deploy\**" />
|
||||
|
||||
<ContentWithTargetPath
|
||||
Include="@(_UmbracoFolderFiles)"
|
||||
TargetPath="%(Identity)"
|
||||
CopyToOutputDirectory="Always" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="ClearUmbracoAssets" BeforeTargets="Clean">
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Cms.Web.UI</RootNamespace>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins/**;</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco/**;</DefaultItemExcludes>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot/media/**;</DefaultItemExcludes>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Force windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older windows 10 and most if not all winodws servers will run NLS -->
|
||||
@@ -26,16 +23,6 @@
|
||||
<ProjectReference Include="..\PackageTestSiteName\PackageTestSiteName.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="App_Plugins/**" CopyToOutputDirectory="Always" />
|
||||
<Content Include="umbraco/**" CopyToOutputDirectory="Always" />
|
||||
<Content Remove="umbraco/Data/**" />
|
||||
<Content Remove="umbraco/Logs/**" />
|
||||
<Content Remove="umbraco/mediacache/**" />
|
||||
<Content Remove="umbraco/models/**" />
|
||||
<Compile Include="umbraco/models/**" Exclude="**/*.flag" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user