add app.version_name, app.version_code, and app.version(code, name) to specify app versioning when generating the manifest file

This commit is contained in:
Laurent Sansonetti
2014-05-20 12:00:14 +02:00
parent 274b13770e
commit bbe51897e7
2 changed files with 9 additions and 2 deletions

View File

@@ -151,7 +151,7 @@ EOS
android_manifest_txt = ''
android_manifest_txt << <<EOS
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="#{App.config.package}" android:versionCode="1" android:versionName="1.0">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="#{App.config.package}" android:versionCode="#{App.config.version_code}" android:versionName="#{App.config.version_name}">
<uses-sdk android:minSdkVersion="#{App.config.api_version}"/>
EOS
App.config.manifest_xml_lines(nil).each { |line| android_manifest_txt << "\t" + line + "\n" }

View File

@@ -29,7 +29,7 @@ module Motion; module Project;
variable :sdk_path, :ndk_path, :avd_config, :package, :main_activity,
:sub_activities, :api_version, :arch, :assets_dirs, :icon,
:logs_components
:logs_components, :version_code, :version_name
def initialize(project_dir, build_mode)
super
@@ -42,6 +42,8 @@ module Motion; module Project;
@manifest_entries = {}
@release_keystore_path = nil
@release_keystore_alias = nil
@version_code = '1'
@version_name = '1.0'
end
def validate
@@ -234,5 +236,10 @@ module Motion; module Project;
@release_keystore_path = path
@release_keystore_alias = alias_name
end
def version(code, name)
@version_code = code
@version_name = name
end
end
end; end