fastlane 2.82.0.beta.20180217010002 → 2.82.0.beta.20180218010003

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/cert/lib/cert/options.rb +5 -1
  3. data/deliver/lib/deliver/options.rb +10 -2
  4. data/fastlane/lib/assets/ActionDetails.md.erb +5 -4
  5. data/fastlane/lib/fastlane/actions/add_git_tag.rb +1 -0
  6. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +6 -2
  7. data/fastlane/lib/fastlane/actions/appaloosa.rb +3 -1
  8. data/fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb +1 -0
  9. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +1 -0
  10. data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +1 -0
  11. data/fastlane/lib/fastlane/actions/commit_github_file.rb +1 -0
  12. data/fastlane/lib/fastlane/actions/crashlytics.rb +2 -0
  13. data/fastlane/lib/fastlane/actions/create_pull_request.rb +2 -0
  14. data/fastlane/lib/fastlane/actions/deploygate.rb +2 -0
  15. data/fastlane/lib/fastlane/actions/dotgpg_environment.rb +1 -0
  16. data/fastlane/lib/fastlane/actions/download_dsyms.rb +6 -2
  17. data/fastlane/lib/fastlane/actions/dsym_zip.rb +1 -0
  18. data/fastlane/lib/fastlane/actions/frame_screenshots.rb +2 -1
  19. data/fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb +2 -1
  20. data/fastlane/lib/fastlane/actions/github_api.rb +1 -0
  21. data/fastlane/lib/fastlane/actions/hockey.rb +7 -1
  22. data/fastlane/lib/fastlane/actions/install_on_device.rb +1 -0
  23. data/fastlane/lib/fastlane/actions/installr.rb +1 -0
  24. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +6 -2
  25. data/fastlane/lib/fastlane/actions/modify_services.rb +6 -2
  26. data/fastlane/lib/fastlane/actions/read_podspec.rb +1 -0
  27. data/fastlane/lib/fastlane/actions/register_device.rb +4 -1
  28. data/fastlane/lib/fastlane/actions/register_devices.rb +4 -1
  29. data/fastlane/lib/fastlane/actions/resign.rb +2 -0
  30. data/fastlane/lib/fastlane/actions/s3.rb +14 -6
  31. data/fastlane/lib/fastlane/actions/set_changelog.rb +6 -2
  32. data/fastlane/lib/fastlane/actions/set_github_release.rb +3 -1
  33. data/fastlane/lib/fastlane/actions/testfairy.rb +2 -0
  34. data/fastlane/lib/fastlane/actions/tryouts.rb +1 -0
  35. data/fastlane/lib/fastlane/actions/update_app_identifier.rb +3 -1
  36. data/fastlane/lib/fastlane/actions/update_info_plist.rb +1 -0
  37. data/fastlane/lib/fastlane/actions/update_project_code_signing.rb +4 -2
  38. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +1 -0
  39. data/fastlane/lib/fastlane/actions/update_project_team.rb +3 -1
  40. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +1 -0
  41. data/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb +2 -0
  42. data/fastlane/lib/fastlane/actions/verify_xcode.rb +1 -0
  43. data/fastlane/lib/fastlane/actions/version_bump_podspec.rb +1 -0
  44. data/fastlane/lib/fastlane/actions/version_get_podspec.rb +1 -0
  45. data/fastlane/lib/fastlane/actions/xcode_install.rb +4 -2
  46. data/fastlane/lib/fastlane/documentation/actions_list.rb +7 -1
  47. data/fastlane/lib/fastlane/erb_template_helper.rb +8 -3
  48. data/fastlane/lib/fastlane/version.rb +1 -1
  49. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +8 -0
  50. data/frameit/lib/frameit/options.rb +2 -1
  51. data/gym/lib/gym/options.rb +2 -1
  52. data/match/lib/match/options.rb +6 -2
  53. data/pem/lib/pem/options.rb +6 -2
  54. data/pilot/lib/pilot/options.rb +10 -3
  55. data/precheck/lib/precheck/options.rb +6 -2
  56. data/produce/lib/produce/options.rb +9 -2
  57. data/scan/lib/scan/options.rb +4 -2
  58. data/screengrab/lib/screengrab/options.rb +6 -1
  59. data/sigh/lib/sigh/options.rb +6 -2
  60. data/snapshot/lib/snapshot/options.rb +6 -3
  61. data/spaceship/lib/spaceship/tunes/iap.rb +45 -0
  62. data/spaceship/lib/spaceship/tunes/iap_detail.rb +21 -1
  63. data/spaceship/lib/spaceship/tunes/iap_list.rb +7 -0
  64. data/spaceship/lib/spaceship/tunes/tunes_client.rb +18 -0
  65. data/supply/lib/supply/options.rb +9 -2
  66. metadata +2 -2
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.82.0.beta.20180217010002'.freeze
2
+ VERSION = '2.82.0.beta.20180218010003'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze
@@ -20,6 +20,9 @@ module FastlaneCore
20
20
  # the value which is used if there was no given values and no environment values
