Skip to content

Hard to set Version in a task imported from a NuGet package #504

@clairernovotny

Description

@clairernovotny

Not sure where this belongs, but when updating GitVersionTask to support the SDK builds (inner and outer loop), it was very hard to inject a target into the pipeline early enough where we can get variables usable in a PropertyGroup at the top of the project file.

The simple example is that I want to set Version at the top, but it's not clear that there's any extension points where I can run my task before that's processed. Instead, I rely on an AfterTargets to set the property value, but that's nasty.

You can see what I did here:
https://github.com/onovotny/Zeroconf/blob/6eaba492da42ca6e3c4b13a856ff42f560083cc1/Zeroconf/Zeroconf.csproj#L82-L86

There didn't seem to be a way to set those properties earlier -- the trick is that we need some place to inject the GetVersion target before the main csproj is processed.

Ideally we need a place we can inject the task where the variables will be available to all property groups in the project file in the inner and outer loops so we can set Version related info for the AssemblyInfo and NuGet tasks.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions