icerpc-csharp icon indicating copy to clipboard operation
icerpc-csharp copied to clipboard

Use a version range for IceRPC references in project templates

Open pepone opened this issue 1 year ago • 1 comments

The project templates currently use an exact version match for the IceRPC packages, as seen here:

https://github.com/icerpc/icerpc-csharp/blob/9c21a5dd1625e2689cba957d226d9563710857ce/src/IceRpc.Templates/Templates/IceRpc-Protobuf-Client/IceRpc-Protobuf-Client.csproj#L15

It would be better to use a version range like "0.4.*".

However, one challenge is that we want to test these templates with CI. When using a version range, simply pushing the packages to the local global-packages folder is not sufficient. NuGet resolves the version by contacting the configured sources and checking which versions are published that match the range. Versions in the local global-packages folder are not considered during version resolution.

For the examples we use a local MSBuild variable $(IceRpcVersion), using an exact match seems more practical for the examples.

pepone avatar Sep 17 '24 09:09 pepone

We use a version range on release branches "0.4.x" branch has "0.4.*", for main we use an exact version typically a preview like ("0.5.0-preview1")

We do the same for the examples, examples are configured to build agains IceRpcVersion defined in build/IceRpc.Examples.props

This means that release branches test templates and examples against the latest published version that matches the range expression. The main branch tests against the packages build from CI.

pepone avatar Sep 18 '24 10:09 pepone

Current setup seems correct:

  • 0.4.x branch templates are build against 0.4.* packages, will use the latest 0.4 published version.
  • main branch templates use a exact match for the corresponding preview, currently 0.5.0-preview1

pepone avatar Nov 13 '24 21:11 pepone