Skip to content

[StaticWebAssets] Add the cache files to the list of written files so they get deleted during clean #48952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025

Conversation

javiercn
Copy link
Member

@javiercn javiercn commented May 14, 2025

  • Fix an issue when we need to ignore the cache.
  • Make sure cache files are removed during dotnet clean.

@github-actions github-actions bot added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch label May 14, 2025
Copy link
Contributor

Thanks for your PR, @@javiercn.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@javiercn javiercn force-pushed the javiercn/casing-fix branch 2 times, most recently from e3643ec to c6b726a Compare May 14, 2025 17:48
@javiercn javiercn force-pushed the javiercn/casing-fix branch from c6b726a to bc0ef41 Compare May 14, 2025 17:49
@javiercn javiercn marked this pull request as ready for review May 14, 2025 17:49
@Copilot Copilot AI review requested due to automatic review settings May 14, 2025 17:49
@javiercn javiercn requested a review from a team as a code owner May 14, 2025 17:49
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds cache files to the list of written files so that they will be deleted during the clean process. Key changes include updating tests to assert that cache lists (CachedAssets and CachedCopyCandidates) are empty after property changes, clearing cache entries in the update method, and adding FileWrites entries in various targets to include the cache file paths.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssets/DiscoverStaticWebAssetsTest.cs Updated the test to verify that the cache lists are empty post-update
src/StaticWebAssetsSdk/Tasks/DefineStaticWebAssets.Cache.cs Clears CachedAssets and CachedCopyCandidates during TotalUpdate to reset cache state
src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAssets.targets Added FileWrites for the project static web assets cache
src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAssets.JSModules.targets Added FileWrites entries for various JS module cache paths
src/StaticWebAssetsSdk/Targets/Microsoft.NET.Sdk.StaticWebAssets.Compression.targets Added FileWrites for the compressed static web assets cache

@javiercn javiercn requested a review from MackinnonBuck May 14, 2025 17:51
@javiercn javiercn merged commit b5f3be8 into main May 15, 2025
30 checks passed
@javiercn javiercn deleted the javiercn/casing-fix branch May 15, 2025 16:25
@dotnet dotnet deleted a comment from github-actions bot May 15, 2025
@dotnet dotnet deleted a comment from github-actions bot May 15, 2025
@javiercn
Copy link
Member Author

/backport to release/9.0.3xx

Copy link
Contributor

Started backporting to release/9.0.3xx: https://github.com/dotnet/sdk/actions/runs/15050229264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants