Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ Copyright (c) .NET Foundation. All rights reserved.
DependsOnTargets="_WriteWasmBootJsonBuildPropertyStamp"
Condition="'$(WasmBuildingForNestedPublish)' != 'true'"
Inputs="@(IntermediateAssembly);@(WasmStaticWebAsset);@(_WasmJsModuleCandidatesForBuild);@(_WasmFilesToIncludeInFileSystemStaticWebAsset);@(_WasmJsConfigStaticWebAsset);@(_WasmDotnetJsForBuild);@(WasmBootConfigExtension);$(ProjectRuntimeConfigFilePath);$(MSBuildProjectFullPath);$(MSBuildThisFileFullPath);$(_WebAssemblySdkTasksAssembly);$(IntermediateOutputPath)wasm-bootjson-build.stamp"
Outputs="$(_WasmBuildBootJsonPath)">
Outputs="$(IntermediateOutputPath)wasm-bootjson-build.complete.stamp">

<GenerateWasmBootJson
AssemblyPath="@(IntermediateAssembly)"
Expand Down Expand Up @@ -748,12 +748,20 @@ Copyright (c) .NET Foundation. All rights reserved.

<ItemGroup>
<FileWrites Include="$(_WasmBuildBootJsonPath)" />
<FileWrites Include="$(IntermediateOutputPath)wasm-bootjson-build.complete.stamp" />
</ItemGroup>

<!-- The GenerateWasmBootJson task uses content comparison and preserves old timestamps when
the output content is unchanged. Touch the output so MSBuild's Inputs/Outputs check
sees a current timestamp and can correctly skip this target on subsequent builds. -->
<Touch Files="$(_WasmBuildBootJsonPath)" />
<!-- The GenerateWasmBootJson task uses content comparison and preserves old timestamps
when the output content is unchanged. We need a current timestamp on something for
MSBuild's Inputs/Outputs check to correctly skip this target on subsequent builds,
but we must NOT touch $(_WasmBuildBootJsonPath) itself: that file is a source for the
StaticWebAssets compression pipeline (GZipCompress/BrotliCompress) and the copy-to-
output target (_BuildCopyStaticWebAssetsPreserveNewest). Bumping its timestamp on every
build defeats their incrementality checks and breaks `dotnet build -question` (see
dotnet/runtime#129280, dotnet/runtime#124729, dotnet/aspnetcore#63207).
Touch a separate stamp file that is the target's Outputs= so MSBuild sees a current
output timestamp without affecting downstream consumers of the boot JSON. -->
<Touch Files="$(IntermediateOutputPath)wasm-bootjson-build.complete.stamp" AlwaysCreate="true" />
Comment thread
lewing marked this conversation as resolved.
</Target>

<!-- Define the boot config file as a static web asset and create endpoints.
Expand All @@ -765,6 +773,11 @@ Copyright (c) .NET Foundation. All rights reserved.
<ItemGroup>
<!-- Track boot JSON for clean operations even when _WriteBuildWasmBootJsonFile was skipped -->
<FileWrites Include="$(_WasmBuildBootJsonPath)" />
<!-- Track the completion stamp here too: when _WriteBuildWasmBootJsonFile is skipped on
incremental builds, its in-body FileWrites entries aren't populated. Without this,
`dotnet clean` would leave the stamp behind and the next build would (correctly)
see it as up-to-date even though the boot JSON was just cleaned. -->
<FileWrites Include="$(IntermediateOutputPath)wasm-bootjson-build.complete.stamp" />
<_WasmBuildBootConfigCandidate
Include="$(_WasmBuildBootJsonPath)"
RelativePath="_framework/$(_WasmBootConfigFileName)" />
Expand Down Expand Up @@ -1084,6 +1097,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<ItemGroup>
<!-- Track boot JSON for clean operations even when GeneratePublishWasmBootJson was skipped -->
<FileWrites Include="$(IntermediateOutputPath)$(_WasmPublishBootConfigFileName)" />
<!-- Track the completion stamp here too: see _GenerateBuildWasmBootJson for rationale. -->
<FileWrites Include="$(IntermediateOutputPath)wasm-bootjson-publish.complete.stamp" />
<_WasmPublishBootConfigCandidate
Include="$([MSBuild]::NormalizePath($(IntermediateOutputPath), $(_WasmPublishBootConfigFileName)))"
RelativePath="_framework/$(_WasmBootConfigFileName)" />
Expand Down Expand Up @@ -1180,7 +1195,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<Target Name="GeneratePublishWasmBootJson"
DependsOnTargets="_WriteWasmPublishBootJsonPropertyStamp"
Inputs="@(IntermediateAssembly);@(_WasmPublishAsset);@(_WasmJsModuleCandidatesForPublish);@(_WasmPublishConfigFile);@(_WasmDotnetJsForPublish);@(WasmBootConfigExtension);$(ProjectRuntimeConfigFilePath);$(MSBuildProjectFullPath);$(MSBuildThisFileFullPath);$(_WebAssemblySdkTasksAssembly);$(IntermediateOutputPath)wasm-bootjson-publish.stamp"
Outputs="$(IntermediateOutputPath)$(_WasmPublishBootConfigFileName)">
Outputs="$(IntermediateOutputPath)wasm-bootjson-publish.complete.stamp">

<GenerateWasmBootJson
AssemblyPath="@(IntermediateAssembly)"
Expand Down Expand Up @@ -1220,12 +1235,13 @@ Copyright (c) .NET Foundation. All rights reserved.

<ItemGroup>
<FileWrites Include="$([MSBuild]::NormalizePath($(IntermediateOutputPath), $(_WasmPublishBootConfigFileName)))" />
<FileWrites Include="$(IntermediateOutputPath)wasm-bootjson-publish.complete.stamp" />
</ItemGroup>

<!-- The GenerateWasmBootJson task uses content comparison and preserves old timestamps when
the output content is unchanged. Touch the output so MSBuild's Inputs/Outputs check
sees a current timestamp and can correctly skip this target on subsequent builds. -->
<Touch Files="$(IntermediateOutputPath)$(_WasmPublishBootConfigFileName)" />
<!-- See _WriteBuildWasmBootJsonFile for rationale: touch a separate stamp file rather than
the boot JSON itself to avoid cascading mtime bumps into downstream StaticWebAssets
compression / copy targets. -->
<Touch Files="$(IntermediateOutputPath)wasm-bootjson-publish.complete.stamp" AlwaysCreate="true" />
Comment thread
lewing marked this conversation as resolved.

</Target>

Expand Down
Loading