21
21
  attr_accessor :default_value
22
22
 
23
+ # [Boolean] Set if the default value is generated dynamically
24
+ attr_accessor :default_value_dynamic
25
+
23
26
  # the value which is used during Swift code generation
24
27
  # if the default_value reads from ENV or a file, or from local credentials, we need
25
28
  # to provide a different default or it might be included in our autogenerated Swift
@@ -70,6 +73,7 @@ module FastlaneCore
70
73
  # @param description (String) A description shown to the user
71
74
  # @param short_option (String) A string of length 1 which is used for the command parameters (e.g. -f)
72
75
  # @param default_value the value which is used if there was no given values and no environment values
76
+ # @param default_value_dynamic (Boolean) Set if the default value is generated dynamically
73
77
  # @param verify_block an optional block which is called when a new value is set.
74
78
  # Check value is valid. This could be type checks or if a folder/file exists
75
79
  # You have to raise a specific exception if something goes wrong. Append .red after the string
@@ -82,11 +86,13 @@ module FastlaneCore
82
86
  # @param deprecated (String) Set if the option is deprecated. A deprecated option should be optional and is made optional if the parameter isn't set, and fails otherwise
83
87
  # @param sensitive (Boolean) Set if the variable is sensitive, such as a password or API token, to prevent echoing when prompted for the parameter
84
88
  # @param display_in_shell (Boolean) Set if the variable can be used from shell
89
+ # rubocop:disable Metrics/ParameterLists
85
90
  def initialize(key: nil,
86
91
  env_name: nil,
87
92
  description: nil,
88
93
  short_option: nil,
89
94
  default_value: nil,
95
+ default_value_dynamic: false,
90
96
  verify_block: nil,
91
97
  is_string: true,
92
98
  type: nil,
@@ -133,6 +139,7 @@ module FastlaneCore
133
139
  @description = description
134
140
  @short_option = short_option
135
141
  @default_value = default_value
142
+ @default_value_dynamic = default_value_dynamic
136
143
  @verify_block = verify_block
137
144
  @is_string = is_string
138
145
  @data_type = type
@@ -151,6 +158,7 @@ module FastlaneCore
151
158
 
152
159
  update_code_gen_default_value_if_able!
153
160
  end
161
+ # rubocop:enable Metrics/ParameterLists
154
162
 
155
163
  # if code_gen_default_value is nil, use the default value if it isn't a `code_gen_sensitive` value
156
164
  def update_code_gen_default_value_if_able!
@@ -56,7 +56,8 @@ module Frameit
56
56
  elsif f.end_with?("force_landscaperight")
57
57
  :landscape_right
58
58
  end
59
- end)
59
+ end,
60
+ default_value_dynamic: true)
60
61
  ]
61
62
  end
62
63
  end
@@ -163,7 +163,8 @@ module Gym
163
163
  short_option: "-l",
164
164
  env_name: "GYM_BUILDLOG_PATH",
165
165
  description: "The directory where to store the build log",
