ios_android_toolbox 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'rubygems'
4
+ require 'optparse'
5
+ require 'ios_android_toolbox'
6
+ require 'ios_android_toolbox/ios'
7
+ require 'ios_android_toolbox/android'
8
+
9
+ include IosAndroidToolbox
10
+
11
+ version_file = VersionController.version_file
12
+ raise "Please specify the info.plist file" if version_file.nil?
13
+
14
+ raise "This script only works with Android projects" if (!is_android_project? and is_android_file? version_file)
15
+
16
+ ctrl = version_controller_for_version_file version_file
17
+
18
+ ctrl.set_debuggable(false)
19
+ ctrl.release_version
20
+
21
+ $output_file = version_file if $output_file == nil
22
+ ctrl.write_to_output_file($output_file)
23
+
24
+
@@ -12,6 +12,8 @@ module IosAndroidToolbox
12
12
  ANDROID_NS='android:'
13
13
  ANDROID_VERSION_CODE='versionCode'
14
14
  ANDROID_VERSION_NAME='versionName'
15
+ APP='application'
16
+ ANDROID_DEBUGGABLE='debuggable'
15
17
 
16
18
  def self.find_project_info_candidates_for_dir(dir)
17
19
  candidates = []
@@ -59,6 +61,26 @@ module IosAndroidToolbox
59
61
  def next_version!(inc_idx = nil)
60
62
  @manifest[ANDROID_NS+ANDROID_VERSION_NAME] = next_version
61
63
  end
64
+
65
+ def next_version_code
66
+ version_code.to_i + 1
67
+ end
68
+
69
+ def next_version_code!
70
+ @manifest[ANDROID_NS+ANDROID_VERSION_CODE] = next_version_code
71
+ end
72
+
73
+ def application
74
+ @manifest.xpath(APP, 'android' => "http://schemas.android.com/apk/res/android").first
75
+ end
76
+
77
+ def set_debuggable(on = true)
78
+ application[ANDROID_NS+ANDROID_DEBUGGABLE] = (on ? 'true' : 'false')
79
+ end
80
+
81
+ def release_version
82
+ @manifest[ANDROID_NS+ANDROID_VERSION_NAME] = components.slice(0,3).join "."
83
+ end
62
84
 
63
85
  def write_to_xml_file(output_file)
64
86
  if output_file == '-'
@@ -1,3 +1,3 @@
1
1
  module IosAndroidToolbox
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ios_android_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 27
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 1
9
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Igor Sales
@@ -14,8 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-12-23 00:00:00 -05:00
18
- default_executable:
18
+ date: 2011-12-27 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: ""
@@ -23,6 +23,7 @@ email:
23
23
  - self@igorsales.ca
24
24
  executables:
25
25
  - abandon_topic_branch.rb
26
+ - android_prepare_for_release.rb
26
27
  - find_project_info_plist.rb
27
28
  - get_app_path_from_xcodebuild_log.rb
28
29
  - get_version.rb
@@ -39,6 +40,7 @@ files:
39
40
  - Gemfile
40
41
  - Rakefile
41
42
  - bin/abandon_topic_branch.rb
43
+ - bin/android_prepare_for_release.rb
42
44
  - bin/find_project_info_plist.rb
43
45
  - bin/get_app_path_from_xcodebuild_log.rb
44
46
  - bin/get_version.rb
@@ -52,7 +54,6 @@ files:
52
54
  - lib/ios_android_toolbox/base.rb
53
55
  - lib/ios_android_toolbox/ios.rb
54
56
  - lib/ios_android_toolbox/version.rb
55
- has_rdoc: true
56
57
  homepage: ""
57
58
  licenses: []
58
59
 
@@ -62,23 +63,27 @@ rdoc_options: []
62
63
  require_paths:
63
64
  - lib
64
65
  required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
65
67
  requirements:
66
68
  - - ">="
67
69
  - !ruby/object:Gem::Version
70
+ hash: 3
68
71
  segments:
69
72
  - 0
70
73
  version: "0"
71
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
72
76
  requirements:
73
77
  - - ">="
74
78
  - !ruby/object:Gem::Version
79
+ hash: 3
75
80
  segments:
76
81
  - 0
77
82
  version: "0"
78
83
  requirements: []
79
84
 
80
85
  rubyforge_project: ios_android_toolbox
81
- rubygems_version: 1.3.6
86
+ rubygems_version: 1.8.13
82
87
  signing_key:
83
88
  specification_version: 3
84
89
  summary: Toolbox to manipulate iOS/Android projects