deploygate 0.4.0 → 0.4.1

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzJhMjA3ODg1OTY2ZmUwMjdjODgyZjBhYWViNjY1YmI4YzYwZDQ4MA==
4
+ YzI3ZjM5YmJmY2I1YmZlYzBiYWMxNDMwM2U1NjQ0NjVjNGMxZjRmYg==
5
5
  data.tar.gz: !binary |-
6
- NjU4N2M4YWQ2NjJkOWY3YzliYjMxYzQxMjg1MDdmMjVmOGZhNzgyNg==
6
+ ODg5YTEzOGZiMTAxOGRmNjdlMzY2NmQ3ZjI4MmRjZjk5ODllMDk0OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjEzZGM5MDc1NDEwMjUzMjg5ZmUyMDc5NDVjYTBhOTEyZThlMzQ2MDIxM2Qy
10
- ZDgxYTFmOWQ0ZmUyYzkwODliMWFhN2I2MjZlMjNhNjM2NDE5ZjQ0YjQ4MzNi
11
- MjIxNDgyZmM3ZmM1NGNmZDUwMTNhNDk1NWJlNGI3NjYwNmNlMTE=
9
+ YmMxOTNmNzg1MmM0NzhmMDhmMzE2ZWExNzIxZjBhNjllMWU3ZGVjZTkwYzJi
10
+ ODk0NDgyMDMzMjZkNzUwMzNmNDAwN2UyNGZmNWRmZDI1NDNhZGEwZjYwNTA4
11
+ MGE5M2Y2OGY1NTEwMjVhY2QxYzBkNTJjMzlhZWMxNzUxZTI5OWE=
12
12
  data.tar.gz: !binary |-
13
- MDkyODc5NWI4YjAzMzQ3ZGNhMGJjN2QyNmE2NzM4M2Y0NWY3YjQ5YTNlZmUw
14
- NDY3ZTk5NDkzYTdkYTYyMzlhNTM5MWQ3ZWY4YTA2NzI0ZWRhNDUyNjg1YTc0
15
- YWRkODNiN2QzZTE2MzkyOGMxYTk2ZThkMjk5MDU0YmE4NzI0MjE=
13
+ YjkyODMyOWM1N2EwZWRlOGEzZDhhODMzMGNhMWZhZDljNjVhYjljZTA4ZDNl
14
+ MTAzYTNkZDFkNDMxNzRhZjM4YTM5ZjEzYWE0OGZhYzE3YWY2ZTU5NWI3ODcw
15
+ MjgwYzc5ZTBiMjVlMDZiMzU1ZjRlYTcxMDhjMmYyZjE1ZmU0NmY=
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ env:
3
3
  global:
4
4
  secure: gGY+C54Cfp082o5Oaf6tZqzfOlXsWSMcVNvTpoOgMfJGsHo//d9t/si9Bn1pFaFyjJedW+IcC0pt+FcKVCDgnsUaL0Y0HT/ZsGkV8k7vv9F5nbHOde4nk189Sr2HtHR3wdr7KaMh2/DialisnqllxgzxA/wRLfHKsjqRsjWUw/VWL5E7Z734mzpTGE2mVJNRj02/cs0Y/izZgdi6wrt4lEZfxE3jS+QkJZHMjGNfcwvH26whU6oX1PiJ4o5xl0Rr8Q8xav3wbtTCcOJNPSeMkkiH5sSXuqrjI6kgwvjlByKhyg2Ws0GvZLxAfTml+Vo5po1uWsohdZJaJcEhd4GsGfbMZWCFuBP2mCE+gVmkkMeJxRKnWoi6NotgPmqG1JWlzGngDB/hJ4wuuh+swa0KJvZGiMEJ5P3GNydCybEPOsk1Ww+lUkXRHxD+/LW03EkxMd5LA3He/nYXz3pWCYA6qcFgrYMmq+3ozjSaQr+1d/Iu14Awv5+cwCltPfl5bERDno0jc0TdSs/7qplAL/efpjBsP7DkGE5r521gg8mIiXx509jU08i9S60SXiw0RBnYyjE5SzlsiOqaFdJxVygDGcDIAA/GTefLHO9i3SinZHFS6jr3Xi/vpOIc7Jz4W2Jmuqv+CJP4gspPoAxdWOE/QipTt0Jv4kCMf7dJwd9jaRc=
5
5
  rvm:
6
- - 2.0.0
6
+ - 2.2.0
7
7
  script:
8
8
  - bundle exec rake
9
9
  deploy:
@@ -54,6 +54,7 @@ en:
54
54
  print_no_target: |
55
55
  No deploy target found.
56
56
  Please run dg on the root directory of Android/iOS project or specify .apk/.ipa file to deploy.
57
+ print_no_install_xcode: 'Unable to locate Xcode. Please make sure to have Xcode installed on your machine'
57
58
  push:
58
59
  upload:
59
60
  loading: 'Uploading to %{owner}..'
@@ -33,13 +33,17 @@ module DeployGate
33
33
 
34
34
  bundle_identifier = analyze.target_bundle_identifier
35
35
  xcode_provisioning_profile_uuid = analyze.target_xcode_setting_provisioning_profile_uuid
36
- target_provisioning_profile = DeployGate::Xcode::Export.provisioning_profile(bundle_identifier, xcode_provisioning_profile_uuid)
36
+
37
+ provisioning_team = analyze.provisioning_team
38
+ target_provisioning_profile = DeployGate::Xcode::Export.provisioning_profile(bundle_identifier, xcode_provisioning_profile_uuid, provisioning_team)
37
39
 
38
40
  method = DeployGate::Xcode::Export.method(target_provisioning_profile)
39
41
 
40
42
  codesigning_identity= nil
41
- unless analyze.automatic_provisioning?
42
- # Only run Provisioning Style is Manual
43
+ provisioning_style = analyze.provisioning_style
44
+ if (!over_xcode_8? && provisioning_style == nil) ||
45
+ provisioning_style == DeployGate::Xcode::Analyze::PROVISIONING_STYLE_MANUAL
46
+ # Only run Provisioning Style is Manual or nil
43
47
  codesigning_identity = DeployGate::Xcode::Export.codesigning_identity(target_provisioning_profile)
44
48
  end
45
49
 
@@ -52,6 +56,22 @@ module DeployGate
52
56
  puts HighLine.color(I18n.t('commands.deploy.build.print_no_target'), HighLine::YELLOW)
53
57
  puts ''
54
58
  end
59
+
60
+ def over_xcode_8?
61
+ version = Gym::Xcode.xcode_version
62
+ if version == nil
63
+ print_no_install_xcode
64
+ exit 1
65
+ end
66
+
67
+ version.split('.')[0].to_i >= 8
68
+ end
69
+
70
+ def print_no_install_xcode
71
+ puts ''
72
+ puts HighLine.color(I18n.t('commands.deploy.build.print_no_install_xcode'), HighLine::YELLOW)
73
+ puts ''
74
+ end
55
75
  end
56
76
  end
57
77
  end
@@ -1,3 +1,3 @@
1
1
  module DeployGate
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -6,6 +6,9 @@ module DeployGate
6
6
  BASE_WORK_DIR_NAME = 'project.xcworkspace'
7
7
  BUILD_CONFIGRATION = 'Release'
8
8
 
9
+ PROVISIONING_STYLE_AUTOMATIC = 'Automatic'
10
+ PROVISIONING_STYLE_MANUAL = 'Manual'
11
+
9
12
  class BundleIdentifierDifferentError < DeployGate::NotIssueError
10
13
  end
11
14
 
@@ -81,35 +84,61 @@ module DeployGate
81
84
  UUID.validate(uuid) ? uuid : nil
82
85
  end
83
86
 
