You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i would like to use GitInfo to version all DLLs in my solution to the same version. i use SDK style projects and would like to use the generated assembly. therefore I placed a central Build.Directory.targets for the solution that would add the following:
<ItemGroup>
<PackageReference Include="GitInfo" Version="2.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Target Name="SetVersionFromGitInfo" DependsOnTargets="GitVersion" BeforeTargets="GetAssemblyVersion">
<PropertyGroup>
<BaseVersion>$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch).$(GitCommits)</BaseVersion>
<!-- for TFS build GitBranch is not set so we need to get the branch from the TFS variable -->
<FeatureBranch>$(BUILD_SOURCEBRANCH)</FeatureBranch>
<FeatureBranch Condition="$(FeatureBranch.StartsWith('refs/heads/'))">$(FeatureBranch.Substring(11))</FeatureBranch>
<!-- if variable is not set its a local build -->
<FeatureBranch Condition="$(FeatureBranch) == ''">$(GitBranch)</FeatureBranch>
<ExtendedVersion>$(BaseVersion) / $(GitCommit) ($(GitIsDirty)) $(FeatureBranch)</ExtendedVersion>
<Version>$(BaseVersion)</Version>
<InformationalVersion>$(ExtendedVersion)</InformationalVersion>
</PropertyGroup>
</Target>
i recognized that the build time for the round 30 projects increased about 2 minutes after that change.
so i tried to see how to optimize that a bit. we found that the GitInfo for a single project would be cached so we thought it might be a nice approach to move the cache to the solution directory and reuse it so that not every project is recreating its own cache with the same content.
to test that i added the following to the central .targets file:
it almost worked. i just recognised that now the cache is still updated on each project, since the is dirty cache was updated all the time and therefore the gitinfo cache was recreated. i think that could be fixed with the change i commented in #165.
it would be nice to be able to change the cache location by just setting a variable. maybe this could be something that should be configurable.
The text was updated successfully, but these errors were encountered:
i would like to use GitInfo to version all DLLs in my solution to the same version. i use SDK style projects and would like to use the generated assembly. therefore I placed a central Build.Directory.targets for the solution that would add the following:
i recognized that the build time for the round 30 projects increased about 2 minutes after that change.
so i tried to see how to optimize that a bit. we found that the GitInfo for a single project would be cached so we thought it might be a nice approach to move the cache to the solution directory and reuse it so that not every project is recreating its own cache with the same content.
to test that i added the following to the central .targets file:
it almost worked. i just recognised that now the cache is still updated on each project, since the is dirty cache was updated all the time and therefore the gitinfo cache was recreated. i think that could be fixed with the change i commented in #165.
it would be nice to be able to change the cache location by just setting a variable. maybe this could be something that should be configurable.
The text was updated successfully, but these errors were encountered: