-
Notifications
You must be signed in to change notification settings - Fork 3
/
Directory.Build.props
24 lines (23 loc) · 1.29 KB
/
Directory.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<Project>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Authors>MelonMesa and CentCom Contributors</Authors>
<Copyright>Copyright © $([System.DateTime]::Now.Year) MelonMesa and CentCom Contributors</Copyright>
</PropertyGroup>
<Choose>
<When Condition="'$(GITHUB_SHA)' != ''">
<PropertyGroup>
<SourceRevisionId>$(GITHUB_SHA)</SourceRevisionId>
</PropertyGroup>
</When>
<When Condition="'$(SourceRevisionId)' == ''">
<PropertyGroup>
<DotGitDir>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory).git'))</DotGitDir>
<HeadFileContent Condition="Exists('$(DotGitDir)/HEAD')">$([System.IO.File]::ReadAllText('$(DotGitDir)/HEAD').Trim())</HeadFileContent>
<RefPath Condition="$(HeadFileContent.StartsWith('ref: '))">$(DotGitDir)/$(HeadFileContent.Substring(5))</RefPath>
<SourceRevisionId Condition="'$(RefPath)' != '' AND Exists('$(RefPath)')">$([System.IO.File]::ReadAllText('$(RefPath)').Trim())</SourceRevisionId>
<SourceRevisionId Condition="'$(HeadFileContent)' != '' AND '$(RefPath)' == ''">$(HeadFileContent)</SourceRevisionId>
</PropertyGroup>
</When>
</Choose>
</Project>