mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-03-29 22:43:28 +08:00
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:
@@ -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" }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user