84
- def automatic_provisioning?
85
- get_provisioning_style == 'Automatic'
86
- end
87
+ def provisioning_style
88
+ target = target_provisioning_info
87
89
 
88
- private
90
+ style = PROVISIONING_STYLE_MANUAL
91
+ if target
92
+ # Manual or Automatic or nil (Xcode7 below)
93
+ begin
94
+ style = target['ProvisioningStyle']
95
+ rescue
96
+ # Not catch error
97
+ end
98
+ end
89
99
 
90
- def target_build_configration
91
- target_project_setting.build_configuration_list.build_configurations.reject{|conf| conf.name != BUILD_CONFIGRATION}.first
100
+ style
92
101
  end
93
102
 
94
- def target_product_name
95
- target_project_setting.product_name
103
+ def provisioning_team
104
+ target = target_provisioning_info
105
+
106
+ team = nil
107
+ if target
108
+ begin
109
+ team = target['DevelopmentTeam']
110
+ rescue
111
+ # Not catch error
112
+ end
113
+ end
114
+
115
+ team
96
116
  end
97
117
 
98
- def get_provisioning_style
118
+ private
119
+
120
+ def target_provisioning_info
99
121
  main_target = target_project_setting
100
122
  main_target_uuid = main_target && main_target.uuid
101
123
 
102
- style = 'Manual'
124
+ target = nil
103
125
  if main_target_uuid
104
- # Manual or Automatic
105
126
  begin
106
- style = target_project.root_object.attributes['TargetAttributes'][main_target_uuid]['ProvisioningStyle']
127
+ target = target_project.root_object.attributes['TargetAttributes'][main_target_uuid]
107
128
  rescue
108
129
  # Not catch error
109
130
  end
110
131
  end
111
132
 
112
- style
133
+ target
134
+ end
135
+
136
+ def target_build_configration
137
+ target_project_setting.build_configuration_list.build_configurations.reject{|conf| conf.name != BUILD_CONFIGRATION}.first
138
+ end
139
+
140
+ def target_product_name
141
+ target_project_setting.product_name
113
142
  end
114
143
 
115
144
  def target_project_setting
@@ -10,11 +10,11 @@ module DeployGate
10
10
 
11
11
  # @param [String] bundle_identifier
12
12
  # @param [String] uuid
13
+ # @param [String] provisioning_team
13
14
  # @return [String]
14
- def provisioning_profile(bundle_identifier, uuid = nil)
15
- local_teams = DeployGate::Xcode::Export.find_local_data(bundle_identifier, uuid)
15
+ def provisioning_profile(bundle_identifier, uuid = nil, provisioning_team = nil)
16
+ local_teams = DeployGate::Xcode::Export.find_local_data(bundle_identifier, uuid, provisioning_team)
16
17
 
17
- target_provisioning_profile = nil
18
18
  case local_teams.teams_count
19
19
  when 0
20
20
  target_provisioning_profile = create_provisioning(bundle_identifier, uuid)
@@ -30,8 +30,9 @@ module DeployGate
30
30
 
31
31
  # @param [String] bundle_identifier
32
32
  # @param [String] uuid
33
+ # @param [String] provisioning_team
33
34
  # @return [LocalTeams]
34
- def find_local_data(bundle_identifier, uuid = nil)
35
+ def find_local_data(bundle_identifier, uuid = nil, provisioning_team = nil)
35
36
  local_teams = LocalTeams.new
36
37
 
37
38
  profile_paths = load_profile_paths
@@ -44,6 +45,8 @@ module DeployGate
44
45
  entities = profile['Entitlements']
45
46
  unless entities['get-task-allow']
46
47
  team_id = entities['com.apple.developer.team-identifier']
48
+ next if provisioning_team != nil && team_id != provisioning_team
49
+
47
50
  application_id = entities['application-identifier']
48
51
  application_id.slice!(/^#{team_id}\./)
49
52
  application_id = '.' + application_id if application_id == '*'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploygate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - deploygate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json