fastlane_core 0.43.3 → 0.43.4

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dec70f9af0189cb95d059bf6235e5fdb06bdd566
4
- data.tar.gz: 42c1c4810eec48f3485a90d68297f8904d7788b5
3
+ metadata.gz: 7667300e797c5d36feb9772963169a2510da304c
4
+ data.tar.gz: ed5483513d6fa906e37df906b11ddbe5b8340da1
5
5
  SHA512:
6
- metadata.gz: d15cbd14e8e175e139caa99dcc27b2ce1513bf2fd3f479f6c994c8df6fee287a6b944c82d20d1e57ce5f8b183cf6b3d05f8d73af783073189bd649afea255e45
7
- data.tar.gz: eff76516a1a921b4edbdeb7ea5f9ab0ec4508f10dd555957b79a8ce48bdd401590f5f72bd23f178c5d3a3deb0104026228065049a1aa754255c920259e988ca7
6
+ metadata.gz: 087fc94a72ac099d3a739df725578e13f34e0b084d5cd5cf68704c46f368a9fc2d4b7c243ef033707e859f8acfe2b75e18236462c3b43660e5d97dcec9e6f76a
7
+ data.tar.gz: b0184628d18f8553fb264f807ffff7a2b9a757dab3931f713f81254b7f6367e7414ca228fe270ffbc554d9f2c242de1ae53b9178db7dc2d4214684900cf660aa
@@ -69,7 +69,7 @@ module FastlaneCore
69
69
  params = {}
70
70
  params["ci"] = "1" if Helper.is_ci?
71
71
 
72
- project_hash = p_hash
72
+ project_hash = p_hash(ARGV, gem_name)
73
73
  params["p_hash"] = project_hash if project_hash
74
74
 
75
75
  url += "?" + URI.encode_www_form(params) if params.count > 0
@@ -90,12 +90,11 @@ module FastlaneCore
90
90
  end
91
91
 
92
92
  # (optional) Returns the app identifier for the current tool
93
- def self.ios_app_identifier
94
- # ARGV example:
95
- # ["-a", "com.krausefx.app", "--team_id", "5AA97AAHK2"]
96
- ARGV.each_with_index do |current, index|
93
+ def self.ios_app_identifier(args)
94
+ # args example: ["-a", "com.krausefx.app", "--team_id", "5AA97AAHK2"]
95
+ args.each_with_index do |current, index|
97
96
  if current == "-a" || current == "--app_identifier"
98
- return ARGV[index + 1] if ARGV.count > index
97
+ return args[index + 1] if args.count > index
99
98
  end
100
99
  end
101
100
 
@@ -103,26 +102,53 @@ module FastlaneCore
103
102
  return ENV["#{current}_APP_IDENTIFIER"] if ENV["#{current}_APP_IDENTIFIER"]
104
103
  end
105
104
 
106
- return nil
105
+ return CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
107
106
  rescue
108
107
  nil # we don't want this method to cause a crash
109
108
  end
110
109
 
110
+ # (optional) Returns the app identifier for the current tool
111
+ # supply and screengrab use different param names and env variable patterns so we have to special case here
112
+ # example:
113
+ # supply --skip_upload_screenshots -a beta -p com.test.app should return com.test.app
114
+ # screengrab -a com.test.app should return com.test.app
115
+ def self.android_app_identifier(args, gem_name)
116
+ app_identifier = nil
117
+ # args example: ["-a", "com.krausefx.app"]
118
+ args.each_with_index do |current, index|
119
+ if android_app_identifier_arg?(gem_name, current)
120
+ app_identifier = args[index + 1] if args.count > index
121
+ break
122
+ end
123
+ end
124
+
125
+ app_identifier ||= ENV["SUPPLY_PACKAGE_NAME"] if ENV["SUPPLY_PACKAGE_NAME"]
126
+ app_identifier ||= ENV["SCREENGRAB_APP_PACKAGE_NAME"] if ENV["SCREENGRAB_APP_PACKAGE_NAME"]
127
+ app_identifier ||= CredentialsManager::AppfileConfig.try_fetch_value(:package_name)
128
+
129
+ # Add Android prefix to prevent collisions if there is an iOS app with the same identifier
130
+ app_identifier ? "android_project_#{app_identifier}" : nil
131
+ rescue
132
+ nil # we don't want this method to cause a crash
133
+ end
134
+
135
+ def self.android_app_identifier_arg?(gem_name, arg)
136
+ return arg == "--package_name" ||
137
+ arg == "--app_package_name" ||
138
+ (arg == '-p' && gem_name == 'supply') ||
139
+ (arg == '-a' && gem_name == 'screengrab')
140
+ end
141
+
111
142
  # To not count the same projects multiple time for the number of launches
112
143
  # More information: https://github.com/fastlane/refresher
113
144
  # Use the `FASTLANE_OPT_OUT_USAGE` variable to opt out
114
145
  # The resulting value is e.g. ce12f8371df11ef6097a83bdf2303e4357d6f5040acc4f76019489fa5deeae0d
115
- def self.p_hash
146
+ def self.p_hash(args, gem_name)
116
147
  return nil if ENV["FASTLANE_OPT_OUT_USAGE"]
117
148
  require 'credentials_manager'
118
149
 
119
- value = nil
120
- value ||= self.ios_app_identifier
121
- value ||= CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
122
- unless value
123
- value = CredentialsManager::AppfileConfig.try_fetch_value(:package_name)
124
- value = "android_project_#{value}" if value # if the iOS and Android app share the same app identifier
125
- end
150
+ # check if this is an android project first because some of the same params exist for iOS and Android tools
151
+ value = android_app_identifier(args, gem_name) || ios_app_identifier(args)
126
152
 
127
153
  if value
128
154
  return Digest::SHA256.hexdigest("p#{value}fastlan3_SAlt") # hashed + salted the bundle identifier
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.43.3".freeze
2
+ VERSION = "0.43.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.3
4
+ version: 0.43.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-11 00:00:00.000000000 Z
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -401,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
401
401
  version: '0'
402
402
  requirements: []
403
403
  rubyforge_project:
404
- rubygems_version: 2.4.5.1
404
+ rubygems_version: 2.2.2
405
405
  signing_key:
406
406
  specification_version: 4
407
407
  summary: Contains all shared code/dependencies of the fastlane.tools