I have a question regarding versioning. I have a solution that holds several projects. Each project outputs a DLL/Exe, where I want to track the version number. After I am finished with the development I want to create a .TapPackage that has the same version as the DLL file. Currently I have to update the version in the .csproj and package.xml. Is there an elegant way to solve this within a single file?
I tried “Directory.Build.props” which works for .csproj but not for the package.xml.
Bumping this because I think I’m trudging down the same path at the moment…
I just want to confirm that for building a TapPackage there isn’t any way to set the version as a command line argument or via an environment/build variable? GitVersion or manually setting it are the only options?
I’m just wondering if there is any existing option a bit more CI friendly than manually editing the package.xml file for us poor souls that work places that use a different VCS.
I’m curious to know which VCS you are using instead maybe we can add versioning support for that eventually. Or maybe add some hooks so that it can be a plugin.
Anyway, there is definitely a way you can control this from one place without using git + the {GitVersion} macro.
The package.xml file system supports expanding based on environment variables as well. So if you set BUILD_VERSION=1.2.3 and in your package.xml file set:
<Package Name="VersioningTest" xmlns="http://opentap.io/schemas/package" InfoLink="" Version="$(BUILD_VERSION)" OS="Windows,Linux">
<Variables>
<!-- optionally set fallback version in case the environment variable is not set. -->
<BUILD_VERSION Condition="$(BUILD_VERSION) == ''">0.0.1</BUILD_VERSION>
</Variables>