Use wildcard versions for template dependencies in preview builds#34214
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modifies the template packaging process to use wildcard versions for external ASP.NET Core and Extensions package dependencies during preview builds. When StabilizePackageVersion is false (preview/non-release builds), version strings like 11.0.0-preview.2.26103.111 are transformed to 11.0.0-preview.2.* using regex replacement. This allows template-generated projects to automatically receive the latest compatible preview builds rather than being pinned to a specific build number. During stable builds (StabilizePackageVersion is true), exact versions are used as before.
Changes:
- Added conditional property groups in
_UpdateTemplateVersionstarget to transform four external package version properties using regex when in preview mode - Modified
ReplaceFileTexttask to use the transformed version properties instead of the original ones - Versions are transformed from
X.Y.Z-label.N.BUILD.REVISIONformat toX.Y.Z-label.N.*format
52aebd7 to
220ad2c
Compare
jonathanpeppers
left a comment
There was a problem hiding this comment.
This looks good to me; we'll want to backport to release/11.0.1xx-preview2 after it's green and merged.
|
/azp run maui-pr-devicetests |
|
/azp run maui-pr-uitests |
|
Pull request is closed |
|
/azp run maui-pr-devicetests |
|
/azp run maui-pr-uitests |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
1 similar comment
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
|
/rebase |
When StabilizePackageVersion is false, strip the build number from external dependency versions used in templates and replace with a wildcard. For example, 11.0.0-preview.2.26103.111 becomes 11.0.0-preview.2.* so template-generated projects don't pin to a specific build number during preview. Affects: MS_EXT_LOG_DEBUG_VERSION_VALUE, MS_COMPONENTS_WEB_VERSION_VALUE, MS_COMPONENTS_WEBASSEMBLY_VERSION_VALUE, MS_COMPONENTS_WEBASSEMBLY_SERVER_VERSION_VALUE Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
220ad2c to
843d0c6
Compare
|
/backport to release/11.0.1xx-preview2 |
|
Started backporting to |
…encies in preview builds (#34305) Backport of #34214 to release/11.0.1xx-preview2 /cc @mattleibow Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
When
StabilizePackageVersionisfalse(preview/non-release builds), the template version values for external ASP.NET Core and Extensions packages included specific build numbers (e.g.,11.0.0-preview.2.26103.111). This meant template-generated projects were pinned to an exact build number during preview.This PR strips the build number and replaces it with a wildcard (
*) so that templates use floating versions during preview (e.g.,11.0.0-preview.2.*). WhenStabilizePackageVersionistrue(stable/release builds), the exact version is used as before.Affected version placeholders
MS_EXT_LOG_DEBUG_VERSION_VALUEMS_COMPONENTS_WEB_VERSION_VALUEMS_COMPONENTS_WEBASSEMBLY_VERSION_VALUEMS_COMPONENTS_WEBASSEMBLY_SERVER_VERSION_VALUEHow it works
Added conditional
PropertyGroupentries inside the_UpdateTemplateVersionstarget that useRegex.Replaceto transform versions like11.0.0-preview.2.26103.111→11.0.0-preview.2.*. The regex(-[a-zA-Z][a-zA-Z0-9]*\.\d+)\.\d+\.\d+matches the prerelease label and iteration, then strips the trailing build number segments. Stable versions (no prerelease label) are unaffected since the regex does not match.