Add support for managing version numbers within the new style of csproj. While it is possible to continue using the AssemblyInfo.cs file for managing version data with the newer project format, it does require setting <GenerateAssemblyInfo>false</GenerateAssemblyInfo> which has implications for other project properties.
Sample project file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.0.0</Version>
<AssemblyFileVersion>1.0.0.0</AssemblyFileVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</PropertyGroup>
</Project>
Specs
- The
Version property is the default property for managing version information. By default, all other version properties take their values from this property.
- If no version properties are found in the file, add a
Version property with the new version number. Versions begin at 1.0.0.0 for new projects.
- If a
Version property exists in the file, update it with the new version number (regardless of the existence of other version properties).
- If no
Version property is found, but only one AssemblyVersion or AssemblyFileVersion are found (exclusive-or), add a Version property with the new version number taken from the preexisting version field (AssemblyVersion or AssemblyFileVersion).
- If no
Version property is found, but both AssemblyVersion and AssemblyFileVersion are found, do not add a Version property.
- The
Version property can contain extended version data beyond the patch number (ex. 1.2.3.4-beta1). The extended version data will be treated as a version part with lower rank than the patch part and will be removed as part of any version update operation.
AssemblyFileVersion
- If a
AssemblyFileVersion property is ever found, update it with the new version number.
- If a
AssemblyFileVersion property is not found, do not add it.
AssemblyVersion
- If a
AssemblyVersion property is ever found, update it with the new version number.
- If a
AssemblyVersion property is not found, do not add it.
If this looks good to you, I would be willing to put in a PR. I haven't worked with F# before (I'm a C# dev), but it would be fun to give it a go.
Add support for managing version numbers within the new style of csproj. While it is possible to continue using the AssemblyInfo.cs file for managing version data with the newer project format, it does require setting
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>which has implications for other project properties.Sample project file:
Specs
Versionproperty is the default property for managing version information. By default, all other version properties take their values from this property.Versionproperty with the new version number. Versions begin at1.0.0.0for new projects.Versionproperty exists in the file, update it with the new version number (regardless of the existence of other version properties).Versionproperty is found, but only oneAssemblyVersionorAssemblyFileVersionare found (exclusive-or), add aVersionproperty with the new version number taken from the preexisting version field (AssemblyVersionorAssemblyFileVersion).Versionproperty is found, but bothAssemblyVersionandAssemblyFileVersionare found, do not add aVersionproperty.Versionproperty can contain extended version data beyond the patch number (ex.1.2.3.4-beta1). The extended version data will be treated as a version part with lower rank than thepatchpart and will be removed as part of any version update operation.AssemblyFileVersionAssemblyFileVersionproperty is ever found, update it with the new version number.AssemblyFileVersionproperty is not found, do not add it.AssemblyVersionAssemblyVersionproperty is ever found, update it with the new version number.AssemblyVersionproperty is not found, do not add it.If this looks good to you, I would be willing to put in a PR. I haven't worked with F# before (I'm a C# dev), but it would be fun to give it a go.