Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
53 lines (48 loc) · 2.54 KB
/
Copy pathDirectory.Build.props
File metadata and controls
53 lines (48 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisLevel>latest-recommended</AnalysisLevel>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<Authors>Hoobi</Authors>
<Product>Earmark</Product>
<Company>Hoobi</Company>
<Copyright>Copyright (c) Hoobi $([System.DateTime]::Now.Year)</Copyright>
<NeutralLanguage>en-US</NeutralLanguage>
<Version>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)version.txt').Trim())</Version>
</PropertyGroup>
<!--
Build-channel + commit stamping for the App's About box and update check (read at runtime
via Services/AppInfo). Scoped to Earmark.App so the git probe runs once, not per project.
EarmarkBuildChannel: "Dev" for local builds, "Release" under GitHub Actions. CI passes
-p:EarmarkBuildChannel=Prerelease for release-please pre-release builds. AppInfo turns the
channel into the "(Dev)"/"(Pre-release)" marker and gates the update UI.
-->
<PropertyGroup Condition="'$(MSBuildProjectName)' == 'Earmark.App'">
<EarmarkBuildChannel Condition="'$(EarmarkBuildChannel)' == '' and '$(GITHUB_ACTIONS)' == 'true'">Release</EarmarkBuildChannel>
<EarmarkBuildChannel Condition="'$(EarmarkBuildChannel)' == ''">Dev</EarmarkBuildChannel>
</PropertyGroup>
<ItemGroup Condition="'$(MSBuildProjectName)' == 'Earmark.App'">
<AssemblyMetadata Include="BuildChannel" Value="$(EarmarkBuildChannel)" />
</ItemGroup>
<!-- Stamp the source commit so the SDK appends "+<sha>" to InformationalVersion. ContinueOnError
keeps non-git checkouts (or a missing git) from breaking the build; AppInfo just shows no
commit then. -->
<Target Name="EarmarkStampSourceRevision"
Condition="'$(MSBuildProjectName)' == 'Earmark.App' and '$(SourceRevisionId)' == ''"
BeforeTargets="GetAssemblyVersion;InitializeSourceControlInformation">
<Exec Command="git -C "$(MSBuildProjectDirectory)" rev-parse HEAD"
ConsoleToMSBuild="true"
StandardOutputImportance="low"
ContinueOnError="true"
IgnoreExitCode="true">
<Output TaskParameter="ConsoleOutput" PropertyName="_EarmarkGitHead" />
</Exec>
<PropertyGroup>
<SourceRevisionId Condition="'$(_EarmarkGitHead)' != ''">$(_EarmarkGitHead.Trim())</SourceRevisionId>
</PropertyGroup>
</Target>
</Project>