[DEV] add versionCode

This commit is contained in:
Edouard DUPIN 2014-04-13 16:53:45 +02:00
parent 111ed6d4ea
commit c7fe6ef117
2 changed files with 6 additions and 1 deletions

View File

@ -80,6 +80,7 @@ class Module:
"PRIORITY" : set(""),
"DESCRIPTION" : set(""),
"VERSION" : set("0.0.0"),
"VERSION_CODE" : "",
"NAME" : set("no-name"), # name of the application
"ANDROID_MANIFEST" : "", # By default generate the manifest
"ANDROID_JAVA_FILES" : ["DEFAULT"], # when user want to create his own services and activities
@ -658,6 +659,8 @@ class Module:
self.packageProp[variable] = value
elif "VERSION" == variable:
self.packageProp[variable] = value
elif "VERSION_CODE" == variable:
self.packageProp[variable] = value
elif "NAME" == variable:
self.packageProp[variable] = value
elif "ANDROID_MANIFEST" == variable:

View File

@ -307,13 +307,15 @@ class Target(lutinTarget.Target):
debug.print_element("pkg", "AndroidManifest.xml", "<==", pkgProperties["ANDROID_MANIFEST"])
lutinTools.copy_file(pkgProperties["ANDROID_MANIFEST"], self.get_staging_folder(pkgName) + "/AndroidManifest.xml", True)
else:
if "VERSION_CODE" not in pkgProperties:
pkgProperties["VERSION_CODE"] = "1"
debug.print_element("pkg", "AndroidManifest.xml", "<==", "package configurations")
tmpFile = open(self.get_staging_folder(pkgName) + "/AndroidManifest.xml", 'w')
tmpFile.write( '<?xml version="1.0" encoding="utf-8"?>\n')
tmpFile.write( '<!-- Manifest is autoGenerated with Ewol ... do not patch it-->\n')
tmpFile.write( '<manifest xmlns:android="http://schemas.android.com/apk/res/android" \n')
tmpFile.write( ' package="' + compleatePackageName + '" \n')
tmpFile.write( ' android:versionCode="1" \n')
tmpFile.write( ' android:versionCode="'+pkgProperties["VERSION_CODE"]+'" \n')
tmpFile.write( ' android:versionName="'+pkgProperties["VERSION"]+'"> \n')
tmpFile.write( ' <uses-feature android:glEsVersion="0x00020000" android:required="true" />\n')
tmpFile.write( ' <uses-sdk android:minSdkVersion="' + str(self.boardId) + '" \n')