Skip to content

Commit 51098e6

Browse files
authored
Feature/use git info cache for all solution projects (#191)
* GitIsDirty.cache should be overwritten instead of appended * add the possibility to overwrite the path where the caches are placed
1 parent 5dacb49 commit 51098e6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/GitInfo/build/GitInfo.targets

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@
6464
in a previous build in a GitInfo.cache for
6565
performance reasons.
6666
Defaults to empty value (no ignoring).
67+
68+
$(GitCachePath): where to cache the determined Git information
69+
gives the chance to use a shared location
70+
for different projects. this can improve
71+
the overall build time.
72+
has to end with a path seperator
73+
Defaults to empty value ('$(IntermediateOutputPath)').
6774
6875
$(GitTagRegex): Regular expression used with git describe to filter the tags
6976
to consider for base version lookup.
@@ -110,6 +117,7 @@
110117
<GitSkipCache Condition="'$(GitSkipCache)' == ''">false</GitSkipCache>
111118
<SkipReadGitCache Condition="'$(SkipReadGitCache)' == ''">$(GitSkipCache)</SkipReadGitCache>
112119
<SkipWriteGitCache Condition="'$(SkipWriteGitCache)' == ''">$(GitSkipCache)</SkipWriteGitCache>
120+
<GitCachePath Condition="'$(GitCachePath)' == ''">$(IntermediateOutputPath)</GitCachePath>
113121

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

@@ -141,10 +149,10 @@
141149
</CoreCompileDependsOn>
142150

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

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

150158
<Target Name="GitInfoReport" DependsOnTargets="GitInfo;GitVersion">

0 commit comments

Comments
 (0)