fastlane 2.142.0 → 2.146.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +80 -80
  3. data/credentials_manager/lib/credentials_manager/appfile_config.rb +4 -0
  4. data/deliver/lib/deliver/app_screenshot.rb +1 -0
  5. data/deliver/lib/deliver/options.rb +30 -1
  6. data/deliver/lib/deliver/setup.rb +4 -4
  7. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +7 -1
  8. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +3 -0
  9. data/fastlane/lib/fastlane/actions/crashlytics.rb +14 -2
  10. data/fastlane/lib/fastlane/actions/create_pull_request.rb +7 -1
  11. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +10 -4
  12. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +22 -6
  13. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +23 -7
  14. data/fastlane/lib/fastlane/actions/frame_screenshots.rb +2 -1
  15. data/fastlane/lib/fastlane/actions/get_version_number.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/pod_lib_lint.rb +7 -1
  17. data/fastlane/lib/fastlane/actions/s3.rb +3 -289
  18. data/fastlane/lib/fastlane/actions/setup_ci.rb +1 -1
  19. data/fastlane/lib/fastlane/actions/setup_jenkins.rb +11 -2
  20. data/fastlane/lib/fastlane/actions/slather.rb +1 -1
  21. data/fastlane/lib/fastlane/actions/swiftlint.rb +28 -7
  22. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +203 -0
  23. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +1 -1
  24. data/fastlane/lib/fastlane/actions/verify_build.rb +1 -1
  25. data/fastlane/lib/fastlane/helper/s3_client_helper.rb +61 -0
  26. data/fastlane/lib/fastlane/version.rb +1 -1
  27. data/fastlane/swift/Deliverfile.swift +1 -1
  28. data/fastlane/swift/Fastlane.swift +147 -8
  29. data/fastlane/swift/Gymfile.swift +1 -1
  30. data/fastlane/swift/Matchfile.swift +1 -1
  31. data/fastlane/swift/MatchfileProtocol.swift +17 -1
  32. data/fastlane/swift/Precheckfile.swift +1 -1
  33. data/fastlane/swift/Scanfile.swift +1 -1
  34. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  35. data/fastlane/swift/Screengrabfile.swift +1 -1
  36. data/fastlane/swift/Snapshotfile.swift +1 -1
  37. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +9 -0
  38. data/fastlane_core/lib/fastlane_core/device_manager.rb +3 -3
  39. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +1 -0
  40. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +15 -2
  41. data/frameit/lib/frameit/commands_generator.rb +25 -0
  42. data/frameit/lib/frameit/config_parser.rb +31 -9
  43. data/frameit/lib/frameit/device.rb +90 -0
  44. data/frameit/lib/frameit/device_types.rb +121 -5
  45. data/frameit/lib/frameit/editor.rb +29 -41
  46. data/frameit/lib/frameit/offsets.rb +8 -1
  47. data/frameit/lib/frameit/options.rb +81 -54
  48. data/frameit/lib/frameit/runner.rb +17 -7
  49. data/frameit/lib/frameit/screenshot.rb +39 -47
  50. data/frameit/lib/frameit/template_finder.rb +15 -12
  51. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  52. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +5 -0
  53. data/gym/lib/gym/runner.rb +14 -0
  54. data/match/lib/match/change_password.rb +1 -1
  55. data/match/lib/match/encryption.rb +4 -0
  56. data/match/lib/match/importer.rb +37 -20
  57. data/match/lib/match/module.rb +1 -1
  58. data/match/lib/match/nuke.rb +5 -1
  59. data/match/lib/match/options.rb +18 -0
  60. data/match/lib/match/runner.rb +4 -0
  61. data/match/lib/match/setup.rb +1 -1
  62. data/match/lib/match/storage.rb +4 -0
  63. data/match/lib/match/storage/s3_storage.rb +167 -0
  64. data/pilot/lib/pilot/build_manager.rb +15 -4
  65. data/pilot/lib/pilot/options.rb +8 -0
  66. data/produce/lib/produce/developer_center.rb +11 -2
  67. data/produce/lib/produce/itunes_connect.rb +11 -3
  68. data/produce/lib/produce/options.rb +12 -0
  69. data/scan/lib/scan/options.rb +5 -0
  70. data/scan/lib/scan/test_command_generator.rb +5 -1
  71. data/screengrab/lib/screengrab/runner.rb +12 -4
  72. data/snapshot/lib/snapshot/reports_generator.rb +4 -0
  73. data/spaceship/lib/spaceship/connect_api/models/app.rb +11 -0
  74. data/spaceship/lib/spaceship/connect_api/models/build.rb +1 -2
  75. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +2 -0
  76. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +23 -0
  77. data/spaceship/lib/spaceship/portal/app_service.rb +2 -2
  78. data/spaceship/lib/spaceship/portal/portal_client.rb +13 -0
  79. data/spaceship/lib/spaceship/tunes/app_version.rb +6 -1
  80. data/spaceship/lib/spaceship/tunes/application.rb +2 -1
  81. data/spaceship/lib/spaceship/tunes/tunes_client.rb +2 -2
  82. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +52 -16
  83. data/supply/lib/supply/client.rb +4 -4
  84. data/supply/lib/supply/setup.rb +5 -3
  85. metadata +34 -17
  86. data/gym/lib/gym/.code_signing_mapping.rb.swp +0 -0
@@ -3,6 +3,8 @@ module Fastlane
3
3
  module Actions
4
4
  class AutomaticCodeSigningAction < Action
5
5
  def self.run(params)
6
+ UI.deprecated("The `automatic_code_signing` action has been deprecated,")
7
+ UI.deprecated("Please use `update_code_signing_settings` action instead.")
6
8
  FastlaneCore::PrintTable.print_values(config: params, title: "Summary for Automatic Codesigning")
7
9
  path = params[:path]
8
10
  path = File.join(File.expand_path(path), "project.pbxproj")
@@ -201,7 +203,11 @@ module Fastlane
201
203
  end
202
204
 
203
205
  def self.category
204
- :code_signing
206
+ :deprecated
207
+ end
208
+
209
+ def self.deprecated_notes
210
+ "Please use `update_code_signing_settings` action instead."
205
211
  end
206
212
 
207
213
  def self.return_value
@@ -21,6 +21,9 @@ module Fastlane
21
21
  File.delete(file)
22
22
  end
23
23
 
24
+ Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATHS] = nil
25
+ Actions.lane_context[Actions::SharedValues::DSYM_PATHS] = nil
26
+
24
27
  UI.success('Cleaned up build artifacts 🐙')
25
28
  end
26
29
 
@@ -66,7 +66,7 @@ module Fastlane
66
66
  end
67
67
 
68
68
  def self.description
69
- "Upload a new build to [Crashlytics Beta](http://try.crashlytics.com/beta/)"
69
+ "Refer to [Firebase App Distribution](https://appdistro.page.link/fastlane-repo)"
70
70
  end
71
71
 
72
72
  def self.available_options
@@ -169,6 +169,10 @@ module Fastlane
169
169
 
170
170
  def self.details
171
171
  [
172
+ "Crashlytics Beta has been deprecated and replaced with Firebase App Distribution.",
173
+ "Beta will continue working until May 4, 2020.",
174
+ "Check out the [Firebase App Distribution docs](https://github.com/fastlane/fastlane-plugin-firebase_app_distribution) to get started.",
175
+ "",
172
176
  "Additionally, you can specify `notes`, `emails`, `groups` and `notifications`.",
173
177
  "Distributing to Groups: When using the `groups` parameter, it's important to use the group **alias** names for each group you'd like to distribute to. A group's alias can be found in the web UI. If you're viewing the Beta page, you can open the groups dialog by clicking the 'Manage Groups' button.",
174
178
  "This action uses the `submit` binary provided by the Crashlytics framework. If the binary is not found in its usual path, you'll need to specify the path manually by using the `crashlytics_path` option."
@@ -196,7 +200,15 @@ module Fastlane
196
200
  end
197
201
 
198
202
  def self.category
199
- :beta
203
+ :deprecated
204
+ end
205
+
206
+ def self.deprecated_notes
207
+ [
208
+ "Crashlytics Beta has been deprecated and replaced with Firebase App Distribution.",
209
+ "Beta will continue working until May 4, 2020.",
210
+ "Check out the [Firebase App Distribution docs](https://github.com/fastlane/fastlane-plugin-firebase_app_distribution) to get started."
211
+ ].join("\n")
200
212
  end
201
213
  end
202
214
  end
@@ -15,6 +15,7 @@ module Fastlane
15
15
  'base' => params[:base]
16
16
  }
17
17
  payload['body'] = params[:body] if params[:body]
18
+ payload['draft'] = params[:draft] if params[:draft]
18
19
 
19
20
  GithubApiAction.run(
20
21
  server_url: params[:api_url],
@@ -176,6 +177,11 @@ module Fastlane
176
177
  description: "The contents of the pull request",
177
178
  is_string: true,
178
179
  optional: true),
