Properly revert Revision.cs when building, and add build configuration information to Revision.cs.

This commit is contained in:
wfowler
2018-12-31 15:04:48 -07:00
parent e2a88ef860
commit a07c8e86cf
2 changed files with 7 additions and 8 deletions

View File

@@ -113,6 +113,11 @@ echo namespace LibBSP {>> Revision.cs
echo public class Revision {>> Revision.cs
echo public const string version = "%25revision%25";>> Revision.cs
echo public const string head = "%25head%25";>> Revision.cs
echo #if DEBUG>> Revision.cs
echo public const string configuration = "Debug";>> Revision.cs
echo #else>> Revision.cs
echo public const string configuration = "Release";>> Revision.cs
echo #endif>> Revision.cs
echo }>> Revision.cs
echo }&gt;&gt; Revision.cs</PreBuildEvent>
</PropertyGroup>
@@ -120,14 +125,7 @@ echo }&gt;&gt; Revision.cs</PreBuildEvent>
<PostBuildEvent>cd..
cd..
cd Source\Util
del /Q Revision.cs
type nul&gt; Revision.cs
echo namespace LibBSP {&gt;&gt; Revision.cs
echo public class Revision {&gt;&gt; Revision.cs
echo public const string version = "To be replaced on build";&gt;&gt; Revision.cs
echo public const string head = "To be replaced on build";&gt;&gt; Revision.cs
echo }&gt;&gt; Revision.cs
echo }&gt;&gt; Revision.cs</PostBuildEvent>
git checkout Revision.cs</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -2,5 +2,6 @@ namespace LibBSP {
public class Revision {
public const string version = "To be replaced on build";
public const string head = "To be replaced on build";
public const string configuration = "To be replaced on build";
}
}