-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add AdditionalStaticWebAssetsBasePath property for external content roots #52020
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
base: main
Are you sure you want to change the base?
Conversation
…oots - Add ParseAdditionalStaticWebAssetsBasePaths task to parse and discover files from additional content roots - Add ResolveAdditionalStaticWebAssets target that runs as part of ResolveCoreStaticWebAssets - Add UsingTask registration for the new task - Add E2E tests for build and publish scenarios with additional content roots - Support semicolon-separated list of content-root,base-path pairs Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
- Use conditional compilation for EndsWith(char) and Path.GetRelativePath - Add fallback implementations for .NET Framework 4.7.2 Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
| <UsingTask | ||
| TaskName="Microsoft.AspNetCore.StaticWebAssets.Tasks.ParseAdditionalStaticWebAssetsBasePaths" | ||
| AssemblyFile="$(StaticWebAssetsSdkBuildTasksAssembly)" | ||
| Condition="'$(StaticWebAssetsSdkBuildTasksAssembly)' != ''" /> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot don't do this with a custom task.
Use an itemgroup with Include then from that item group, create a separate item group with a transform.
Something like
<ItemGroup>
<MyItem Include="$(MyItems)">
<Path>$([System.String]::Copy(%(Identity)).Split(',')[0])</Path>
<BasePath>$([System.String]::Copy(%(Identity)).Split(',')[1])</BasePath>
</MyItem>
</ItemGroup>There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced the custom task with MSBuild ItemGroup transforms in 76775fb. The implementation now uses property functions to split the semicolon-separated list into items and extract ContentRoot/BasePath using Split(','), followed by a glob pattern to discover files.
- Remove ParseAdditionalStaticWebAssetsBasePaths custom task - Use MSBuild property functions to parse content-root,base-path pairs - Use ItemGroup transforms to split and discover files from content roots Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
|
@javiercn - what do you think about adding a ProjectCapability for this? That way from Aspire we can tell if the project supports this feature, and if so, use it. If it doesn't, we can do what we are currently doing for PublishAsContainerFiles |
ResolveProjectStaticWebAssetstarget andDefineStaticWebAssetstaskAdditionalStaticWebAssetsBasePathproperty supportCreate(replaced with MSBuild ItemGroup transforms per reviewer feedback)ParseAdditionalStaticWebAssetsBasePathstask to parse the property and discover filesResolveAdditionalStaticWebAssetstarget that runs as part ofResolveCoreStaticWebAssetsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.