180
+ FastlaneCore::ConfigItem.new(key: :draft,
181
+ env_name: "GITHUB_PULL_REQUEST_DRAFT",
182
+ description: "Indicates whether the pull request is a draft",
183
+ type: Boolean,
184
+ optional: true),
179
185
  FastlaneCore::ConfigItem.new(key: :labels,
180
186
  env_name: "GITHUB_PULL_REQUEST_LABELS",
181
187
  description: "The labels for the pull request",
@@ -226,7 +232,7 @@ module Fastlane
226
232
  end
227
233
 
228
234
  def self.author
229
- ["seei", "tommeier", "marumemomo", "elneruda"]
235
+ ["seei", "tommeier", "marumemomo", "elneruda", "kagemiku"]
230
236
  end
231
237
 
232
238
  def self.is_supported?(platform)
@@ -190,10 +190,16 @@ The `Snapfile` can contain all the options that are also available on `fastlane
190
190
  scheme("UITests")
191
191
 
192
192
  devices([
193
- "iPhone 6",
194
- "iPhone 6 Plus",
195
- "iPhone 5",
196
- "iPhone 4s"
193
+ "iPad (7th generation)",
194
+ "iPad Air (3rd generation)",
195
+ "iPad Pro (11-inch)",
196
+ "iPad Pro (12.9-inch) (3rd generation)",
197
+ "iPad Pro (9.7-inch)",
198
+ "iPhone 11",
199
+ "iPhone 11 Pro",
200
+ "iPhone 11 Pro Max",
201
+ "iPhone 8",
202
+ "iPhone 8 Plus"
197
203
  ])
198
204
 
199
205
  languages([
@@ -4,7 +4,7 @@
4
4
 
5
5
  ###### Easily put your screenshots into the right device frames
6
6
 
7
- _frameit_ allows you to put a gorgeous device frame around your iOS and macOS screenshots just by running one simple command. Use _frameit_ to prepare perfect screenshots for the App Store, your website, QA or emails.
7
+ _frameit_ allows you to put a gorgeous device frame around your iOS, macOS and Android screenshots just by running one simple command. Use _frameit_ to prepare perfect screenshots for the App Store, your website, QA or emails.
8
8
 
9
9
  -------
10
10
 
@@ -23,9 +23,10 @@ _frameit_ allows you to put a gorgeous device frame around your iOS and macOS sc
23
23
 
24
24
  ## Frame screenshot
25
25
 
26
- Put a gorgeous device frame around your iOS and macOS screenshots just by running one simple command. Support for:
26
+ Put a gorgeous device frame around your iOS, macOS and Android screenshots just by running one simple command. Support for:
27
27
 
28
28
  - iPhone, iPad and Mac
29
+ - Set of Android devices
29
30
  - Portrait and Landscape modes
30
31
  - Several device frame colors
31
32
 
@@ -69,12 +70,18 @@ More information about this process and how to update the frames can be found [h
69
70
 
70
71
  Why should you have to use Photoshop, just to add a frame around your screenshots?
71
72
 
72
- Just navigate to your folder of screenshots and use the following command:
73
+ Just navigate to your folder of screenshots and use the following command (iOS and Mac OS are default platforms for backward compatibility):
73
74
 
74
75
  ```no-highlight
75
76
  fastlane frameit
76
77
  ```
77
78
 
79
+ To frame Android screenshots:
80
+
81
+ ```no-highlight
82
+ fastlane frameit android
83
+ ```
84
+
78
85
  To use the silver version of the frames:
79
86
 
80
87
  ```no-highlight
@@ -129,8 +136,10 @@ The general parameters are defined in the `default` key and can be:
129
136
  | `padding` | The content of the framed screenshot will be resized to match the specified `padding` around all edges. The vertical padding is also applied between the text and the top or bottom (depending on `title_below_image`) of the device frame. <p> There are 3 different options of specyfying the padding: <p> 1. Default: An integer value that defines both horizontal and vertical padding in pixels. <br> 2. A string that defines (different) padding values in pixels for horizontal and vertical padding. The syntax is `"<horizontal>x<vertical>"`, e.g. `"30x60"`. <br> 3. A string that defines (different) padding values in percentage for horizontal and vertical padding. The syntax is `"<horizontal>%x<vertical>%"`, e.g. `"5%x10%"`. <br> **Note:** The percentage is calculated from the smallest image dimension (height or width). <p> A combination of option 2 and 3 is possible, e.g. `"5%x40"`. | `50` |
130
137
  | `interline_spacing` | Specifies whether _frameit_ should add or subtract this many pixels between the individual lines of text. This only applies to a multi-line `title` and/or `keyword` to expand or squash together the individual lines of text. | `0` |
131
138
  | `font_scale_factor` | Specifies whether _frameit_ should increase or decrease the font size of the text. | `0.1` |
132
- | `frame` | Overrides the color of the frame to be used. (Valid values are `BLACK, `WHITE`, `GOLD` and `ROSE_GOLD`) | NA |
139
+ | `frame` | Overrides the color of the frame to be used. (Valid values are `BLACK`, `WHITE`, `GOLD` and `ROSE_GOLD`) | NA |
133
140
  | `title_min_height` | Specifies a height always reserved for the title. Value can be a percentage of the height or an absolute value. The device will be placed below (or above) this area. Convenient to ensure the device top (or bottom) will be consistently placed at the same height on the different screenshots. | NA |
141
+ | `use_platform` | Overrides the platform used for the screenshot. Valid values are `IOS`, `ANDROID` and `ANY`. | `IOS` |
142
+ | `force_device_type` | Forces a specific device. Valid values are: Huawei P8, Motorola Moto E, Motorola Moto G, Nexus 4, Nexus 5X, Nexus 6P, Nexus 9, Samsung Galaxy Grand Prime, Samsung Galaxy Note 5, Samsung Galaxy S Duos, Samsung Galaxy S3, Samsung Galaxy S5, Samsung Galaxy S7, Samsung Galaxy S8, Samsung Galaxy S9, iPhone 5s, iPhone 5c, iPhone SE, iPhone 6s, iPhone 6s Plus, iPhone 7, iPhone 7 Plus, iPhone 8, iPhone 8 Plus, iPhone X, iPhone XS, iPhone XR, iPhone XS Max, iPad Air 2, iPad Mini 4, iPad Pro, MacBook, Google Pixel 3, Google Pixel 3 XL, HTC One A9, HTC One M8 | NA |
134
143
 
135
144
  ### Specific parameters
136
145
 
@@ -142,7 +151,9 @@ These are defined in the `data` key. This is an array with the following keys fo
142
151
  | `filter` | This is mandatory to link the individual configuration to the screenshot, based on part of the file name. <p>Example:<br>If a screenshot is named `iPhone 8-Brainstorming.png` you can use value `Brainstorming` for `filter`. If there are more than one `filter` matching an entry, they will all be applied in order (which means that the last one has the highest precedence). All other keys from that array element will only be applied on this specific screenshot. |
143
152
  | `keyword` | Similar use as in `default`, except that parameter `text` can be used here because it is screenshot specific. |
144
153
  | `title` | Similar use as in `default`, except that parameter `text` can be used here because it is screenshot specific. |
145
- | `frame` | Overrides the color of the frame to be used. (Valid values are `BLACK, `WHITE`, `GOLD` and `ROSE_GOLD`) | NA |
154
+ | `frame` | Overrides the color of the frame to be used. (Valid values are `BLACK`, `WHITE`, `GOLD` and `ROSE_GOLD`) | NA |
155
+ | `use_platform` | Overrides the platform used for the screenshot. Valid values are `IOS`, `ANDROID` and `ANY`. | `IOS` |
156
+ | `force_device_type` | Forces a specific device. Valid values are the same as for the general parameter. | NA |
146
157
 
147
158
  ### <a name="keyword-and-title-parameters"></a>Framefile `keyword` and `title` parameters
148
159
 
@@ -172,7 +183,8 @@ The `keyword` and `title` parameters are both used in `default` and `data`. They
172
183
  "show_complete_frame": false,
173
184
  "stack_title" : false,
174
185
  "title_below_image": true,
175
- "frame": "WHITE"
186
+ "frame": "WHITE",
187
+ "use_platform": "IOS"
176
188
  },