166
- default_value: "#{FastlaneCore::Helper.buildlog_path}/gym"),
166
+ default_value: "#{FastlaneCore::Helper.buildlog_path}/gym",
167
+ default_value_dynamic: true),
167
168
  FastlaneCore::ConfigItem.new(key: :sdk,
168
169
  short_option: "-k",
169
170
  env_name: "GYM_SDK",
@@ -37,12 +37,14 @@ module Match
37
37
  type: Array, # we actually allow String and Array here
38
38
  skip_type_validation: true,
39
39
  code_gen_sensitive: true,
40
- default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
40
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier),
41
+ default_value_dynamic: true),
41
42
  FastlaneCore::ConfigItem.new(key: :username,
42
43
  short_option: "-u",
43
44
  env_name: "MATCH_USERNAME",
44
45
  description: "Your Apple ID Username",
45
- default_value: user),
46
+ default_value: user,
47
+ default_value_dynamic: true),
46
48
  FastlaneCore::ConfigItem.new(key: :keychain_name,
47
49
  short_option: "-s",
48
50
  env_name: "MATCH_KEYCHAIN_NAME",
@@ -66,6 +68,7 @@ module Match
66
68
  optional: true,
67
69
  code_gen_sensitive: true,
68
70
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
71
+ default_value_dynamic: true,
69
72
  verify_block: proc do |value|
70
73
  ENV["FASTLANE_TEAM_ID"] = value.to_s
71
74
  end),
@@ -86,6 +89,7 @@ module Match
86
89
  optional: true,
87
90
  code_gen_sensitive: true,
88
91
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_name),
92
+ default_value_dynamic: true,
89
93
  verify_block: proc do |value|
90
94
  ENV["FASTLANE_TEAM_NAME"] = value.to_s
91
95
  end),
@@ -45,17 +45,20 @@ module PEM
45
45
  env_name: "PEM_APP_IDENTIFIER",
46
46
  description: "The bundle identifier of your app",
47
47
  code_gen_sensitive: true,
48
- default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
48
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier),
49
+ default_value_dynamic: true),
49
50
  FastlaneCore::ConfigItem.new(key: :username,
50
51
  short_option: "-u",
51
52
  env_name: "PEM_USERNAME",
52
53
  description: "Your Apple ID Username",
53
- default_value: user),
54
+ default_value: user,
55
+ default_value_dynamic: true),
54
56
  FastlaneCore::ConfigItem.new(key: :team_id,
55
57
  short_option: "-b",
56
58
  env_name: "PEM_TEAM_ID",
57
59
  code_gen_sensitive: true,
58
60
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
61
+ default_value_dynamic: true,
59
62
  description: "The ID of your Developer Portal team if you're in multiple teams",
60
63
  optional: true,
61
64
  verify_block: proc do |value|
@@ -68,6 +71,7 @@ module PEM
68
71
  optional: true,
69
72
  code_gen_sensitive: true,
70
73
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_name),
74
+ default_value_dynamic: true,
71
75
  verify_block: proc do |value|
72
76
  ENV["FASTLANE_TEAM_NAME"] = value.to_s
73
77
  end),
@@ -14,14 +14,16 @@ module Pilot
14
14
  short_option: "-u",
15
15
  env_name: "PILOT_USERNAME",
16
16
  description: "Your Apple ID Username",
17
- default_value: user),
17
+ default_value: user,
18
+ default_value_dynamic: true),
18
19
  FastlaneCore::ConfigItem.new(key: :app_identifier,
19
20
  short_option: "-a",
20
21
  env_name: "PILOT_APP_IDENTIFIER",
21
22
  description: "The bundle identifier of the app to upload or manage testers (optional)",
22
23
  optional: true,
23
24
  code_gen_sensitive: true,
24
- default_value: ENV["TESTFLIGHT_APP_IDENTITIFER"] || CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
25
+ default_value: ENV["TESTFLIGHT_APP_IDENTITIFER"] || CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier),
26
+ default_value_dynamic: true),
25
27
  FastlaneCore::ConfigItem.new(key: :app_platform,
26
28
  short_option: "-m",
27
29
  env_name: "PILOT_PLATFORM",
@@ -38,6 +40,7 @@ module Pilot
38
40
  description: "Path to the ipa file to upload",
39
41
  code_gen_sensitive: true,
40
42
  default_value: Dir["*.ipa"].sort_by { |x| File.mtime(x) }.last,
43
+ default_value_dynamic: true,
41
44
  verify_block: proc do |value|
42
45
  value = File.expand_path(value)
43
46
  UI.user_error!("Could not find ipa file at path '#{value}'") unless File.exist?(value)
@@ -83,7 +86,8 @@ module Pilot
83
86
  description: "The unique App ID provided by iTunes Connect",
84
87
  optional: true,
85
88
  code_gen_sensitive: true,
86
- default_value: ENV["TESTFLIGHT_APPLE_ID"]),
89
+ default_value: ENV["TESTFLIGHT_APPLE_ID"],
90
+ default_value_dynamic: true),
87
91
  FastlaneCore::ConfigItem.new(key: :distribute_external,
88
92
  is_string: false,
89
93
  env_name: "PILOT_DISTRIBUTE_EXTERNAL",
@@ -135,6 +139,7 @@ module Pilot
135
139
  is_string: false, # as we also allow integers, which we convert to strings anyway
136
140
  code_gen_sensitive: true,
137
141
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id),
142
+ default_value_dynamic: true,
138
143
  verify_block: proc do |value|
139
144
  ENV["FASTLANE_ITC_TEAM_ID"] = value.to_s
140
145
  end),
@@ -145,6 +150,7 @@ module Pilot
145
150
  optional: true,
146
151
  code_gen_sensitive: true,
147
152
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name),
153
+ default_value_dynamic: true,
148
154
  verify_block: proc do |value|
149
155
  ENV["FASTLANE_ITC_TEAM_NAME"] = value.to_s
150
156
  end),
@@ -155,6 +161,7 @@ module Pilot
155
161
  is_string: true,
156
162
  code_gen_sensitive: true,
157
163
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
164
+ default_value_dynamic: true,
158
165
  verify_block: proc do |value|
159
166
  ENV["FASTLANE_TEAM_ID"] = value.to_s
160
167
  end),
@@ -30,12 +30,14 @@ module Precheck
30
30
  env_name: "PRECHECK_APP_IDENTIFIER",
31
31
  description: "The bundle identifier of your app",
32
32
  code_gen_sensitive: true,
33
- default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
33
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier),
34
+ default_value_dynamic: true),
34
35
  FastlaneCore::ConfigItem.new(key: :username,
35
36
  short_option: "-u",
36
37
  env_name: "PRECHECK_USERNAME",
37
38
  description: "Your Apple ID Username",
38
- default_value: user),
39
+ default_value: user,
40
+ default_value_dynamic: true),
39
41
  FastlaneCore::ConfigItem.new(key: :team_id,
40
42
  short_option: "-b",
41
43
  env_name: "PRECHECK_TEAM_ID",
@@ -43,6 +45,7 @@ module Precheck
43
45
  optional: true,
44
46
  code_gen_sensitive: true,
45
47
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id),
48
+ default_value_dynamic: true,
46
49
  verify_block: proc do |value|
47
50
  ENV["FASTLANE_ITC_TEAM_ID"] = value.to_s
48
51
  end),
@@ -53,6 +56,7 @@ module Precheck
53
56
  optional: true,
54
57
  code_gen_sensitive: true,
55
58
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name),
59
+ default_value_dynamic: true,
56
60
  verify_block: proc do |value|
57
61
  ENV["FASTLANE_ITC_TEAM_NAME"] = value.to_s
58
62
  end),
@@ -15,13 +15,15 @@ module Produce
15
15
  env_name: "PRODUCE_USERNAME",
16
16
  description: "Your Apple ID Username",
17
17
  code_gen_sensitive: true,
