Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directory.Build.targets not supported #95

Open
WeihanLi opened this issue Apr 8, 2023 · 3 comments
Open

Directory.Build.targets not supported #95

WeihanLi opened this issue Apr 8, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@WeihanLi
Copy link

WeihanLi commented Apr 8, 2023

I had defined the Version prop in the Directory.Build.targets file in the project root folder, but it seemed it's not found

<Project>
  <PropertyGroup>
    <Version Condition="'$(VersionSuffix)'==''">$(VersionPrefix)</Version>
    <Version Condition="'$(VersionSuffix)'!=''">$(VersionPrefix)-$(VersionSuffix)</Version>
  </PropertyGroup>
</Project>

https://github.com/WeihanLi/dotnet-exec/blob/4a918d632944c4093fc688e26ad802497c78e6ee/Directory.Build.targets

image

@cabauman
Copy link
Contributor

cabauman commented Apr 9, 2023

I've never seen a project put version in Directory.Build.targets before (I normally see it in Directory.Build.props), but if that's an actual use case, I suppose it would be easy to add (basically the same as this commit to support *.props files).

@cabauman cabauman added the enhancement New feature or request label Apr 9, 2023
@WeihanLi
Copy link
Author

WeihanLi commented Apr 9, 2023

It's simple to get the XML node inner text, while sometimes we may want to reference other variables, currently, we get the inner text only.

@cabauman
Copy link
Contributor

cabauman commented Apr 15, 2023

We'd be happy to add the targets file as a supported extension. But in your example snippet it still wouldn't work because Versionize only works with explicit version numbers (e.g. 1.2.3); not evaluated ones e.g. $(VersionPrefix). This is because Versionize is responsible for writing the updated version back to the file where it read from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants