Added 'git describe' version.

This commit is contained in:
2013-04-22 01:47:45 +04:00
parent dbaf5b4720
commit c300d95089
3 changed files with 22 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.dyndns.vahagn.sokoban" package="org.dyndns.vahagn.sokoban"
android:versionCode="0x00010000" android:versionCode="0x00010000"
android:versionName="1.0"> android:versionName="@string/git_version">
<uses-sdk android:minSdkVersion="10" <uses-sdk android:minSdkVersion="10"
android:targetSdkVersion="14"/> android:targetSdkVersion="14"/>
<application android:label="@string/app_name" <application android:label="@string/app_name"

11
custom_rules.xml Normal file
View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="custom_rules">
<target name="-pre-build">
<exec executable="cmd.exe" failonerror="true">
<arg line="/C version.bat"/>
<!--env key="NDK_MODULE_PATH" path="..:../native/ext"/-->
</exec>
</target>
</project>

View File

@@ -1,3 +1,4 @@
@echo off
rem rem
rem Copyright 2005-2013 Vahagn Khachatryan. rem Copyright 2005-2013 Vahagn Khachatryan.
rem rem
@@ -15,17 +16,16 @@ rem
rem rem
rem Generate res\values\version.xml for windows. rem Generate res\values\version.xml for windows.
rem rem
set VERSION_XML=res\values\version.xml set VERSION_XML=res\values\version.xml
echo on
echo ^<?xml version="1.0" encoding="utf-8"?^> > %VERSION_XML% @echo ^<?xml version="1.0" encoding="utf-8"?^> > %VERSION_XML%
echo ^<resources^> >> %VERSION_XML% @echo ^<resources^> >> %VERSION_XML%
for /F "delims=" %%i in ('"git describe --tags --long --dirty=-x --abbrev=8"') do set VERSION=%%i @for /F "delims=" %%i in ('"git describe --tags --long --dirty=-x --abbrev=8"') do set VERSION=%%i
echo ^<string name="gitversion"^>%VERSION%^</string^> >> %VERSION_XML% echo ^<string name="git_version"^>%VERSION%^</string^> >> %VERSION_XML%
for /F "delims=" %%i in ('"git rev-parse HEAD"') do set GITHASH=%%i @for /F "delims=" %%i in ('"git rev-parse HEAD"') do set GITHASH=%%i
echo ^<string name="githash"^>%GITHASH%^</string^> >> %VERSION_XML% echo ^<string name="git_hash"^>%GITHASH%^</string^> >> %VERSION_XML%
for /F "delims=" %%i in ('"%USERPROFILE%\bin\date.exe -R"') do set BUILDDATE=%%i @for /F "delims=" %%i in ('"%USERPROFILE%\bin\date.exe -R"') do set BUILDDATE=%%i
echo ^<string name="builddate"^>%BUILDDATE%^</string^> >> %VERSION_XML% echo ^<string name="builddate"^>%BUILDDATE%^</string^> >> %VERSION_XML%
echo ^</resources^> >> %VERSION_XML% @echo ^</resources^> >> %VERSION_XML%