18
- default_value: user),
18
+ default_value: user,
19
+ default_value_dynamic: true),
19
20
  FastlaneCore::ConfigItem.new(key: :app_identifier,
20
21
  env_name: "PRODUCE_APP_IDENTIFIER",
21
22
  short_option: "-a",
22
23
  description: "App Identifier (Bundle ID, e.g. com.krausefx.app)",
23
24
  code_gen_sensitive: true,
24
- default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
25
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier),
26
+ default_value_dynamic: true),
25
27
  FastlaneCore::ConfigItem.new(key: :bundle_identifier_suffix,
26
28
  short_option: "-e",
27
29
  env_name: "PRODUCE_APP_IDENTIFIER_SUFFIX",
@@ -42,6 +44,7 @@ module Produce
42
44
  description: "SKU Number (e.g. '1234')",
43
45
  code_gen_sensitive: true,
44
46
  default_value: Time.now.to_i.to_s,
47
+ default_value_dynamic: true,
45
48
  is_string: true),
46
49
  FastlaneCore::ConfigItem.new(key: :platform,
47
50
  short_option: "-j",
@@ -119,6 +122,7 @@ module Produce
119
122
  optional: true,
120
123
  code_gen_sensitive: true,
121
124
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
125
+ default_value_dynamic: true,
122
126
  verify_block: proc do |value|
123
127
  ENV["FASTLANE_TEAM_ID"] = value.to_s
124
128
  end),
@@ -129,6 +133,7 @@ module Produce
129
133
  optional: true,
130
134
  code_gen_sensitive: true,
131
135
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_name),
136
+ default_value_dynamic: true,
132
137
  verify_block: proc do |value|
133
138
  ENV["FASTLANE_TEAM_NAME"] = value.to_s
134
139
  end),
@@ -140,6 +145,7 @@ module Produce
140
145
  is_string: false, # as we also allow integers, which we convert to strings anyway
141
146
  code_gen_sensitive: true,
142
147
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id),
148
+ default_value_dynamic: true,
143
149
  verify_block: proc do |value|
144
150
  ENV["FASTLANE_ITC_TEAM_ID"] = value.to_s
145
151
  end),
@@ -150,6 +156,7 @@ module Produce
150
156
  optional: true,
151
157
  code_gen_sensitive: true,
152
158
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name),
159
+ default_value_dynamic: true,
153
160
  verify_block: proc do |value|
154
161
  ENV["FASTLANE_ITC_TEAM_NAME"] = value.to_s
155
162
  end)
@@ -108,7 +108,8 @@ module Scan
108
108
  description: "The directory in which all reports will be stored",
109
109
  code_gen_sensitive: true,
110
110
  code_gen_default_value: "./test_output",
111
- default_value: File.join(containing, "test_output")),
111
+ default_value: File.join(containing, "test_output"),
112
+ default_value_dynamic: true),
112
113
  FastlaneCore::ConfigItem.new(key: :output_style,
113
114
  short_option: "-b",
114
115
  env_name: "SCAN_OUTPUT_STYLE",
@@ -132,7 +133,8 @@ module Scan
132
133
  short_option: "-l",
133
134
  env_name: "SCAN_BUILDLOG_PATH",
134
135
  description: "The directory where to store the raw log",
135
- default_value: "#{FastlaneCore::Helper.buildlog_path}/scan"),
136
+ default_value: "#{FastlaneCore::Helper.buildlog_path}/scan",
137
+ default_value_dynamic: true),
136
138
  FastlaneCore::ConfigItem.new(key: :include_simulator_logs,
137
139
  env_name: "SCAN_INCLUDE_SIMULATOR_LOGS",
138
140
  description: "If the logs generated by the app (e.g. using NSLog, perror, etc.) in the Simulator should be written to the output_directory",
@@ -17,6 +17,7 @@ module Screengrab
17
17
  optional: true,
18
18
  code_gen_sensitive: true,
19
19
  default_value: ENV['ANDROID_HOME'] || ENV['ANDROID_SDK'],
20
+ default_value_dynamic: true,
20
21
  description: "Path to the root of your Android SDK installation, e.g. ~/tools/android-sdk-macosx"),
