Using git command instead %git% parameter in script. If git command not exist creating empty text file.

Also added script for create empty APIKeysLocal.cs file if it is not exist.
This commit is contained in:
Jaex 2014-06-05 02:14:45 +03:00
parent 3185442111
commit cd8deaaeb0
4 changed files with 14 additions and 11 deletions

View file

@ -521,7 +521,13 @@
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>"$(ProjectDir)prebuild.cmd" "$(ProjectDir)" "GitHash.txt"</PreBuildEvent>
<PreBuildEvent>cd $(ProjectDir)
for %25%25x in (git.exe) do if not [%25%25~$PATH:x]==[] (
git rev-parse HEAD &gt; GitHash.txt
) else (
type nul &gt; GitHash.txt
)</PreBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View file

@ -1,6 +0,0 @@
cd %1
if defined git (
"%git%" rev-parse HEAD > %2
) else (
type nul > %2
)

View file

@ -25,10 +25,6 @@ You should have received a copy of the GNU General Public License
namespace UploadersLib
{
/////////////////////////////////////////////////////////////////////////////
// Note: For be able to compile project create empty APIKeysLocal.cs file. //
/////////////////////////////////////////////////////////////////////////////
public static partial class APIKeys
{
// Image Uploaders

View file

@ -428,6 +428,13 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<PropertyGroup>
<PreBuildEvent>cd $(ProjectDir)APIKeys\
if not exist APIKeysLocal.cs (
type nul &gt; APIKeysLocal.cs
)</PreBuildEvent>
</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.
<Target Name="BeforeBuild">