fastlane 2.113.0.beta.20190106200016 → 2.113.0.beta.20190107200010

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da0e6d3a5c97091d457f08661741c9a74a8c8f93
4
- data.tar.gz: 59ff42e528e23f9aa8dff16d83c57caeccb8eb40
3
+ metadata.gz: 7665d827137b7e8e3d6bd005d4aeff2ad0f6aedb
4
+ data.tar.gz: fd27910f274d5f117192a4a5ca155ce31f6ddfc0
5
5
  SHA512:
6
- metadata.gz: 93fb6ef45d09316a0e3fcb3eff0b3bd59438156fb9947c2381a0a487c0e4e0ebb1065cbfb0d4114626b56187b0aadeb34e055600c280c6c7654b2c8a5b4ba445
7
- data.tar.gz: 439e2f8b3d3e338263b82335d7047dc5bcf5ae2eb3e1557a04f3a6ecc290c99099095e03bb5f3940349cf0e22a986efa00ed8f3159f4d3e767f8e3af47a41530
6
+ metadata.gz: 0013e9a12fc558d42c01c78cc353a2fc4e785033e15b12ab24ea680a6fb447db2889ad0de76fdd221be87e1ecb37f145c258fa5512267042fbbea8fbd0a3d51a
7
+ data.tar.gz: a895cf3d66c35033f18e016edf46caaf3f3c8b4175fed05471a5f35250bf71166e3ff303ff0d9e82c69f400164839de3473350fa20ad2627e1e3f67646b260e8
@@ -35,9 +35,8 @@ module Fastlane
35
35
  # ensure that the xcodeproj passed in was OK
36
36
  UI.user_error!("Could not find the specified xcodeproj: #{xcodeproj_path}") unless File.directory?(xcodeproj_path)
37
37
  else
38
- all_xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))]
39
- # find an xcodeproj (ignoring the Cocoapods one)
40
- xcodeproj_paths = Fastlane::Actions.ignore_cocoapods_path(all_xcodeproj_paths)
38
+ # find an xcodeproj (ignoring dependencies)
39
+ xcodeproj_paths = Fastlane::Helper::XcodeprojHelper.find(repo_path)
41
40
 
42
41
  # no projects found: error
43
42
  UI.user_error!('Could not find a .xcodeproj in the current repository\'s working directory.') if xcodeproj_paths.count == 0
@@ -33,11 +33,33 @@ module Fastlane
33
33
  html_url = json['html_url']
34
34
  UI.success("Successfully created pull request ##{number}. You can see it at '#{html_url}'")
35
35
 
36
+ # Add labels to pull request
37
+ add_labels(params, number) if params[:labels]
38
+
36
39
  Actions.lane_context[SharedValues::CREATE_PULL_REQUEST_HTML_URL] = html_url
37
40
  return html_url
38
41
  end
39
42
  end
40
43
 
44
+ def self.add_labels(params, number)
45
+ payload = {
46
+ 'labels' => params[:labels]
47
+ }
48
+ GithubApiAction.run(
49
+ server_url: params[:api_url],
50
+ api_token: params[:api_token],
51
+ http_method: 'PATCH',
52
+ path: "repos/#{params[:repo]}/issues/#{number}",
53
+ body: payload,
54
+ error_handlers: {
55
+ '*' => proc do |result|
56
+ UI.error("GitHub responded with #{result[:status]}: #{result[:body]}")
57
+ return nil
58
+ end
59
+ }
60
+ )
61
+ end
62
+
41
63
  #####################################################
42
64
  # @!group Documentation
43
65
  #####################################################
@@ -72,6 +94,11 @@ module Fastlane
72
94
  description: "The contents of the pull request",
73
95
  is_string: true,
74
96
  optional: true),
97
+ FastlaneCore::ConfigItem.new(key: :labels,
98
+ env_name: "GITHUB_PULL_REQUEST_LABELS",
99
+ description: "The labels for the pull request",
100
+ type: Array,
101
+ optional: true),
75
102
  FastlaneCore::ConfigItem.new(key: :head,
76
103
  env_name: "GITHUB_PULL_REQUEST_HEAD",
77
104
  description: "The name of the branch where your changes are implemented (defaults to the current branch name)",
@@ -24,9 +24,8 @@ module Fastlane
24
24
  UI.user_error!("Could not find the specified xcodeproj: #{xcodeproj_path}") unless File.directory?(xcodeproj_path)
25
25
  end
26
26
  else
27
- all_xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))]
28
- # find an xcodeproj (ignoring the Cocoapods one)
29
- xcodeproj_paths = Fastlane::Actions.ignore_cocoapods_path(all_xcodeproj_paths)
27
+ # find an xcodeproj (ignoring dependencies)
28
+ xcodeproj_paths = Fastlane::Helper::XcodeprojHelper.find(repo_path)
30
29
 
31
30
  # no projects found: error
32
31
  UI.user_error!('Could not find a .xcodeproj in the current repository\'s working directory.') if xcodeproj_paths.count == 0
@@ -0,0 +1,12 @@
1
+ module Fastlane
2
+ module Helper
3
+ class XcodeprojHelper
4
+ DEPENDENCY_MANAGER_DIRS = ['Pods', 'Carthage'].freeze
5
+
6
+ def self.find(dir)
7
+ xcodeproj_paths = Dir[File.expand_path(File.join(dir, '**/*.xcodeproj'))]
8
+ xcodeproj_paths.reject { |path| %r{/(#{DEPENDENCY_MANAGER_DIRS.join('|')})/.*.xcodeproj} =~ path }
9
+ end
10
+ end
11
+ end
12
+ end
@@ -129,6 +129,7 @@ AllCops:
129
129
  - "**/lib/assets/custom_action_template.rb"
130
130
  - "./vendor/**/*"
131
131
  - "**/lib/assets/DefaultFastfileTemplate"
132
+ - "**/lib/assets/MatchfileTemplate"
132
133
  - "**/spec/fixtures/broken_files/broken_file.rb"
133
134
  Style/FileName:
134
135
  Exclude:
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.113.0.beta.20190106200016'.freeze
2
+ VERSION = '2.113.0.beta.20190107200010'.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
@@ -1,4 +1,4 @@
1
- git_url("[[GIT_URL]]")
1
+ [[CONTENT]]
2
2
 
3
3
  type("development") # The default type, can be: appstore, adhoc, enterprise or development
4
4
 
@@ -7,3 +7,5 @@ type("development") # The default type, can be: appstore, adhoc, enterprise or d
7
7
 
8
8
  # For all available options run `fastlane match --help`
9
9
  # Remove the # in the beginning of the line to enable the other options
10
+
11
+ # The docs are available on https://docs.fastlane.tools/actions/match
@@ -1,4 +1,5 @@
1
1
  require_relative 'module'
2
+ require_relative 'storage'
2
3
 
3
4
  module Match
4
5
  class Setup
@@ -9,11 +10,20 @@ module Match
9
10
  template = File.read("#{Match::ROOT}/lib/assets/MatchfileTemplate")
10
11
  end
11
12
 
12
- UI.important("Please create a new, private git repository")
13
- UI.important("to store the certificates and profiles there")
14
- url = UI.input("URL of the Git Repo: ")
13
+ storage_mode = UI.select(
14
+ "fastlane match supports multiple storage modes, please select the one you want to use:",
15
+ self.storage_options
16
+ )
17
+
18
+ storage = Storage.for_mode(storage_mode, {})
19
+
20
+ specific_content = storage.generate_matchfile_content
21
+ UI.crash!("Looks like `generate_matchfile_content` was `nil` for `#{storage_mode}`") if specific_content.nil?
22
+ specific_content += "\n\n" if specific_content.length > 0
23
+ specific_content += "storage_mode(\"#{storage_mode}\")"
24
+
25
+ template.gsub!("[[CONTENT]]", specific_content)
15
26
 
16
- template.gsub!("[[GIT_URL]]", url)
17
27
  File.write(path, template)
18
28
  UI.success("Successfully created '#{path}'. You can open the file using a code editor.")
19
29
 
@@ -22,5 +32,9 @@ module Match
22
32
  UI.message("certificates for you. From then on, it will automatically import the existing profiles.")
23
33
  UI.message("For more information visit https://docs.fastlane.tools/actions/match/")
24
34
  end
35
+
36
+ def storage_options
37
+ return ["git", "google_cloud"]
38
+ end
25
39
  end
26
40
  end
@@ -125,6 +125,13 @@ module Match
125
125
  ].join(" ")
126
126
  end
127
127
 
128
+ def generate_matchfile_content
129
+ UI.important("Please create a new, private git repository to store the certificates and profiles there")
130
+ url = UI.input("URL of the Git Repo: ")
131
+
132
+ return "git_url(\"#{url}\")"
133
+ end
134
+
128
135
  private
129
136
 
130
137
  # Create and checkout an specific branch in the git repo
@@ -127,6 +127,10 @@ module Match
127
127
  false
128
128
  end
129
129
 
130
+ def generate_matchfile_content
131
+ return "bucket_name(\"#{self.bucket_name}\")"
132
+ end
133
+
130
134
  private
131
135
 
132
136
  def bucket
@@ -90,6 +90,13 @@ module Match
90
90
  not_implemented(__method__)
91
91
  end
92
92
 
93
+ # Implement this for the `fastlane match init` command
94
+ # This method must return the content of the Matchfile
95
+ # that should be generated
96
+ def generate_matchfile_content(template: nil)
97
+ not_implemented(__method__)
98
+ end
99
+
93
100
  # Call this method to reset any changes made locally to the files
94
101
  def clear_changes
95
102
  return unless @working_directory
@@ -40,7 +40,7 @@ module Spaceship
40
40
  # @param video_path (String) the path to the video file
41
41
  # @param timestamp (String) the `ffmpeg` timestamp format (e.g. 00.00)
42
42
  # @param dimensions (Array) the dimension of the screenshot to generate
43
- # @return the path to the TempFile containing the generated screenshot
43
+ # @return the TempFile containing the generated screenshot
44
44
  def grab_video_preview(video_path, timestamp, dimensions)
45
45
  width, height = dimensions
46
46
  require 'tempfile'
@@ -50,7 +50,7 @@ module Spaceship
50
50
  # puts "COMMAND: #{command}"
51
51
  `#{command}`
52
52
  raise "Failed to grab screenshot at #{timestamp} from #{video_path} (using #{command})" unless $CHILD_STATUS.to_i == 0
53
- tmp.path
53
+ tmp
54
54
  end
55
55
 
56
56
  # identifies the resolution of a video using `ffmpeg`
@@ -567,7 +567,10 @@ module Spaceship
567
567
  else
568
568
  # IDEA: optimization, we could avoid fetching the screenshot if the timestamp hasn't changed
569
569
  video_preview_resolution = video_preview_resolution_for(device, trailer_path)
570
- video_preview_path = Utilities.grab_video_preview(trailer_path, timestamp, video_preview_resolution)
570
+
571
+ # Keep a reference of the video_preview here to avoid Ruby getting rid of the Tempfile in the meanwhile
572
+ video_preview = Utilities.grab_video_preview(trailer_path, timestamp, video_preview_resolution)
573
+ video_preview_path = video_preview.path
571
574
  end
572
575
  video_preview_file = UploadFile.from_path(video_preview_path)
573
576
  video_preview_data = client.upload_trailer_preview(self, video_preview_file, device)
@@ -377,6 +377,10 @@ module Spaceship
377
377
 
378
378
  r = request(:get, rating_url)
379
379
  all_reviews.concat(parse_response(r, 'data')['reviews'])
380
+
381
+ # The following lines throw errors when there are no reviews so exit out of the loop before them if the app has no reviews
382
+ break if all_reviews.count == 0
383
+
380
384
  last_review_date = Time.at(all_reviews[-1]['value']['lastModified'] / 1000)
381
385
 
382
386
  if upto_date && last_review_date < upto_date
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.113.0.beta.20190106200016
4
+ version: 2.113.0.beta.20190107200010
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danielle Tomlinson
@@ -27,7 +27,7 @@ authors:
27
27
  autorequire:
28
28
  bindir: bin
29
29
  cert_chain: []
30
- date: 2019-01-06 00:00:00.000000000 Z
30
+ date: 2019-01-07 00:00:00.000000000 Z
31
31
  dependencies:
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: slack-notifier
@@ -546,7 +546,7 @@ dependencies:
546
546
  version: 1.12.0
547
547
  - - "<"
548
548
  - !ruby/object:Gem::Version
549
- version: 2.0.0
549
+ version: 3.0.0
550
550
  type: :runtime
551
551
  prerelease: false
552
552
  version_requirements: !ruby/object:Gem::Requirement
@@ -556,7 +556,7 @@ dependencies:
556
556
  version: 1.12.0
557
557
  - - "<"
558
558
  - !ruby/object:Gem::Version
559
- version: 2.0.0
559
+ version: 3.0.0
560
560
  - !ruby/object:Gem::Dependency
561
561
  name: faraday
562
562
  requirement: !ruby/object:Gem::Requirement
@@ -1206,7 +1206,6 @@ files:
1206
1206
  - fastlane/lib/fastlane/features.rb
1207
1207
  - fastlane/lib/fastlane/helper/README.md
1208
1208
  - fastlane/lib/fastlane/helper/adb_helper.rb
1209
- - fastlane/lib/fastlane/helper/cocoapod_helper.rb
1210
1209
  - fastlane/lib/fastlane/helper/crashlytics_helper.rb
1211
1210
  - fastlane/lib/fastlane/helper/dotenv_helper.rb
1212
1211
  - fastlane/lib/fastlane/helper/gem_helper.rb
@@ -1214,6 +1213,7 @@ files:
1214
1213
  - fastlane/lib/fastlane/helper/gradle_helper.rb
1215
1214
  - fastlane/lib/fastlane/helper/podspec_helper.rb
1216
1215
  - fastlane/lib/fastlane/helper/sh_helper.rb
1216
+ - fastlane/lib/fastlane/helper/xcodeproj_helper.rb
1217
1217
  - fastlane/lib/fastlane/helper/xcversion_helper.rb
1218
1218
  - fastlane/lib/fastlane/junit_generator.rb
1219
1219
  - fastlane/lib/fastlane/lane.rb
@@ -1682,24 +1682,24 @@ metadata:
1682
1682
  post_install_message:
1683
1683
  rdoc_options: []
1684
1684
  require_paths:
1685
+ - frameit/lib
1686
+ - spaceship/lib
1685
1687
  - precheck/lib
1688
+ - gym/lib
1689
+ - supply/lib
1690
+ - match/lib
1686
1691
  - scan/lib
1692
+ - fastlane_core/lib
1693
+ - cert/lib
1687
1694
  - deliver/lib
1688
- - screengrab/lib
1689
- - supply/lib
1690
- - frameit/lib
1691
- - sigh/lib
1692
- - gym/lib
1693
- - snapshot/lib
1694
1695
  - produce/lib
1696
+ - snapshot/lib
1697
+ - screengrab/lib
1695
1698
  - fastlane/lib
1696
1699
  - credentials_manager/lib
1697
- - spaceship/lib
1698
- - match/lib
1699
- - pilot/lib
1700
1700
  - pem/lib
1701
- - fastlane_core/lib
1702
- - cert/lib
1701
+ - pilot/lib
1702
+ - sigh/lib
1703
1703
  required_ruby_version: !ruby/object:Gem::Requirement
1704
1704
  requirements:
1705
1705
  - - ">="
@@ -1,7 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- def self.ignore_cocoapods_path(all_xcodeproj_paths)
4
- all_xcodeproj_paths.reject { |path| %r{/Pods/.*.xcodeproj} =~ path }
5
- end
6
- end
7
- end