21
22
  FastlaneCore::ConfigItem.new(key: :build_tools_version,
22
23
  short_option: "-i",
@@ -41,13 +42,15 @@ module Screengrab
41
42
  env_name: 'SCREENGRAB_SKIP_OPEN_SUMMARY',
42
43
  description: "Don't open the summary after running _screengrab_",
43
44
  default_value: DEFAULT_SKIP_OPEN_SUMMARY,
45
+ default_value_dynamic: true,
44
46
  is_string: false),
45
47
  FastlaneCore::ConfigItem.new(key: :app_package_name,
46
48
  env_name: 'SCREENGRAB_APP_PACKAGE_NAME',
47
49
  short_option: "-a",
48
50
  description: "The package name of the app under test (e.g. com.yourcompany.yourapp)",
49
51
  code_gen_sensitive: true,
50
- default_value: CredentialsManager::AppfileConfig.try_fetch_value(:package_name)),
52
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:package_name),
53
+ default_value_dynamic: true),
51
54
  FastlaneCore::ConfigItem.new(key: :tests_package_name,
52
55
  env_name: 'SCREENGRAB_TESTS_PACKAGE_NAME',
53
56
  optional: true,
@@ -88,6 +91,7 @@ module Screengrab
88
91
  short_option: "-k",
89
92
  code_gen_sensitive: true,
90
93
  default_value: Dir[File.join("app", "build", "outputs", "apk", "app-debug.apk")].last,
94
+ default_value_dynamic: true,
91
95
  verify_block: proc do |value|
92
96
  UI.user_error!("Could not find APK file at path '#{value}'") unless File.exist?(value)
93
97
  end),
@@ -98,6 +102,7 @@ module Screengrab
98
102
  short_option: "-b",
99
103
  code_gen_sensitive: true,
100
104
  default_value: Dir[File.join("app", "build", "outputs", "apk", "app-debug-androidTest-unaligned.apk")].last,
105
+ default_value_dynamic: true,
101
106
  verify_block: proc do |value|
102
107
  UI.user_error!("Could not find APK file at path '#{value}'") unless File.exist?(value)
103
108
  end),
@@ -43,12 +43,14 @@ module Sigh
43
43
  env_name: "SIGH_APP_IDENTIFIER",
44
44
  description: "The bundle identifier of your app",
45
45
  code_gen_sensitive: true,
46
- default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
46
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier),
47
+ default_value_dynamic: true),
47
48
  FastlaneCore::ConfigItem.new(key: :username,
48
49
  short_option: "-u",
49
50
  env_name: "SIGH_USERNAME",
50
51
  description: "Your Apple ID Username",
51
- default_value: user),
52
+ default_value: user,
53
+ default_value_dynamic: true),
52
54
  FastlaneCore::ConfigItem.new(key: :team_id,
53
55
  short_option: "-b",
54
56
  env_name: "SIGH_TEAM_ID",
@@ -56,6 +58,7 @@ module Sigh
56
58
  optional: true,
57
59
  code_gen_sensitive: true,
58
60
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
61
+ default_value_dynamic: true,
59
62
  verify_block: proc do |value|
60
63
  ENV["FASTLANE_TEAM_ID"] = value.to_s
61
64
  end),
@@ -66,6 +69,7 @@ module Sigh
66
69
  optional: true,
67
70
  code_gen_sensitive: true,
68
71
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_name),
72
+ default_value_dynamic: true,
69
73
  verify_block: proc do |value|
70
74
  ENV["FASTLANE_TEAM_NAME"] = value.to_s
71
75
  end),
@@ -66,7 +66,8 @@ module Snapshot
66
66
  short_option: "-o",
67
67
  env_name: "SNAPSHOT_OUTPUT_DIRECTORY",
68
68
  description: "The directory where to store the screenshots",
