8000 Add RepositoryRoot property from source control information · devlooped/oss@f9763d3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit f9763d3

Browse files
committed
Add RepositoryRoot property from source control information
1 parent 7ebebbd commit f9763d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Directory.Build.targets

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
<ProjectProperty Include="RepositoryBranch" />
113113
<ProjectProperty Include="RepositorySha" />
114114
<ProjectProperty Include="RepositoryCommit" />
115+
<ProjectProperty Include="RepositoryRoot" />
115116
</ItemGroup>
116117

117118
<!-- Make sure the source control info is available before calling source generators -->
@@ -132,6 +133,15 @@
132133
<SourceRevisionId>$(RepositorySha)</SourceRevisionId>
133134
</PropertyGroup>
134135

136+
<!-- Add SourceRoot as a project property too -->
137+
<ItemGroup>
138+
<_GitSourceRoot Include="@(SourceRoot -> WithMetadataValue('SourceControl', 'git'))" />
139+
</ItemGroup>
140+
141+
<PropertyGroup>
142+
<RepositoryRoot>@(_GitSourceRoot)</RepositoryRoot>
143+
</PropertyGroup>
144+
135145
</Target>
136146

137147
<!-- Always append the link to the direct source tree for the current build -->

0 commit comments

Comments
 (0)
0