fastlane 2.10.0 → 2.11.0

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: c750b0e8526d5e3e4d0d064a214ddcbf30fda96e
4
- data.tar.gz: 341bebabdf36d4edacbd49c5275da7c42d0e9664
3
+ metadata.gz: 727fe731430e8c06f7b4a0c66d044714c879ccaf
4
+ data.tar.gz: c65677292ad39144080c5bdef78de0aea6b82961
5
5
  SHA512:
6
- metadata.gz: 389af2d4b9bf553315cc479f8997de9464729ce67d28c19ca020f56934b138a4f17d2fab362daf23a217b7a07f7273588329ac04adabd71aeee2bb79ea2adf46
7
- data.tar.gz: 4e2e5b357ce222b78c4fee27fecd527d162bec3e6954f32451898b819e4eda3a6a5547b33a177f017d0b8be5a3b73ad0d9707a36826b4277ab8e7581d7a685ac
6
+ metadata.gz: 3f90f8dbb9649502c8300d957e5535db5ebdcc6abe900489be9173b44be4c55b91fb39f210b8a58d048517d6115f55fc3c0e7c17187bb3097d55234d5a7f2388
7
+ data.tar.gz: 73591c45604420668dddaf8ba46227fd6f44ab517e781bea5db8d1355e02c82a973680683740e55bbb5ad1088b24736e7a8d1aaf0c534283134bf0bae0b66c80
data/README.md CHANGED
@@ -60,7 +60,9 @@ Then to deploy a new 'beta' version of your app just run
60
60
  ## Installation
61
61
  Make sure you have the latest version of the Xcode command line tools installed:
62
62
 
63
- xcode-select --install
63
+ ```
64
+ xcode-select --install
65
+ ```
64
66
 
65
67
  ### Choose your installation method:
66
68
 
data/fastlane/README.md CHANGED
@@ -98,22 +98,31 @@ fastlane release
98
98
  ##### Like this tool? [Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx).
99
99
 
100
100
  ## Installation
101
+ Make sure you have the latest version of the Xcode command line tools installed:
101
102
 
102
- I recommend following the [fastlane guide](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Guide.md) to get started.
103
-
104
- sudo gem install fastlane --verbose
105
-
106
- Make sure, you have the latest version of the Xcode command line tools installed:
107
-
108
- xcode-select --install
109
-
110
- If you experience slow launch times of fastlane, try running
111
-
112
- gem cleanup
113
-
114
- to clean up outdated gems.
103
+ ```
104
+ xcode-select --install
105
+ ```
115
106
 
116
- System Requirements: `fastlane` requires macOS or Linux with Ruby 2.0.0 or above.
107
+ ### Choose your installation method:
108
+
109
+ <table width="100%" >
110
+ <tr>
111
+ <th width="33%"><a href="http://brew.sh">Homebrew</a></td>
112
+ <th width="33%">Installer Script</td>
113
+ <th width="33%">Rubygems</td>
114
+ </tr>
115
+ <tr>
116
+ <td width="33%" align="center">macOS</td>
117
+ <td width="33%" align="center">macOS</td>
118
+ <td width="33%" align="center">macOS or Linux with Ruby 2.0.0 or above</td>
119
+ </tr>
120
+ <tr>
121
+ <td width="33%"><code>brew cask install fastlane</code></td>
122
+ <td width="33%"><a href="https://download.fastlane.tools/fastlane.zip">Download the zip file</a>. Then double click on the <code>install</code> script (or run it in a terminal window).</td>
123
+ <td width="33%"><code>sudo gem install fastlane -NV</code></td>
124
+ </tr>
125
+ </table>
117
126
 
118
127
 
