Browse Source

Embed last git commit hash in binary.

Starbeamrainbowlabs 2 years ago
parent
commit
3e4a860280
2 changed files with 9 additions and 1 deletions
  1. 4
    0
      .gitignore
  2. 5
    1
      cscz/cscz.csproj

+ 4
- 0
.gitignore View File

@@ -1,3 +1,7 @@
1
+# Extras
2
+# The commit hash file generated before the build process
3
+git-hash.txt
4
+
1 5
 # ---> C Sharp
2 6
 # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
3 7
 [Bb]in/

+ 5
- 1
cscz/cscz.csproj View File

@@ -46,5 +46,9 @@
46 46
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
47 47
   <ItemGroup>
48 48
     <EmbeddedResource Include="Help.md" />
49
+    <EmbeddedResource Include="git-hash.txt" />
49 50
   </ItemGroup>
50
-</Project>
51
+  <PropertyGroup>
52
+    <PreBuildEvent IgnoreExitCode="true">git rev-parse HEAD &gt;../../git-hash.txt</PreBuildEvent>
53
+  </PropertyGroup>
54
+</Project>

Loading…
Cancel
Save