ios_android_toolbox 0.0.24 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'rubygems'
4
+ require 'optparse'
5
+ require 'ios_android_toolbox/ios_prov_profile'
6
+
7
+ include IosAndroidToolbox
8
+
9
+ class FindProvProfile
10
+ def parse_args
11
+ options = {}
12
+ OptionParser.new do |opts|
13
+ opts.banner = "Usage: find_prov_profile.rb [options] <info.plist>"
14
+
15
+ opts.on("-i", "--id [BUNDLE_ID]", String, "Specifies the bundle ID") do |v|
16
+ options[:bundle_id] = v
17
+ end
18
+
19
+ opts.on("-a", "--adhoc", "Specifies the profile should an adhoc profile") do
20
+ options[:profile_type] = :adhoc
21
+ end
22
+
23
+ opts.on("-d", "--development", "The profile should be a development profile") do
24
+ options[:profile_type] = :dev
25
+ end
26
+
27
+ opts.on("-s", "--appstore", "The profile should be an App Store profile") do
28
+ options[:profile_type] = :dist
29
+ end
30
+ end.parse!
31
+ options
32
+ end
33
+
34
+ def run(args)
35
+ options = parse_args
36
+
37
+ bundle_id = options[:bundle_id]
38
+ bundle_id or raise "You must specify the bundle ID"
39
+
40
+ type = options[:profile_type]
41
+ type or raise "You must specify the type of profile"
42
+
43
+ path = nil
44
+ IosProvisioningProfile.loop_through_profiles_for_app_id(bundle_id) do |profile|
45
+ path = profile.path if type == :adhoc and profile.is_adhoc?
46
+ path = profile.path if type == :dev and profile.is_development?
47
+ path = profile.path if type == :dist and profile.is_production?
48
+ end
49
+
50
+ if path.nil?
51
+ exit 1
52
+ end
53
+
54
+ puts path
55
+ end
56
+ end
57
+
58
+ FindProvProfile.new.run(ARGV)
data/bin/get_app_id.rb ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/ruby
2
+
3
+ require 'rubygems'
4
+ require 'optparse'
5
+ require 'ios_android_toolbox'
6
+ require 'ios_android_toolbox'
7
+
8
+ include IosAndroidToolbox
9
+
10
+ version_file = VersionController.version_file
11
+ raise "Please specify the version file" if version_file.nil?
12
+
13
+ ctrl = version_controller_for_version_file version_file
14
+
15
+ puts ctrl.app_id
16
+
17
+
@@ -53,6 +53,10 @@ module IosAndroidToolbox
53
53
  def version
54
54
  @manifest[ANDROID_VERSION_NAME]
55
55
  end
56
+
57
+ def app_id
58
+ raise "Not implemented yet."
59
+ end
56
60
 
57
61
  def version_code
58
62
  @manifest[ANDROID_VERSION_CODE]
@@ -53,6 +53,10 @@ module IosAndroidToolbox
53
53
  raise "Abstract method. Please override"
54
54
  end
55
55
 
56
+ def app_id
57
+ raise "Abstract method. Please override"
58
+ end
59
+
56
60
  def components
57
61
  v = version
58
62
  if version.match /([0-9\.]+)([a-zA-Z0-9\-]*)$/
@@ -12,6 +12,7 @@ module IosAndroidToolbox
12
12
  SHORT_VERSION_KEY = 'CFBundleShortVersionString'
13
13
  URL_TYPES_KEY = "CFBundleURLTypes"
14
14
  URL_SCHEMES_KEY = "CFBundleURLSchemes"
15
+ BUNDLE_IDENTIFIER_KEY = "CFBundleIdentifier"
15
16
 
16
17
  def self.find_project_info_candidates_for_dir(dir)
17
18
  candidates = []
@@ -51,6 +52,14 @@ module IosAndroidToolbox
51
52
  @dict[VERSION_KEY]
52
53
  end
53
54
 
55
+ def bundle_id
56
+ @dict[BUNDLE_IDENTIFIER_KEY]
57
+ end
58
+
59
+ def app_id
60
+ bundle_id
61
+ end
62
+
54
63
  def next_version!(inc_idx = nil)
55
64
  @dict[SHORT_VERSION_KEY] = @dict[VERSION_KEY] = next_version
56
65
  end
@@ -39,6 +39,10 @@ module IosAndroidToolbox
39
39
  end
40
40
  end
41
41
 
42
+ def path
43
+ File.join(PROV_PROFILE_DIR,uuid+".mobileprovision")
44
+ end
45
+
42
46
  def app_id
43
47
  @app_id ||= begin
44
48
  id = plist['Entitlements']['application-identifier']
@@ -83,6 +87,10 @@ module IosAndroidToolbox
83
87
  provisioned_devices.nil? and get_task_allow == false
84
88
  end
85
89
 
90
+ def is_adhoc?
91
+ provisioned_devices.is_a? Array and get_task_allow == false
92
+ end
93
+
86
94
  def is_development_aps_environment?
87
95
  aps_environment == 'development'
88
96
  end
@@ -1,3 +1,3 @@
1
1
  module IosAndroidToolbox
2
- VERSION = "0.0.24"
2
+ VERSION = "0.0.25"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ios_android_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 24
10
- version: 0.0.24
9
+ - 25
10
+ version: 0.0.25
11
11
  platform: ruby
12
12
  authors:
13
13
  - Igor Sales
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-05-13 00:00:00 Z
18
+ date: 2013-07-09 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: ""
@@ -25,6 +25,8 @@ executables:
25
25
  - abandon_topic_branch.rb
26
26
  - android_prepare_for_release.rb
27
27
  - find_project_info_plist.rb
28
+ - find_prov_profile.rb
29
+ - get_app_id.rb
28
30
  - get_app_path_from_xcodebuild_log.rb
29
31
  - get_version.rb
30
32
  - inc_version.rb
@@ -43,6 +45,8 @@ files:
43
45
  - bin/abandon_topic_branch.rb
44
46
  - bin/android_prepare_for_release.rb
45
47
  - bin/find_project_info_plist.rb
48
+ - bin/find_prov_profile.rb
49
+ - bin/get_app_id.rb
46
50
  - bin/get_app_path_from_xcodebuild_log.rb
47
51
  - bin/get_version.rb
48
52
  - bin/inc_version.rb