Skip to content

Commit 1226382

Browse files
marafCopilot
andauthored
[browser] Skip boot json generation in nested publish (#128361)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e9dec1b commit 1226382

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,14 @@ Copyright (c) .NET Foundation. All rights reserved.
680680

681681
<!-- Write the boot JSON file for the build.
682682
This target is incremental: when all inputs (assemblies, static web assets, VFS files,
683-
config files, extensions, property stamp) are older than the output, the target is skipped. -->
683+
config files, extensions, property stamp) are older than the output, the target is skipped.
684+
Skipped during nested publish: the nested publish runs the full Build chain which would
685+
create the boot JSON without VFS entries (LinkContentToWwwroot is skipped). If we wrote
686+
it here, the outer build's Inputs/Outputs check would find the stale output and skip
687+
regeneration, leaving the final boot JSON without VFS content files. -->
684688
<Target Name="_WriteBuildWasmBootJsonFile"
685689
DependsOnTargets="_WriteWasmBootJsonBuildPropertyStamp"
690+
Condition="'$(WasmBuildingForNestedPublish)' != 'true'"
686691
Inputs="@(IntermediateAssembly);@(WasmStaticWebAsset);@(_WasmJsModuleCandidatesForBuild);@(_WasmFilesToIncludeInFileSystemStaticWebAsset);@(_WasmJsConfigStaticWebAsset);@(_WasmDotnetJsForBuild);@(WasmBootConfigExtension);$(ProjectRuntimeConfigFilePath);$(MSBuildProjectFullPath);$(MSBuildThisFileFullPath);$(_WebAssemblySdkTasksAssembly);$(IntermediateOutputPath)wasm-bootjson-build.stamp"
687692
Outputs="$(_WasmBuildBootJsonPath)">
688693

@@ -733,8 +738,10 @@ Copyright (c) .NET Foundation. All rights reserved.
733738
</Target>
734739

735740
<!-- Define the boot config file as a static web asset and create endpoints.
736-
This target always runs to ensure items are populated even when _WriteBuildWasmBootJsonFile is skipped. -->
737-
<Target Name="_GenerateBuildWasmBootJson" DependsOnTargets="_WriteBuildWasmBootJsonFile">
741+
This target always runs to ensure items are populated even when _WriteBuildWasmBootJsonFile is skipped.
742+
Skipped during nested publish (same reason as _WriteBuildWasmBootJsonFile). -->
743+
<Target Name="_GenerateBuildWasmBootJson" DependsOnTargets="_WriteBuildWasmBootJsonFile"
744+
Condition="'$(WasmBuildingForNestedPublish)' != 'true'">
738745

739746
<ItemGroup>
740747
<!-- Track boot JSON for clean operations even when _WriteBuildWasmBootJsonFile was skipped -->

0 commit comments

Comments
 (0)