arcade-services
arcade-services copied to clipboard
Create a helper tool for easier `Versions.props` re-formatting
Context
The backflow process will be heavy on Versions.props file changes. This file is quite dense and conflicts inside of it can occur easily.
To prevent and easy up this, we will separate properties, that have a matching Version.Details.xml record, into a single section.
We will then go repository by repository and tidy the Versions.props up. To make this faster, it would be good to have a script/tool that will format this new section for us.
Goal
Create a new C# tool that will:
- Be called from within a repo
- It will find all properties in
Versions.propsthat belong to a record fromVersion.Details.xml - It will group them by repository
- Inside each group, it will sort them alphabetically by name
- It will print (not change the original file, only print) what would a cleaned up section look like
- The tool should output a warning if there's no matching property in
Versions.propsfor a givenVersion.Details.xmlrecord
Example output
<PropertyGroup>
<!-- Arcade dependencies -->
<MicrosoftDotNetBuildTasksFeedVersion>10.0.0-beta.25157.1</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>10.0.0-beta.25157.1</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>10.0.0-beta.25157.1</MicrosoftDotNetGenAPIVersion>
<!-- NuGet dependencies -->
<NuGetBuildTasksPackVersion>6.0.0-preview.1.102</NuGetBuildTasksPackVersion>
<!-- Installer dependencies -->
<MicrosoftNETCoreAppRuntimewinx64Version>10.0.0-preview.3.25152.4</MicrosoftNETCoreAppRuntimewinx64Version>
<MicrosoftExtensionsDependencyModelVersion>6.0.0</MicrosoftExtensionsDependencyModelVersion>
<!-- ILAsm dependencies -->
<MicrosoftNETCoreILAsmVersion>10.0.0-preview.3.25152.4</MicrosoftNETCoreILAsmVersion>
<!-- Libraries dependencies -->
<MicrosoftBclAsyncInterfacesVersion>6.0.0</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftBclHashCodeVersion>6.0.0</MicrosoftBclHashCodeVersion>
<MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
</PropertyGroup>
Notes
- Tidying the
Versions.propswill always be a manual process as it has to be done carefully. This is why the tool won't reformat the actual files. The files can have comments or it can use some of the variables later etc. - Later, the workflow using this tool will look like this:
- We will run the tool over a repo and add this new section on top of the file
- Then we will remove the duplicate definitions of the properties we just pasted anywhere lower in the file
- Check that we didn't break comments etc
- Open a PR against the repo