69
- default_value: output_directory),
69
+ default_value: output_directory,
70
+ default_value_dynamic: true),
70
71
  FastlaneCore::ConfigItem.new(key: :output_simulator_logs,
71
72
  env_name: "SNAPSHOT_OUTPUT_SIMULATOR_LOGS",
72
73
  description: "If the logs generated by the app (e.g. using NSLog, perror, etc.) in the Simulator should be written to the output_directory",
@@ -113,7 +114,8 @@ module Snapshot
113
114
  optional: true,
114
115
  description: "The bundle identifier of the app to uninstall (only needed when enabling reinstall_app)",
115
116
  code_gen_sensitive: true,
116
- default_value: ENV["SNAPSHOT_APP_IDENTITIFER"] || CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
117
+ default_value: ENV["SNAPSHOT_APP_IDENTITIFER"] || CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier),
118
+ default_value_dynamic: true),
117
119
  FastlaneCore::ConfigItem.new(key: :add_photos,
118
120
  env_name: 'SNAPSHOT_PHOTOS',
119
121
  short_option: "-j",
@@ -132,7 +134,8 @@ module Snapshot
132
134
  short_option: "-l",
133
135
  env_name: "SNAPSHOT_BUILDLOG_PATH",
134
136
  description: "The directory where to store the build log",
135
- default_value: "#{FastlaneCore::Helper.buildlog_path}/snapshot"),
137
+ default_value: "#{FastlaneCore::Helper.buildlog_path}/snapshot",
138
+ default_value_dynamic: true),
136
139
  FastlaneCore::ConfigItem.new(key: :clean,
137
140
  short_option: "-c",
138
141
  env_name: "SNAPSHOT_CLEAN",
@@ -1,3 +1,4 @@
1
+ require 'spaceship/tunes/errors'
1
2
  require 'spaceship/tunes/iap_list'
2
3
  require 'spaceship/tunes/iap_detail'
3
4
  require 'spaceship/tunes/iap_status'
@@ -75,6 +76,33 @@ module Spaceship
75
76
  family_id: family_id,
76
77
  subscription_duration: subscription_duration,
77
78
  subscription_free_trial: subscription_free_trial)
79
+
80
+ # Update pricing for a recurring subscription.
81
+ if type == Spaceship::Tunes::IAPType::RECURRING && pricing_intervals
82
+ # There are cases where the product that was just created is not immediately found,
83
+ # and in order to update its pricing the purchase_id is needed. Therefore polling is done
84
+ # for 4 times until it is found. If it's not found after 4 tries, a PotentialServerError
85
+ # exception is raised.
86
+ product = find_product_with_retries(product_id, 4)
87
+ transformed_pricing_intervals = transform_pricing_intervals(pricing_intervals)
88
+ client.update_recurring_iap_pricing!(app_id: self.application.apple_id,
89
+ purchase_id: product.purchase_id,
90
+ pricing_intervals: transformed_pricing_intervals)
91
+ end
92
+ end
93
+
94
+ def transform_pricing_intervals(pricing_intervals)
95
+ pricing_intervals.map do |interval|
96
+ {
97
+ "value" => {
98
+ "tierStem" => interval[:tier],
99
+ "priceTierEffectiveDate" => interval[:begin_date],
100
+ "priceTierEndDate" => interval[:end_date],
101
+ "country" => interval[:country] || "WW",
102
+ "grandfathered" => interval[:grandfathered]
103
+ }
104
+ }
105
+ end
78
106
  end
79
107
 
80
108
  # find a specific product
@@ -103,6 +131,23 @@ module Spaceship
103
131
  end
104
132
  return_iaps
105
133
  end
134
+
135
+ private
136
+
137
+ def find_product_with_retries(product_id, max_tries)
138
+ try_number = 0
139
+ product = nil
140
+ until product
141
+ if try_number > max_tries
142
+ raise PotentialServerError.new, "Failed to find the product with id=#{product_id}. "\
143
+ "This can be caused either by a server error or due to the removal of the product."
144
+ end
145
+ product = find(product_id)
146
+ try_number += 1
147
+ end
148
+
149
+ product
150
+ end
106
151
  end
107
152
  end
108
153
  end