Skip to content

Commit

Permalink
Feature/use git info cache for all solution projects (#191)
Browse files Browse the repository at this point in the history
* GitIsDirty.cache should be overwritten instead of appended

* add the possibility to overwrite the path where the caches are placed
  • Loading branch information
tisis2 authored Nov 18, 2022
1 parent 5dacb49 commit 51098e6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/GitInfo/build/GitInfo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
in a previous build in a GitInfo.cache for
performance reasons.
Defaults to empty value (no ignoring).
$(GitCachePath): where to cache the determined Git information
gives the chance to use a shared location
for different projects. this can improve
the overall build time.
has to end with a path seperator
Defaults to empty value ('$(IntermediateOutputPath)').
$(GitTagRegex): Regular expression used with git describe to filter the tags
to consider for base version lookup.
Expand Down Expand Up @@ -110,6 +117,7 @@
<GitSkipCache Condition="'$(GitSkipCache)' == ''">false</GitSkipCache>
<SkipReadGitCache Condition="'$(SkipReadGitCache)' == ''">$(GitSkipCache)</SkipReadGitCache>
<SkipWriteGitCache Condition="'$(SkipWriteGitCache)' == ''">$(GitSkipCache)</SkipWriteGitCache>
<GitCachePath Condition="'$(GitCachePath)' == ''">$(IntermediateOutputPath)</GitCachePath>

<GitCommitsIgnoreMerges Condition="'$(GitCommitsIgnoreMerges)' == ''">false</GitCommitsIgnoreMerges>

Expand Down Expand Up @@ -141,10 +149,10 @@
</CoreCompileDependsOn>

<!-- Cache file used to avoid running all git commands. Only GitRoot will be retrieved to determine the path of this cache file. -->
<_GitInfoFile>$(IntermediateOutputPath)GitInfo.cache</_GitInfoFile>
<_GitInfoFile>$(GitCachePath)GitInfo.cache</_GitInfoFile>

<!-- Stores value of GitIsDirty variable from last execution, file is changed when the value changes betwee runs. -->
<_GitIsDirtyFile>$(IntermediateOutputPath)GitIsDirty.cache</_GitIsDirtyFile>
<_GitIsDirtyFile>$(GitCachePath)GitIsDirty.cache</_GitIsDirtyFile>
</PropertyGroup>

<Target Name="GitInfoReport" DependsOnTargets="GitInfo;GitVersion">
Expand Down

0 comments on commit 51098e6

Please sign in to comment.