119
128
  If you want to take a look at a project, already using `fastlane`, check out the [fastlane-examples](https://github.com/fastlane/examples) with `fastlane` setups by Wikipedia, Product Hunt, MindNode and more.
@@ -135,7 +144,9 @@ There are also 2 Japanese fastlane guides available: [qiita](http://qiita.com/gi
135
144
 
136
145
  Usually you'll use fastlane by triggering individual lanes:
137
146
 
138
- fastlane [lane_name]
147
+ ```
148
+ fastlane [lane_name]
149
+ ```
139
150
 
140
151
  #### Other commands
141
152
 
Binary file
Binary file
Binary file
@@ -6,6 +6,7 @@ module Fastlane
6
6
 
7
7
  class EnsureXcodeVersionAction < Action
8
8
  def self.run(params)
9
+ Actions.verify_gem!('xcode-install')
9
10
  required_version = params[:version]
10
11
  selected_version = sh("xcversion selected").match(/^Xcode (.*)$/)[1]
11
12
 
@@ -6,11 +6,13 @@ require 'cgi'
6
6
  module Fastlane
7
7
  module Actions
8
8
  module SharedValues
9
- S3_IPA_OUTPUT_PATH = :S3_IPA_OUTPUT_PATH
10
- S3_DSYM_OUTPUT_PATH = :S3_DSYM_OUTPUT_PATH
11
- S3_PLIST_OUTPUT_PATH = :S3_PLIST_OUTPUT_PATH
12
- S3_HTML_OUTPUT_PATH = :S3_HTML_OUTPUT_PATH
13
- S3_VERSION_OUTPUT_PATH = :S3_VERSION_OUTPUT_PATH
9
+ # Using ||= because these MAY be defined by the the
10
+ # preferred aws_s3 plugin
11
+ S3_IPA_OUTPUT_PATH ||= :S3_IPA_OUTPUT_PATH
12
+ S3_DSYM_OUTPUT_PATH ||= :S3_DSYM_OUTPUT_PATH
13
+ S3_PLIST_OUTPUT_PATH ||= :S3_PLIST_OUTPUT_PATH
14
+ S3_HTML_OUTPUT_PATH ||= :S3_HTML_OUTPUT_PATH
15
+ S3_VERSION_OUTPUT_PATH ||= :S3_VERSION_OUTPUT_PATH
14
16
  end
15
17
 
16
18
  S3_ARGS_MAP = {
@@ -6,18 +6,19 @@ module Fastlane
6
6
  UI.user_error!("You have to install swiftlint using `brew install swiftlint`")
7
7
  end
8
8
 
9
- version = Gem::Version.new(Helper.test? ? '0.0.0' : `swiftlint version`.chomp)
9
+ version = swiftlint_version
10
10
  if params[:mode] == :autocorrect and version < Gem::Version.new('0.5.0') and !Helper.test?
11
11
  UI.user_error!("Your version of swiftlint (#{version}) does not support autocorrect mode.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`")
12
12
  end
13
13
 
14
14
  command = "swiftlint #{params[:mode]}"
15
- command << " --strict" if params[:strict]
15
+ command << supported_option_switch(params, :strict, "0.9.2", true)
16
16
  command << " --config #{params[:config_file].shellescape}" if params[:config_file]
17
17
  command << " --reporter #{params[:reporter]}" if params[:reporter]
18
+ command << supported_option_switch(params, :quiet, "0.9.0", true)
18
19
 
19
20
  if params[:files]
20
- if version < Gem::Version.new('0.5.1') and !Helper.test?
21
+ if version < Gem::Version.new('0.5.1')
21
22
  UI.user_error!("Your version of swiftlint (#{version}) does not support list of files as input.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`")
22
23
  end
23
24
 
@@ -35,6 +36,25 @@ module Fastlane
35
36
  end
36
37
  end
37
38
 
39
+ # Get current SwiftLint version
40
+ def self.swiftlint_version
41
+ Gem::Version.new(`swiftlint version`.chomp)
42
+ end
43
+
44
+ # Return "--option" switch if option is on and current SwiftLint version is greater or equal than min version.
45
+ # Return "" otherwise.
46
+ def self.supported_option_switch(params, option, min_version, can_ignore = false)
47
+ return "" unless params[option]
48
+ if swiftlint_version < Gem::Version.new(min_version)
49
+ message = "Your version of swiftlint (#{swiftlint_version}) does not support '--#{option}' option.\nUpdate swiftlint to #{min_version} or above using `brew update && brew upgrade swiftlint`"
50
+ message += "\nThe option will be ignored." if can_ignore
51
+ can_ignore ? UI.important(message) : UI.user_error!(message)
52
+ ""
53
+ else
54
+ " --#{option}"
55
+ end
56
+ end
57
+
38
58
  #####################################################
39
59
  # @!group Documentation
40
60
  #####################################################
@@ -77,6 +97,11 @@ module Fastlane
77
97
  FastlaneCore::ConfigItem.new(key: :reporter,
78
98
  description: 'Choose output reporter',
79
99
  is_string: true,
100
+ optional: true),
101
+ FastlaneCore::ConfigItem.new(key: :quiet,
102
+ description: "Don't print status logs like 'Linting <file>' & 'Done linting'",
103
+ default_value: false,
104
+ is_string: false,
80
105
  optional: true)
81
106
  ]
82
107
  end
@@ -98,7 +98,7 @@ module Fastlane
98
98
  command :trigger do |c|
99
99
  c.syntax = 'fastlane [lane]'
100
100
  c.description = 'Run a specific lane. Pass the lane name and optionally the platform first.'
101
- c.option '--env STRING', String, 'Add environment to use with `dotenv`'
101
+ c.option '--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`'
102
102
 
103
103
  c.action do |args, options|
104
104
  if ensure_fastfile
@@ -161,33 +161,53 @@ module Fastlane
161
161
  end
162
162
  end
163
163
 
164
- def self.load_dot_env(env)
165
- # find the first directory of [fastlane, its parent] containing dotenv files
164
+ # @param env_cl_param [String] an optional list of dotenv environment names separated by commas, without space
165
+ def self.load_dot_env(env_cl_param)
166
+ base_path = find_dotenv_directory
167
+
168
+ return unless base_path
169
+
170
+ load_dot_envs_from(env_cl_param, base_path)
171
+ end
172
+
173
+ # finds the first directory of [fastlane, its parent] containing dotenv files
174
+ def self.find_dotenv_directory
166
175
  path = FastlaneCore::FastlaneFolder.path
167
176
  search_paths = [path]
168
177
  search_paths << path + "/.." unless path.nil?
169
178
  search_paths.compact!
170
- base_path = search_paths.find do |dir|
179
+ search_paths.find do |dir|
171
180
  Dir.glob(File.join(dir, '*.env*'), File::FNM_DOTMATCH).count > 0
172
181
  end
173
- return unless base_path
174
- require 'dotenv'
182
+ end
175
183
 
176
- Actions.lane_context[Actions::SharedValues::ENVIRONMENT] = env if env
184
+ # loads the dotenvs. First the .env and .env.default and
185
+ # then override with all speficied extra environments
186
+ def self.load_dot_envs_from(env_cl_param, base_path)
187
+ require 'dotenv'
177
188
 
178
189
  # Making sure the default '.env' and '.env.default' get loaded
179
190
  env_file = File.join(base_path, '.env')
180
191
  env_default_file = File.join(base_path, '.env.default')
181
192
  Dotenv.load(env_file, env_default_file)
182
193
 
183
- # Loads .env file for the environment passed in through options
184
- if env
194
+ return unless env_cl_param
195
+
196
+ Actions.lane_context[Actions::SharedValues::ENVIRONMENT] = env_cl_param
197
+
198
+ # multiple envs?
199
+ envs = env_cl_param.split(",")
200
+
201
+ # Loads .env file for the environment(s) passed in through options
202
+ envs.each do |env|
185
203
  env_file = File.join(base_path, ".env.#{env}")
186
204
  UI.success "Loading from '#{env_file}'"
187
205
  Dotenv.overload(env_file)
188
206
  end
189
207
  end
190
208
 
209
+ private_class_method :find_dotenv_directory, :load_dot_envs_from
210
+
191
211
  def self.print_lane_context
192
212
  return if Actions.lane_context.empty?
193
213
 
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '2.10.0'.freeze
2
+ VERSION = '2.11.0'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  end
Binary file
@@ -6,11 +6,7 @@ This repository contains all your certificates and provisioning profiles needed
6
6
 
7
7
  Do not modify this file, as it gets overwritten every time you run `match`.
8
8
 
9
- ### Install [fastlane match](https://github.com/fastlane/fastlane/tree/master/match#readme)
10
-
11
- ```
12
- sudo gem install fastlane
13
- ```
9
+ ### Installation
14
10
 
15
11
  Make sure you have the latest version of the Xcode command line tools installed:
16
12
 
@@ -18,6 +14,26 @@ Make sure you have the latest version of the Xcode command line tools installed:
18
14
  xcode-select --install
19
15
  ```
20
16
 
17
+ ### Choose your installation method:
18
+
19
+ <table width="100%" >
20
+ <tr>
21
+ <th width="33%"><a href="http://brew.sh">Homebrew</a></td>
22
+ <th width="33%">Installer Script</td>
23
+ <th width="33%">Rubygems</td>
24
+ </tr>
25
+ <tr>
26
+ <td width="33%" align="center">macOS</td>
27
+ <td width="33%" align="center">macOS</td>
28
+ <td width="33%" align="center">macOS or Linux with Ruby 2.0.0 or above</td>
29
+ </tr>
30
+ <tr>
31
+ <td width="33%"><code>brew cask install fastlane</code></td>
32
+ <td width="33%"><a href="https://download.fastlane.tools/fastlane.zip">Download the zip file</a>. Then double click on the <code>install</code> script (or run it in a terminal window).</td>
33
+ <td width="33%"><code>sudo gem install fastlane -NV</code></td>
34
+ </tr>
35
+ </table>
36
+
21
37
  ### Usage
22
38
 
23
39
  Navigate to your project folder and run
@@ -9,7 +9,6 @@ module Produce
9
9
 
10
10
  def create_new_app
11
11
  ENV["CREATED_NEW_APP_ID"] = Time.now.to_i.to_s
12
-
13
12
  if app_exists?
14
13
  UI.success "[DevCenter] App '#{Produce.config[:app_identifier]}' already exists, nothing to do on the Dev Center"
15
14
  ENV["CREATED_NEW_APP_ID"] = nil
@@ -18,38 +17,9 @@ module Produce
18
17
  app_name = Produce.config[:app_name]
19
18
  UI.message "Creating new app '#{app_name}' on the Apple Dev Center"
20
19
 
21
- app_service = Spaceship.app_service
22
- enabled_clean_options = {}
23
- Produce.config[:enabled_features].each do |k, v|
24
- if k == :data_protection
25
- case v
26
- when "complete"
27
- enabled_clean_options[app_service.data_protection.complete.service_id] = app_service.data_protection.complete.on
28
- when "unlessopen"
29
- enabled_clean_options[app_service.data_protection.unlessopen.service_id] = app_service.data_protection.unlessopen.on
30
- when "untilfirstauth"
31
- enabled_clean_options[app_service.data_protection.untilfirstauth.service_id] = app_service.data_protection.untilfirstauth.on
32
- end
33
- elsif k == :icloud
34
- case v
35
- when "legacy"
36
- enabled_clean_options[app_service.icloud.on.service_id] = app_service.icloud.on
37
- enabled_clean_options[app_service.cloud_kit.xcode5_compatible.service_id] = app_service.cloud_kit.xcode5_compatible
38
- when "cloudkit"
39
- enabled_clean_options[app_service.icloud.on.service_id] = app_service.icloud.on
40
- enabled_clean_options[app_service.cloud_kit.cloud_kit.service_id] = app_service.cloud_kit.cloud_kit
41
- end
42
- else
43
- if v == "on"
44
- enabled_clean_options[app_service.send(k.to_s).on.service_id] = app_service.send(k.to_s).on
45
- else
46
- enabled_clean_options[app_service.send(k.to_s).off.service_id] = app_service.send(k.to_s).off
47
- end
48
- end
49
- end
50
20
  app = Spaceship.app.create!(bundle_id: app_identifier,
51
21
  name: app_name,
52
- enabled_features: enabled_clean_options,
22
+ enabled_features: enabled_features,
53
23
  mac: Produce.config[:platform] == "osx")
54
24
 
55
25
  if app.name != Produce.config[:app_name]
@@ -70,6 +40,39 @@ module Produce
70
40
  return true
71
41
  end
72
42
 
43
+ def enabled_features
44
+ app_service = Spaceship.app_service
45
+ enabled_clean_options = {}
46
+ Produce.config[:enabled_features].each do |k, v|
47
+ if k.to_sym == :data_protection
48
+ case v
49
+ when "complete"
50
+ enabled_clean_options[app_service.data_protection.complete.service_id] = app_service.data_protection.complete
51
+ when "unlessopen"
52
+ enabled_clean_options[app_service.data_protection.unlessopen.service_id] = app_service.data_protection.unlessopen
53
+ when "untilfirstauth"
54
+ enabled_clean_options[app_service.data_protection.untilfirstauth.service_id] = app_service.data_protection.untilfirstauth
55
+ end
56
+ elsif k.to_sym == :icloud
57
+ case v
58
+ when "legacy"
59
+ enabled_clean_options[app_service.icloud.on.service_id] = app_service.icloud.on
60
+ enabled_clean_options[app_service.cloud_kit.xcode5_compatible.service_id] = app_service.cloud_kit.xcode5_compatible
61
+ when "cloudkit"
62
+ enabled_clean_options[app_service.icloud.on.service_id] = app_service.icloud.on
63
+ enabled_clean_options[app_service.cloud_kit.cloud_kit.service_id] = app_service.cloud_kit.cloud_kit
64
+ end
65
+ else
66
+ if v == "on"
67
+ enabled_clean_options[app_service.send(k.to_s).on.service_id] = app_service.send(k.to_s).on
68
+ else
69
+ enabled_clean_options[app_service.send(k.to_s).off.service_id] = app_service.send(k.to_s).off
70
+ end
71
+ end
72
+ end
73
+ enabled_clean_options
74
+ end
75
+
73
76
  def app_identifier
74
77
  Produce.config[:app_identifier].to_s
75
78
  end
@@ -112,11 +112,13 @@ module Screengrab
112
112
  FastlaneCore::ConfigItem.new(key: :exit_on_test_failure,
113
113
  env_name: 'EXIT_ON_TEST_FAILURE',
114
114
  description: "Whether or not to exit Screengrab on test failure. Exiting on failure will not copy sceenshots to local machine nor open sceenshots summary",
115
- default_value: true),
115
+ default_value: true,
116
+ is_string: false),
116
117
  FastlaneCore::ConfigItem.new(key: :reinstall_app,
117
118
  env_name: 'SCREENGRAB_REINSTALL_APP',
118
119
  description: "Enabling this option will automatically uninstall the application before running it",
119
- default_value: false)
120
+ default_value: false,
121
+ is_string: false)
120
122
  ]
121
123
  end
122
124
  end
@@ -551,7 +551,10 @@ function resign {
551
551
  do
552
552
  if [[ "$framework" == *.framework || "$framework" == *.dylib ]]
553
553
  then
554
- /usr/bin/codesign ${VERBOSE} "${KEYCHAIN_FLAG}" -f -s "$CERTIFICATE" "$framework"
554
+ log "Resigning '$framework'"
555
+ # Must not qote KEYCHAIN_FLAG because it needs to be unwrapped and passed to codesign with spaces
556
+ # shellcheck disable=SC2086
557
+ /usr/bin/codesign ${VERBOSE} ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" "$framework"
555
558
  checkStatus
556
559
  else
557
560
  log "Ignoring non-framework: $framework"
@@ -764,7 +767,9 @@ function resign {
764
767
  log "Resigning application using certificate: '$CERTIFICATE'"
765
768
  log "and entitlements from provisioning profile: $NEW_PROVISION"
766
769
  cp -- "$TEMP_DIR/newEntitlements" "$APP_PATH/archived-expanded-entitlements.xcent"
767
- /usr/bin/codesign ${VERBOSE} "${KEYCHAIN_FLAG}" -f -s "$CERTIFICATE" --entitlements "$TEMP_DIR/newEntitlements" "$APP_PATH"
770
+ # Must not qote KEYCHAIN_FLAG because it needs to be unwrapped and passed to codesign with spaces
771
+ # shellcheck disable=SC2086
772
+ /usr/bin/codesign ${VERBOSE} ${KEYCHAIN_FLAG} -f -s "$CERTIFICATE" --entitlements "$TEMP_DIR/newEntitlements" "$APP_PATH"
768
773
  checkStatus
769
774
  fi
770
775
 
@@ -51,8 +51,8 @@ module Sigh
51
51
  use_app_entitlements_flag,
52
52
  verbose,
53
53
  bundle_id,
54
- ipa.shellescape,
55
- specific_keychain
54
+ specific_keychain,
55
+ ipa.shellescape # Output path must always be last argument
56
56
  ].join(' ')
57
57
 
58
58
  puts command.magenta
Binary file
Binary file
@@ -239,6 +239,16 @@ module Spaceship
239
239
  client.price_tier(self.apple_id)
240
240
  end
241
241
 
242
+ # set the availability. This method doesn't require `save` to be called
243
+ def update_availability!(availability)
244
+ client.update_availability!(self.apple_id, availability)
245
+ end
246
+
247
+ # The current availability.
248
+ def availability
249
+ client.availability(self.apple_id)
250
+ end
251
+
242
252
  #####################################################
243
253
  # @!group Builds
244
254
  #####################################################
@@ -0,0 +1,46 @@
1
+ module Spaceship
2
+ module Tunes
3
+ class Availability < TunesBase
4
+ # @return (Bool) Are future territories included?
5
+ attr_accessor :include_future_territories
6
+
7
+ # @return (Array of Spaceship::Tunes::Territory objects) A list of the territories
8
+ attr_accessor :territories
9
+
10
+ attr_mapping(
11
+ 'theWorld' => :include_future_territories
12
+ )
13
+
14
+ class << self
15
+ # Create a new object based on a hash.
16
+ # This is used to create a new object based on the server response.
17
+ def factory(attrs)
18
+ obj = self.new(attrs)
19
+ obj.unfold_territories(attrs['countries'])
20
+ return obj
21
+ end
22
+
23
+ # Create a new object based on a set of territories.
24
+ # @param territories (Array of String or Spaceship::Tunes::Territory objects): A list of the territories
25
+ # @param params (Hash): Optional parameters (include_future_territories (Bool, default: true) Are future territories included?)
26
+ def from_territories(territories = [], params = {})
27
+ obj = self.new
28
+ # Detect if the territories attribute is an array of Strings and convert to Territories
29
+ obj.territories =
30
+ if territories[0].kind_of?(String)
31
+ territories.map { |territory| Spaceship::Tunes::Territory.from_code(territory) }
32
+ else
33
+ territories
34
+ end
35
+ obj.include_future_territories = params.fetch(:include_future_territories, true)
36
+ return obj
37
+ end
38
+ end
39
+
40
+ def unfold_territories(attrs)
41
+ unfolded_territories = attrs.map { |info| Territory.new(info) }
42
+ instance_variable_set(:@territories, unfolded_territories)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,44 @@
1
+ module Spaceship
2
+ module Tunes
3
+ class Territory < TunesBase
4
+ # @return (String) The two-character country code (e.g. "US" for the United States)
5
+ attr_accessor :code
6
+
7
+ # @return (String) The ISO 3166-1 alpha-3 currency code (e.g. "USD" for the United States)
8
+ attr_accessor :currency_code
9
+
10
+ # @return (String) The country name (e.g. "United States" for the United States)
11
+ attr_accessor :name
12
+
13
+ # @return (String) The region (e.g. "The United States and Canada" for the United States)
14
+ attr_accessor :region
15
+
16
+ # @return (String) The region locale key (e.g. "ITC.region.NAM" for the United States)
17
+ attr_accessor :region_locale_key
18
+
19
+ attr_mapping(
20
+ 'code' => :code,
21
+ 'currencyCodeISO3A' => :currency_code,
22
+ 'name' => :name,
23
+ 'region' => :region,
24
+ 'regionLocaleKey' => :region_locale_key
25
+ )
26
+
27
+ class << self
28
+ # Create a new object based on a hash.
29
+ # This is used to create a new object based on the server response.
30
+ def factory(attrs)
31
+ obj = self.new(attrs)
32
+ return obj
33
+ end
34
+
35
+ # Create a new object based on a two-character country code (e.g. "US" for the United States)
36
+ def from_code(code)
37
+ obj = self.new
38
+ obj.code = code
39
+ return obj
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -25,6 +25,8 @@ require 'spaceship/tunes/tester'
25
25
  require 'spaceship/tunes/app_details'
26
26
  require 'spaceship/tunes/pricing_tier'
27
27
  require 'spaceship/tunes/recovery_device'
28
+ require 'spaceship/tunes/territory'
29
+ require 'spaceship/tunes/availability'
28
30
 
29
31
  require 'spaceship/tunes/app_version_promocodes'
30
32
  require 'spaceship/tunes/app_version_generated_promocodes'
@@ -446,6 +446,51 @@ module Spaceship
446
446
  data.map { |tier| Spaceship::Tunes::PricingTier.factory(tier) }
447
447
  end
448
448
 
449
+ #####################################################
450
+ # @!group Availability
451
+ #####################################################
452
+ # Updates the availability
453
+ #
454
+ # @note Although this information is publicly available, the current spaceship implementation requires you to have a logged in client to access it
455
+ # @param app_id (String): The id of your app
456
+ # @param availability (Availability): The availability update
457
+ #
458
+ # @return [Spaceship::Tunes::Availability] the new Availability
459
+ def update_availability!(app_id, availability)
460
+ r = request(:get, "ra/apps/#{app_id}/pricing/intervals")
461
+ data = parse_response(r, 'data')
462
+
463
+ data["countriesChanged"] = true
464
+ data["countries"] = availability.territories.map { |territory| { 'code' => territory.code } }
465
+ data["theWorld"] = availability.include_future_territories.nil? ? true : availability.include_future_territories
466
+
467
+ # send the changes back to Apple
468
+ r = request(:post) do |req|
469
+ req.url "ra/apps/#{app_id}/pricing/intervals"
470
+ req.body = data.to_json
471
+ req.headers['Content-Type'] = 'application/json'
472
+ end
473
+ handle_itc_response(r.body)
474
+ data = parse_response(r, 'data')
475
+ Spaceship::Tunes::Availability.factory(data)
476
+ end
477
+
478
+ def availability(app_id)
479
+ r = request(:get, "ra/apps/#{app_id}/pricing/intervals")
480
+ data = parse_response(r, 'data')
481
+ Spaceship::Tunes::Availability.factory(data)
482
+ end
483
+
484
+ # Returns an array of all supported territories
485
+ #
486
+ # @note Although this information is publicly available, the current spaceship implementation requires you to have a logged in client to access it
487
+ #
488
+ # @return [Array] the Territory objects (Spaceship::Tunes::Territory)
489
+ def supported_territories
490
+ data = supported_countries
491
+ data.map { |country| Spaceship::Tunes::Territory.factory(country) }
492
+ end
493
+
449
494
  # An array of supported countries
450
495
  # [{
451
496
  # "code": "AL",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-01-23 00:00:00.000000000 Z
17
+ date: 2017-01-25 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: slack-notifier
@@ -468,16 +468,22 @@ dependencies:
468
468
  name: bundler
469
469
  requirement: !ruby/object:Gem::Requirement
470
470
  requirements:
471
- - - "~>"
471
+ - - ">="
472
472
  - !ruby/object:Gem::Version
473
- version: '1.12'
473
+ version: 1.12.0
474
+ - - "<"
475
+ - !ruby/object:Gem::Version
476
+ version: 2.0.0
474
477
  type: :runtime
475
478
  prerelease: false
476
479
  version_requirements: !ruby/object:Gem::Requirement
477
480
  requirements:
478
- - - "~>"
481
+ - - ">="
479
482
  - !ruby/object:Gem::Version
480
- version: '1.12'
483
+ version: 1.12.0
484
+ - - "<"
485
+ - !ruby/object:Gem::Version
486
+ version: 2.0.0
481
487
  - !ruby/object:Gem::Dependency
482
488
  name: faraday
483
489
  requirement: !ruby/object:Gem::Requirement
@@ -698,7 +704,6 @@ executables:
698
704
  extensions: []
699
705
  extra_rdoc_files: []
700
706
  files:
701
- - "./lib/.DS_Store"
702
707
  - LICENSE
703
708
  - README.md
704
709
  - bin/bin-proxy
@@ -756,6 +761,7 @@ files:
756
761
  - fastlane/lib/fastlane/.DS_Store
757
762
  - fastlane/lib/fastlane/action.rb
758
763
  - fastlane/lib/fastlane/action_collector.rb
764
+ - fastlane/lib/fastlane/actions/.DS_Store
759
765
  - fastlane/lib/fastlane/actions/README.md
760
766
  - fastlane/lib/fastlane/actions/actions_helper.rb
761
767
  - fastlane/lib/fastlane/actions/adb.rb
@@ -796,6 +802,7 @@ files:
796
802
  - fastlane/lib/fastlane/actions/delete_keychain.rb
797
803
  - fastlane/lib/fastlane/actions/deliver.rb
798
804
  - fastlane/lib/fastlane/actions/deploygate.rb
805
+ - fastlane/lib/fastlane/actions/device_grid/.DS_Store
799
806
  - fastlane/lib/fastlane/actions/device_grid/README.md
800
807
  - fastlane/lib/fastlane/actions/dotgpg_environment.rb
801
808
  - fastlane/lib/fastlane/actions/download.rb
@@ -992,7 +999,6 @@ files:
992
999
  - fastlane/lib/fastlane/plugins/template/spec/%plugin_name%_action_spec.rb.erb
993
1000
  - fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb
994
1001
  - fastlane/lib/fastlane/runner.rb
995
- - fastlane/lib/fastlane/setup/.DS_Store
996
1002
  - fastlane/lib/fastlane/setup/crashlytics_beta.rb
997
1003
  - fastlane/lib/fastlane/setup/crashlytics_beta_command_line_handler.rb
998
1004
  - fastlane/lib/fastlane/setup/crashlytics_beta_info.rb
@@ -1010,6 +1016,7 @@ files:
1010
1016
  - fastlane_core/lib/.DS_Store
1011
1017
  - fastlane_core/lib/assets/XMLTemplate.xml.erb
1012
1018
  - fastlane_core/lib/fastlane_core.rb
1019
+ - fastlane_core/lib/fastlane_core/.DS_Store
1013
1020
  - fastlane_core/lib/fastlane_core/cert_checker.rb
1014
1021
  - fastlane_core/lib/fastlane_core/command_executor.rb
1015
1022
  - fastlane_core/lib/fastlane_core/configuration/commander_generator.rb
@@ -1165,6 +1172,7 @@ files:
1165
1172
  - sigh/lib/sigh/resign.rb
1166
1173
  - sigh/lib/sigh/runner.rb
1167
1174
  - snapshot/README.md
1175
+ - snapshot/lib/.DS_Store
1168
1176
  - snapshot/lib/assets/SnapfileTemplate
1169
1177
  - snapshot/lib/assets/SnapshotHelper.swift
1170
1178
  - snapshot/lib/assets/SnapshotHelper2-3.swift
@@ -1189,9 +1197,11 @@ files:
1189
1197
  - snapshot/lib/snapshot/test_command_generator.rb
1190
1198
  - snapshot/lib/snapshot/update.rb
1191
1199
  - spaceship/README.md
1200
+ - spaceship/lib/.DS_Store
1192
1201
  - spaceship/lib/assets/languageMapping.json
1193
1202
  - spaceship/lib/assets/languageMappingReadable.json
1194
1203
  - spaceship/lib/spaceship.rb
1204
+ - spaceship/lib/spaceship/.DS_Store
1195
1205
  - spaceship/lib/spaceship/babosa_fix.rb
1196
1206
  - spaceship/lib/spaceship/base.rb
1197
1207
  - spaceship/lib/spaceship/client.rb
@@ -1230,6 +1240,7 @@ files:
1230
1240
  - spaceship/lib/spaceship/tunes/app_version_ref.rb
1231
1241
  - spaceship/lib/spaceship/tunes/app_version_states_history.rb
1232
1242
  - spaceship/lib/spaceship/tunes/application.rb
1243
+ - spaceship/lib/spaceship/tunes/availability.rb
1233
1244
  - spaceship/lib/spaceship/tunes/build.rb
1234
1245
  - spaceship/lib/spaceship/tunes/build_details.rb
1235
1246
  - spaceship/lib/spaceship/tunes/build_train.rb
@@ -1239,6 +1250,7 @@ files:
1239
1250
  - spaceship/lib/spaceship/tunes/pricing_tier.rb
1240
1251
  - spaceship/lib/spaceship/tunes/recovery_device.rb
1241
1252
  - spaceship/lib/spaceship/tunes/spaceship.rb
1253
+ - spaceship/lib/spaceship/tunes/territory.rb
1242
1254
  - spaceship/lib/spaceship/tunes/tester.rb
1243
1255
  - spaceship/lib/spaceship/tunes/transit_app_file.rb
1244
1256
  - spaceship/lib/spaceship/tunes/tunes.rb
@@ -1249,7 +1261,6 @@ files:
1249
1261
  - spaceship/lib/spaceship/two_step_client.rb
1250
1262
  - spaceship/lib/spaceship/ui.rb
1251
1263
  - supply/README.md
1252
- - supply/lib/.DS_Store
1253
1264
  - supply/lib/supply.rb
1254
1265
  - supply/lib/supply/apk_listing.rb
1255
1266
  - supply/lib/supply/client.rb
@@ -1294,7 +1305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1294
1305
  version: '0'
1295
1306
  requirements: []
1296
1307
  rubyforge_project:
1297
- rubygems_version: 2.5.1
1308
+ rubygems_version: 2.6.6
1298
1309
  signing_key:
1299
1310
  specification_version: 4
1300
1311
  summary: The easiest way to automate beta deployments and releases for your iOS and