177
189
 
178
190
  "data": [
@@ -200,6 +212,10 @@ The `keyword` and `title` parameters are both used in `default` and `data`. They
200
212
  "keyword": {
201
213
  "color": "#31bb48"
202
214
  }
215
+ },
216
+ {
217
+ "filter": "Android",
218
+ "use_platform": "ANDROID"
203
219
  }
204
220
  ]
205
221
  }
@@ -6,7 +6,7 @@
6
6
 
7
7
  A new approach to iOS code signing: Share one code signing identity across your development team to simplify your codesigning setup and prevent code signing issues.
8
8
 
9
- _match_ is the implementation of the [codesigning.guide concept](https://codesigning.guide). _match_ creates all required certificates & provisioning profiles and stores them in a separate git repository. Every team member with access to the repo can use those credentials for code signing. _match_ also automatically repairs broken and expired credentials. It's the easiest way to share signing credentials across teams
9
+ _match_ is the implementation of the [codesigning.guide concept](https://codesigning.guide). _match_ creates all required certificates & provisioning profiles and stores them in a separate git repository, Google Cloud, or Amazon S3. Every team member with access to the selected storage can use those credentials for code signing. _match_ also automatically repairs broken and expired credentials. It's the easiest way to share signing credentials across teams
10
10
 
11
11
  [More information on how to get started with codesigning](https://docs.fastlane.tools/codesigning/getting-started/)
12
12
 
@@ -73,7 +73,7 @@ fastlane match init
73
73
 
74
74
  <img src="/img/actions/match_init.gif" width="550" />
75
75
 
76
- You'll be asked if you want to store your code signing identities inside a **Git repo**, or on **Google Cloud**.
76
+ You'll be asked if you want to store your code signing identities inside a **Git repo**, **Google Cloud** or **Amazon S3**.
77
77
 
78
78
  #### Git Storage
79
79
 
@@ -142,6 +142,18 @@ Example content (for more advanced setups check out the [fastlane section](#fast
142
142
  google_cloud_bucket_name("major-key-certificates")
143
143
  ```
144
144
 
145
+ #### Amazon S3
146
+
147
+ Use [Amazon S3](https://aws.amazon.com/s3/) for a fully hosted solution for your code signing identities. Certificates are stored on S3, inside a storage bucket you provide. You can also directly access the files using the web console.
148
+
149
+ This will create a `Matchfile` in your current directory (or in your `./fastlane/` folder).
150
+
151
+ Example content (for more advanced setups check out the [fastlane section](#fastlane)):
152
+
153
+ ```ruby-skip-tests
154
+ s3_bucket("ios-certificates")
155
+ ```
156
+
145
157
  ### Multiple teams
146
158
 
147
159
  _match_ can store the codesigning files for multiple development teams:
@@ -155,9 +167,9 @@ match(git_branch: "team1", username: "user@team1.com")
155
167
  match(git_branch: "team2", username: "user@team2.com")
156
168
  ```
157
169
 
158
- #### Google Cloud Storage
170
+ #### Google Cloud or Amazon S3 Storage
159
171
 
160
- If you use Google Cloud Storage, you don't need to do anything manually for multiple teams. Just use Google Cloud Storage, and the top level folder will be the team ID.
172
+ If you use Google Cloud or Amazon S3 Storage, you don't need to do anything manually. Just use Google Cloud or Amazon S3 Storage, and the top level folder will be the team ID.
161
173
 
162
174
  ### Run
163
175
 
@@ -194,7 +206,7 @@ fastlane action match
194
206
 
195
207
  #### Handle multiple targets
196
208
 
197
- _match_ can use the same one Git repository or Google Cloud Storage for all bundle identifiers.
209
+ _match_ can use the same one Git repository, Google Cloud, or Amazon S3 Storage for all bundle identifiers.
198
210
 
199
211
  If you have several targets with different bundle identifiers, supply them as a comma-separated list:
200
212
 
@@ -419,6 +431,10 @@ Once you've decided which approach to take, all that's left to do is to set your
419
431
 
420
432
  Accessing Google Cloud Storage from your CI system requires you to provide the `gc_keys.json` file as part of your build. How you implement this is your decision. You can inject that file during build time.
421
433
 
434
+ #### Amazon S3 Storage access
435
+
436
+ Accessing Amazon S3 Storage from your CI system requires you to provide the `s3_region`, `s3_access_key`, `s3_secret_access_key` and `s3_bucket` options (or environment variables), with keys that has read access to the bucket.
437
+
422
438
  ### Nuke
423
439
 
424
440
  If you never really cared about code signing and have a messy Apple Developer account with a lot of invalid, expired or Xcode managed profiles/certificates, you can use the `match nuke` command to revoke your certificates and provisioning profiles. Don't worry, apps that are already available in the App Store / TestFlight will still work. Builds distributed via Ad Hoc or Enterprise will be disabled after nuking your account, so you'll have to re-upload a new build. After clearing your account you'll start from a clean state, and you can run _match_ to generate your certificates and profiles again.
@@ -449,13 +465,13 @@ You'll be asked for the new password on all your machines on the next run.
449
465
 
450
466
  ### Import
451
467
 
452
- To import and encrypt a certificate (`.cer`) and the private key (`.p12`) into the _match_ repo run:
468
+ To import and encrypt a certificate (`.cer`), the private key (`.p12`) and the provisioning profiles (`.mobileprovision` or `.provisionprofile`) into the _match_ repo run:
453
469
 
454
470
  ```no-highlight
455
471
  fastlane match import
456
472
  ```
457
473
 
458
- You'll be prompted for the certificate (`.cer`) and the private key (`.p12`) paths. _match_ will first validate the certificate (`.cer`) against the Developer Portal before importing the certificate (`.cer`) and the private key (`.p12`).
474
+ You'll be prompted for the certificate (`.cer`), the private key (`.p12`) and the provisioning profiles (`.mobileprovision` or `.provisionprofile`) paths. _match_ will first validate the certificate (`.cer`) against the Developer Portal before importing the certificate, the private key and the provisioning profiles into the specified _match_ repository.
459
475
 
460
476
  ### Manual Decrypt
461
477
 
@@ -45,6 +45,7 @@ module Fastlane
45
45
  [
46
46
  'frame_screenshots',
47
47
  'frameit # alias for "frame_screenshots"',
48
+ 'frame_screenshots(use_platform: "ANDROID")',
48
49
  'frame_screenshots(silver: true)',
49
50
  'frame_screenshots(path: "/screenshots")',
50
51
  'frame_screenshots(rose_gold: true)'
@@ -56,7 +57,7 @@ module Fastlane
56
57
  end
57
58
 
58
59
  def self.is_supported?(platform)
59
- [:ios, :mac].include?(platform)
60
+ [:ios, :mac, :android].include?(platform)
60
61
  end
61
62
  end
62
63
  end
@@ -82,7 +82,7 @@ module Fastlane
82
82
  def self.get_version_number_from_build_settings!(target, variable, configuration = nil)
83
83
  target.build_configurations.each do |config|
84
84
  if configuration.nil? || config.name == configuration
85
- value = config.build_settings[variable]
85
+ value = config.resolve_build_setting(variable)
86
86
  return value if value
87
87
  end
88
88
  end
@@ -26,6 +26,7 @@ module Fastlane
26
26
  command << "--platforms=#{params[:platforms]}" if params[:platforms]
27
27
  command << "--skip-import-validation" if params[:skip_import_validation]
28
28
  command << "--skip-tests" if params[:skip_tests]
29
+ command << "--analyze" if params[:analyze]
29
30
 
30
31
  result = Actions.sh(command.join(' '))
31
32
  UI.success("Pod lib lint Successfully ⬆️ ")
@@ -144,7 +145,12 @@ module Fastlane
144
145
  description: "Lint skips building and running tests during validation (available since cocoapods >= 1.3)",
145
146
  type: Boolean,
146
147
  default_value: false,
147
- env_name: "FL_POD_LIB_LINT_SKIP_TESTS")
148
+ env_name: "FL_POD_LIB_LINT_SKIP_TESTS"),
149
+ FastlaneCore::ConfigItem.new(key: :analyze,
150
+ description: "Validate with the Xcode Static Analysis tool (available since cocoapods >= 1.6.1)",
151
+ type: Boolean,
152
+ default_value: false,
153
+ env_name: "FL_POD_LIB_LINT_ANALYZE")
148
154
  ]
149
155
  end
150
156
 
@@ -1,4 +1,5 @@
1
1
  require 'fastlane/erb_template_helper'
2
+ require 'fastlane/helper/s3_client_helper'
2
3
  require 'ostruct'
3
4
  require 'uri'
4
5
  require 'cgi'
@@ -15,296 +16,9 @@ module Fastlane
15
16
  S3_VERSION_OUTPUT_PATH ||= :S3_VERSION_OUTPUT_PATH
16
17
  end
17
18
 
18
- S3_ARGS_MAP = {
19
- ipa: '-f',
20
- dsym: '-d',
21
- access_key: '-a',
22
- secret_access_key: '-s',
23
- bucket: '-b',
24
- region: '-r',
25
- acl: '--acl',
26
- source: '--source-dir',
27
- path: '-P'
28
- }
29
-
30
- # rubocop:disable Metrics/ClassLength
31
19
  class S3Action < Action
32
20
  def self.run(config)
33
- # Calling fetch on config so that default values will be used
34
- params = {}
35
- params[:ipa] = config[:ipa]
36
- params[:dsym] = config[:dsym]
37
- params[:access_key] = config[:access_key]
38
- params[:secret_access_key] = config[:secret_access_key]
39
- params[:bucket] = config[:bucket]
40
- params[:region] = config[:region]
41
- params[:acl] = config[:acl]
42
- params[:source] = config[:source]
43
- params[:path] = config[:path]
44
- params[:upload_metadata] = config[:upload_metadata]
45
- params[:plist_template_path] = config[:plist_template_path]
46
- params[:plist_file_name] = config[:plist_file_name]
47
- params[:html_template_path] = config[:html_template_path]
48
- params[:html_file_name] = config[:html_file_name]
49
- params[:version_template_path] = config[:version_template_path]
50
- params[:version_file_name] = config[:version_file_name]
51
-
52
- # Pulling parameters for other uses
53
- s3_region = params[:region]
54
- s3_access_key = params[:access_key]
55
- s3_secret_access_key = params[:secret_access_key]
56
- s3_bucket = params[:bucket]
57
- ipa_file = params[:ipa]
58
- dsym_file = params[:dsym]
59
- s3_path = params[:path]
60
- acl = params[:acl].to_sym
61
-
62
- UI.user_error!("No S3 access key given, pass using `access_key: 'key'`") unless s3_access_key.to_s.length > 0
63
- UI.user_error!("No S3 secret access key given, pass using `secret_access_key: 'secret key'`") unless s3_secret_access_key.to_s.length > 0
64
- UI.user_error!("No S3 bucket given, pass using `bucket: 'bucket'`") unless s3_bucket.to_s.length > 0
65
- UI.user_error!("No IPA file path given, pass using `ipa: 'ipa path'`") unless ipa_file.to_s.length > 0
66
-
67
- plist_template_path = params[:plist_template_path]
68
- plist_file_name = params[:plist_file_name]
69
- html_template_path = params[:html_template_path]
70
- html_file_name = params[:html_file_name]
71
- version_template_path = params[:version_template_path]
72
- version_file_name = params[:version_file_name]
73
-
74
- s3_client = self.s3_client(s3_access_key, s3_secret_access_key, s3_region)
75
- bucket = s3_client.buckets[s3_bucket]
76
-
77
- url_part = self.expand_path_with_substitutions_from_ipa_plist(ipa_file, s3_path)
78
-
79
- ipa_file_basename = File.basename(ipa_file)
80
- ipa_file_name = "#{url_part}#{ipa_file_basename}"
81
- ipa_file_data = File.open(ipa_file, 'rb')
82
-
83
- ipa_url = self.upload_file(bucket, ipa_file_name, ipa_file_data, acl)
84
-
85
- # Setting action and environment variables
86
- Actions.lane_context[SharedValues::S3_IPA_OUTPUT_PATH] = ipa_url
87
- ENV[SharedValues::S3_IPA_OUTPUT_PATH.to_s] = ipa_url
88
-
89
- if dsym_file
90
- dsym_file_basename = File.basename(dsym_file)
91
- dsym_file_name = "#{url_part}#{dsym_file_basename}"
92
- dsym_file_data = File.open(dsym_file, 'rb')
93
-
94
- dsym_url = self.upload_file(bucket, dsym_file_name, dsym_file_data, acl)
95
-
96
- # Setting action and environment variables
97
- Actions.lane_context[SharedValues::S3_DSYM_OUTPUT_PATH] = dsym_url
98
- ENV[SharedValues::S3_DSYM_OUTPUT_PATH.to_s] = dsym_url
99
-
100
- end
101
-
102
- if params[:upload_metadata] == false
103
- return true
104
- end
105
-
106
- #####################################
107
- #
108
- # html and plist building
109
- #
110
- #####################################
111
-
112
- # Gets info used for the plist
113
- info = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file(ipa_file)
114
-
115
- build_num = info['CFBundleVersion']
116
- bundle_id = info['CFBundleIdentifier']
117
- bundle_version = info['CFBundleShortVersionString']
118
- title = CGI.escapeHTML(info['CFBundleName'])
119
- device_family = info['UIDeviceFamily']
120
- full_version = "#{bundle_version}.#{build_num}"
121
-
122
- # Creating plist and html names
123
- s3_domain = AWS::Core::Endpoints.hostname(s3_region, 's3') || 's3.amazonaws.com'
124
- plist_file_name ||= "#{url_part}#{URI.escape(title)}.plist"
125
- plist_url = URI::HTTPS.build(host: s3_domain, path: "/#{s3_bucket}/#{plist_file_name}").to_s
126
-
127
- html_file_name ||= "index.html"
128
-
129
- version_file_name ||= "version.json"
130
-
131
- # grabs module
132
- eth = Fastlane::ErbTemplateHelper
133
-
134
- # Creates plist from template
135
- if plist_template_path && File.exist?(plist_template_path)
136
- plist_template = eth.load_from_path(plist_template_path)
137
- else
138
- plist_template = eth.load("s3_plist_template")
139
- end
140
- plist_render = eth.render(plist_template, {
141
- url: ipa_url,
142
- ipa_url: ipa_url,
143
- build_num: build_num,
144
- bundle_id: bundle_id,
145
- bundle_version: bundle_version,
146
- title: title
147
- })
148
-
149
- # Creates html from template
150
- if html_template_path && File.exist?(html_template_path)
151
- html_template = eth.load_from_path(html_template_path)
152
- else
153
- html_template = eth.load("s3_html_template")
154
- end
155
-
156
- html_render = eth.render(html_template, {
157
- url: plist_url,
158
- plist_url: plist_url,
159
- ipa_url: ipa_url,
160
- build_num: build_num,
161
- bundle_id: bundle_id,
162
- bundle_version: bundle_version,
163
- title: title,
164
- device_family: device_family
165
- })
166
-
167
- # Creates version from template
168
- if version_template_path && File.exist?(version_template_path)
169
- version_template = eth.load_from_path(version_template_path)
170
- else
171
- version_template = eth.load("s3_version_template")
172
- end
173
- version_render = eth.render(version_template, {
174
- url: plist_url,
175
- plist_url: plist_url,
176
- ipa_url: ipa_url,
177
- build_num: build_num,
178
- bundle_version: bundle_version,
179
- full_version: full_version
180
- })
181
-
182
- #####################################
183
- #
184
- # html and plist uploading
185
- #
186
- #####################################
187
-
188
- plist_url = self.upload_file(bucket, plist_file_name, plist_render, acl)
189
- html_url = self.upload_file(bucket, html_file_name, html_render, acl)
190
- version_url = self.upload_file(bucket, version_file_name, version_render, acl)
191
-
192
- # Setting action and environment variables
193
- Actions.lane_context[SharedValues::S3_PLIST_OUTPUT_PATH] = plist_url
194
- ENV[SharedValues::S3_PLIST_OUTPUT_PATH.to_s] = plist_url
195
-
196
- Actions.lane_context[SharedValues::S3_HTML_OUTPUT_PATH] = html_url
197
- ENV[SharedValues::S3_HTML_OUTPUT_PATH.to_s] = html_url
198
-
199
- Actions.lane_context[SharedValues::S3_VERSION_OUTPUT_PATH] = version_url
200
- ENV[SharedValues::S3_VERSION_OUTPUT_PATH.to_s] = version_url
201
-
202
- UI.success("Successfully uploaded ipa file to '#{Actions.lane_context[SharedValues::S3_IPA_OUTPUT_PATH]}'")
203
-
204
- return true
205
- end
206
-
207
- # @return true if loading the AWS SDK from the 'aws-sdk' gem yields the expected v1 API, or false otherwise
208
- def self.load_from_original_gem_name
209
- begin
210
- # We don't use `Actions.verify_gem!` here, because we want to silently be OK with this gem not being
211
- # present, in case the user has already migrated to 'aws-sdk-v1' (see #load_from_v1_gem_name)
212
- Gem::Specification.find_by_name('aws-sdk')
213
- require 'aws-sdk'
214
- rescue Gem::LoadError
215
- UI.verbose("The 'aws-sdk' gem is not present")
216
- return false
217
- end
218
-
219
- UI.verbose("The 'aws-sdk' gem is present")
220
- true
221
- end
222
-
223
- def self.load_from_v1_gem_name
224
- Actions.verify_gem!('aws-sdk-v1')
225
- require 'aws-sdk-v1'
226
- end
227
-
228
- def self.v1_sdk_module_present?
229
- begin
230
- # Here we'll make sure that the `AWS` module is defined. If it is, the gem is the v1.x API.
231
- Object.const_get("AWS")
232
- rescue NameError
233
- UI.verbose("Couldn't find the needed `AWS` module in the 'aws-sdk' gem")
234
- return false
235
- end
236
-
237
- UI.verbose("Found the needed `AWS` module in the 'aws-sdk' gem")
238
- true
239
- end
240
-
241
- def self.s3_client(s3_access_key, s3_secret_access_key, s3_region)
242
- # The AWS SDK API changed completely in v2.x. The most stable way to keep using the V1 API is to
243
- # require the 'aws-sdk-v1' gem directly. However, for those customers who are using the 'aws-sdk'
244
- # gem at v1.x, we don't want to break their setup which currently works.
245
- #
246
- # Therefore, we will attempt to load the v1 API from the original gem name, but go on to load
247
- # from the aws-sdk-v1 gem name if necessary
248
- loaded_original_gem = load_from_original_gem_name
249
-
250
- if !loaded_original_gem || !v1_sdk_module_present?
251
- load_from_v1_gem_name
252
- UI.verbose("Loaded AWS SDK v1.x from the `aws-sdk-v1` gem")
253
- else
254
- UI.verbose("Loaded AWS SDK v1.x from the `aws-sdk` gem")
255
- end
256
-
257
- if s3_region
258
- s3_client = AWS::S3.new(
259
- access_key_id: s3_access_key,
260
- secret_access_key: s3_secret_access_key,
261
- region: s3_region
262
- )
263
- else
264
- s3_client = AWS::S3.new(
265
- access_key_id: s3_access_key,
266
- secret_access_key: s3_secret_access_key
267
- )
268
- end
269
- s3_client
270
- end
271
-
272
- def self.upload_file(bucket, file_name, file_data, acl)
273
- obj = bucket.objects.create(file_name, file_data, acl: acl)
274
-
275
- # When you enable versioning on a S3 bucket,
276
- # writing to an object will create an object version
277
- # instead of replacing the existing object.
278
- # http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/ObjectVersion.html
279
- if obj.kind_of?(AWS::S3::ObjectVersion)
280
- obj = obj.object
281
- end
282
-
283
- # Return public url
284
- obj.public_url.to_s
285
- end
286
-
287
- #
288
- # NOT a fan of this as this was taken straight from Shenzhen
289
- # https://github.com/nomad/shenzhen/blob/986792db5d4d16a80c865a2748ee96ba63644821/lib/shenzhen/plugins/s3.rb#L32
290
- #
291
- # Need to find a way to not use this copied method
292
- #
293
- # AGAIN, I am not happy about this right now.
294
- # Using this for prototype reasons.
295
- #
296
- def self.expand_path_with_substitutions_from_ipa_plist(ipa, path)
297
- substitutions = path.scan(/\{CFBundle[^}]+\}/)
298
- return path if substitutions.empty?
299
- info = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file(ipa) or return path
300
-
301
- substitutions.uniq.each do |substitution|
302
- key = substitution[1...-1]
303
- value = info[key]
304
- path.gsub!(Regexp.new(substitution), value) if value
305
- end
306
-
307
- return path
21
+ UI.user_error!("Please use the `aws_s3` plugin instead. Install using `fastlane add_plugin aws_s3`.")
308
22
  end
309
23
 
310
24
  def self.description
@@ -423,7 +137,7 @@ module Fastlane
423
137
  end
424
138
 
425
139
  def self.is_supported?(platform)
426
- platform == :ios
140
+ false
427
141
  end
428
142
 
429
143
  def self.example_code