2015-10-22 22:01:08 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
|
|
from xml.dom.minidom import parse
|
|
|
|
dom1 = parse("AndroidManifest.xml")
|
|
|
|
oldVersion = dom1.documentElement.getAttribute("android:versionCode")
|
|
|
|
versionNumbers = oldVersion.split('.')
|
|
|
|
|
2016-03-19 18:18:06 +00:00
|
|
|
versionName = dom1.documentElement.getAttribute("android:versionName")
|
2016-03-20 16:46:26 +00:00
|
|
|
versionName = versionName + "_GIT"
|
2016-03-19 18:18:06 +00:00
|
|
|
|
2015-10-22 22:01:08 +00:00
|
|
|
versionNumbers[-1] = unicode(int(time.time()))
|
|
|
|
dom1.documentElement.setAttribute("android:versionCode", u'.'.join(versionNumbers))
|
2016-03-19 18:18:06 +00:00
|
|
|
dom1.documentElement.setAttribute("android:versionName", versionName)
|
2015-10-22 22:01:08 +00:00
|
|
|
|
|
|
|
with open("AndroidManifest.xml", 'wb') as f:
|
|
|
|
for line in dom1.toxml("utf-8"):
|
|
|
|
f.write(line)
|
|
|
|
|