fastlane 0.4.2 → 0.5.0

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: 505993370266c96c45419084e82b1cf79d52763a
4
- data.tar.gz: 68e73d0633a095558048d354f8765c99beaa54d7
3
+ metadata.gz: 5c747e9fa3dff44e9bd4762c4281f9cee8408b07
4
+ data.tar.gz: 5fcec7383048bacd0bd15513b84bd181240e1de0
5
5
  SHA512:
6
- metadata.gz: 75c8d74249d420c47c6c2b990c1f2bea4c7f1119d1c5e60fd9995df9382ba973a06e277fda877f7d7a25977e3ac7a834866625a6d9f04a0fb672cd4f87affabc
7
- data.tar.gz: 5bcb1536cef97a38eba4cca2e6152fe05ffdb3c790d55a9437e093a20c4179365155e399a3a81232f8ef0015b04a01451ee5f8bd7a670b1f41f13f31e63b8a92
6
+ metadata.gz: 4db176d2e311a47c93084a8a6d290c9e9743581461153738ba5f582a8719364a5df73b050a97d00c891d050060d775eb15499dea4634c9cf1853488865a43153
7
+ data.tar.gz: 4601459d9f086f2cfc811646c28dd73b9fcb9f683a850af6ab5d26b1096523a05c580c815eabe891f19d59617430d7b42f24b3e7489cce2a813f23bf585ae90c
data/README.md CHANGED
@@ -91,11 +91,11 @@ If you want to take a look at a project, already using `fastlane`, check out the
91
91
  # Quick Start
92
92
 
93
93
 
94
- The setup assistent will create all the necessary files for you, using the existing app metadata from iTunes Connect.
94
+ The setup assistant will create all the necessary files for you, using the existing app metadata from iTunes Connect.
95
95
 
96
96
  - ```cd [your_project_folder]```
97
97
  - ```fastlane init```
98
- - Follow the setup assistent, which will set up ```fastlane``` for you
98
+ - Follow the setup assistant, which will set up ```fastlane``` for you
99
99
  - Further customise the ```Fastfile``` using the next section
100
100
 
101
101
  For a more detailed setup, please follow the [fastlane guide](https://github.com/KrauseFx/fastlane/blob/master/GUIDE.md).
@@ -141,9 +141,11 @@ When one command fails, the execution will be aborted.
141
141
  - [CocoaPods](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#cocoapods): Setup your CocoaPods project
142
142
  - [Carthage](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#carthage): Setup your Carthage project
143
143
  - [increment_build_number](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#increment_build_number): Increment the Xcode build number before building the app
144
+ - - [increment_build_number](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#increment_version_number): Increment the Xcode version number before building the app
144
145
 
145
146
  ### Testing
146
147
  - [snapshot](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#snapshot): Automate taking localized screenshots of your iOS app on every device
148
+ - [xctest](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#xcodebuild): Use the built in testing in combination with `xcodebuild`
147
149
  - [xctool](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#xctool): Run tests of your app
148
150
  - [Testmunk](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#testmunk): Run integration tests on real devices
149
151
  - [gcovr](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#gcovr): Generate summarized code coverage reports
@@ -152,6 +154,7 @@ When one command fails, the execution will be aborted.
152
154
  - [cert](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#cert): Automatically create and maintain iOS code signing certificates
153
155
  - [sigh](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#sigh): Create and maintain your provisioning profiles
154
156
  - [resign](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#resign): Re-Sign an existing ipa file
157
+ - [register_devices](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#register_devices): Register iOS device identifiers
155
158
 
156
159
  ### Building
157
160
  - [ipa](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#ipa): Build your app for further use of the [uploading](#uploading) section
@@ -1,7 +1,7 @@
1
1
  app_identifier "[[APP_IDENTIFIER]]" # The bundle identifier of your app
2
2
  apple_id "[[APPLE_ID]]" # Your Apple email address
3
3
 
4
- # You can uncomment the lines below and add your own
4
+ # You can uncomment any of the lines below and add your own
5
5
  # team selection in case you're in multiple teams
6
6
  # team_name "Felix Krause"
7
7
  # team_id "Q2CBPJ58CA"
@@ -5,9 +5,9 @@
5
5
 
6
6
  # All lines starting with a # are ignored when running `fastlane`
7
7
 
8
- # This is the minimum version number required.
8
+ # This is the minimum version number required.
9
9
  # Update this, if you use features of a newer version
10
- fastlane_version "[[FASTLANE_VERSION]]"
10
+ fastlane_version "[[FASTLANE_VERSION]]"
11
11
 
12
12
  before_all do
13
13
  # ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
@@ -59,4 +59,4 @@ end
59
59
 
60
60
  error do |lane, exception|
61
61
  # Something bad happened
62
- end
62
+ end
@@ -20,7 +20,7 @@ module Fastlane
20
20
  is_beta_ipa: beta,
21
21
  skip_deploy: skip_deploy)
22
22
 
23
- Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = ENV['DELIVER_IPA_PATH'] # deliver will store it in the environment
23
+ Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = File.expand_path(ENV['DELIVER_IPA_PATH']) # deliver will store it in the environment
24
24
  end
25
25
  end
26
26
  end
@@ -0,0 +1,98 @@
1
+ module Fastlane
2
+ module Actions
3
+ module SharedValues
4
+ VERSION_NUMBER = :VERSION_NUMBER
5
+ end
6
+
7
+ class IncrementVersionNumberAction
8
+ require 'shellwords'
9
+
10
+ def self.run(params)
11
+ # More information about how to set up your project and how it works:
12
+ # https://developer.apple.com/library/ios/qa/qa1827/_index.html
13
+
14
+ begin
15
+ first_param = (params.first rescue nil)
16
+ folder = '.' #Current folder is the default folder
17
+
18
+ case first_param
19
+ when NilClass
20
+ release_task = 'patch' #Patch is the default action
21
+ when String
22
+ release_task = first_param
23
+ when Hash
24
+ release_task = first_param[:release_task] ? first_param[:release_task] : "patch"
25
+ folder = first_param[:xcodeproj] ? File.join('.', first_param[:xcodeproj], '..') : '.'
26
+ end
27
+
28
+ # Verify integrity
29
+ case release_task
30
+ when /\d.\d.\d/
31
+ specific_version_number = release_task
32
+ release_task = 'specific_version'
33
+ when "patch"
34
+ release_task = 'patch'
35
+ when "minor"
36
+ release_task = 'minor'
37
+ when "major"
38
+ release_task = "major"
39
+ else
40
+ raise 'Invalid parameter #{release_task}'
41
+ end
42
+
43
+ command_prefix = [
44
+ 'cd',
45
+ File.expand_path(folder).shellescape,
46
+ '&&'
47
+ ].join(' ')
48
+
49
+ if Helper.test?
50
+ version_array = [1,0,0]
51
+ else
52
+ current_version= `#{command_prefix} agvtool what-marketing-version -terse1`.split("\n").last
53
+ raise 'Your current version does not respect the format A.B.C' unless current_version.match(/\d.\d.\d/)
54
+ #Check if CFBundleShortVersionString is the same for each occurrence
55
+ allBundles = `#{command_prefix} agvtool what-marketing-version -terse`.split("\n")
56
+ allBundles.each do |bundle|
57
+ raise 'Ensure all you CFBundleShortVersionString are equals in your project ' unless bundle.end_with? "=#{current_version}"
58
+ end
59
+ version_array = current_version.split(".").map(&:to_i)
60
+ end
61
+
62
+ case release_task
63
+ when "patch"
64
+ version_array[2] = version_array[2]+1
65
+ next_version_number = version_array.join(".")
66
+ when "minor"
67
+ version_array[1] = version_array[1]+1
68
+ version_array[2] = version_array[2]=0
69
+ next_version_number = version_array.join(".")
70
+ when "major"
71
+ version_array[0] = version_array[0]+1
72
+ version_array[1] = version_array[1]=0
73
+ version_array[1] = version_array[2]=0
74
+ next_version_number = version_array.join(".")
75
+ when "specific_version"
76
+ next_version_number = specific_version_number
77
+ end
78
+
79
+ command = [
80
+ command_prefix,
81
+ "agvtool new-marketing-version #{next_version_number}"
82
+ ].join(' ')
83
+
84
+ if Helper.test?
85
+ Actions.lane_context[SharedValues::VERSION_NUMBER] = command
86
+ else
87
+ Actions.sh command
88
+ Actions.lane_context[SharedValues::VERSION_NUMBER] = next_version_number
89
+ end
90
+
91
+ rescue => ex
92
+ Helper.log.error 'Make sure to to follow the steps to setup your Xcode project: https://developer.apple.com/library/ios/qa/qa1827/_index.html'.yellow
93
+ raise ex
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -31,7 +31,8 @@ module Fastlane
31
31
  identity: '-i',
32
32
  sdk: '--sdk',
33
33
  ipa: '--ipa',
34
- verbose: '--verbose'
34
+ verbose: '--verbose',
35
+ xcargs: '--xcargs',
35
36
  }
36
37
 
37
38
  class IpaAction
@@ -7,8 +7,8 @@ module Fastlane
7
7
 
8
8
  remote = (options && options[:remote]) || 'origin'
9
9
  force = (options && options[:force]) || false
10
- local_branch = (options && options[:branch]) || 'master'
11
- remote_branch = (options && options[:branch]) || local_branch
10
+ local_branch = (options && (options[:local_branch] || options[:branch])) || 'master'
11
+ remote_branch = (options && options[:remote_branch]) || local_branch
12
12
 
13
13
  # construct our command as an array of components
14
14
  command = [
@@ -0,0 +1,63 @@
1
+ module Fastlane
2
+ module Actions
3
+ class RegisterDevicesAction
4
+ UDID_REGEXP = /^\h{40}$/
5
+
6
+ def self.run(params)
7
+ require 'cupertino/provisioning_portal'
8
+ require 'credentials_manager'
9
+ require 'csv'
10
+
11
+ params = params.first
12
+
13
+ raise 'You must pass valid params to the register_devices action. Please check the readme.'.red if (params.nil? || params.empty?)
14
+
15
+ devices = params[:devices]
16
+ devices_file = params[:devices_file]
17
+ team_id = params[:team_id] || ENV['CUPERTINO_TEAM_ID'] || ENV['FASTLANE_TEAM_ID']
18
+ username = params[:username] || ENV['CUPERTINO_USERNAME']
19
+
20
+ if devices
21
+ device_objs = devices.map do |k, v|
22
+ raise "Passed invalid UDID: #{v} for device: #{k}".red unless UDID_REGEXP =~ v
23
+
24
+ Cupertino::ProvisioningPortal::Device.new(k, v)
25
+ end
26
+ elsif devices_file
27
+ devices_file = CSV.read(File.expand_path(File.join(devices_file)), col_sep: "\t")
28
+
29
+ raise 'Please provide a file according to the Apple Sample UDID file (https://devimages.apple.com.edgekey.net/downloads/devices/Multiple-Upload-Samples.zip)'.red unless devices_file.first == ['Device ID', 'Device Name']
30
+
31
+ device_objs = devices_file.drop(1).map do |device|
32
+ raise 'Invalid device line, please provide a file according to the Apple Sample UDID file (https://devimages.apple.com.edgekey.net/downloads/devices/Multiple-Upload-Samples.zip)'.red unless device.count == 2
33
+ raise "Passed invalid UDID: #{device[0]} for device: #{device[1]}".red unless UDID_REGEXP =~ device[0]
34
+
35
+ Cupertino::ProvisioningPortal::Device.new(device[1], device[0])
36
+ end
37
+ else
38
+ raise 'You must pass either a valid `devices` or `devices_file`. Please check the readme.'.red
39
+ end
40
+
41
+ credentials = CredentialsManager::PasswordManager.shared_manager(username)
42
+
43
+ agent = Cupertino::ProvisioningPortal::Agent.new
44
+ agent.username = credentials.username
45
+ agent.password = credentials.password
46
+ agent.team_id = team_id if team_id
47
+
48
+ Helper.log.info "Fetching list of currently registered devices..."
49
+ existing_devices = agent.list_devices
50
+ new_devices = device_objs.select{ |device| !existing_devices.map(&:udid).include?(device.udid) } # calculate the diff based on the UDID
51
+
52
+ if new_devices.count > 0
53
+ Helper.log.info "Adding new devices..."
54
+ agent.add_devices(*new_devices) rescue raise 'Could not add devices. Please ensure you have passed the correct username/password combination, as well as a valid team_id if a member of multiple teams.'.red
55
+
56
+ Helper.log.info "Successfully registered #{new_devices.count} new devices. Total devices now registered: #{existing_devices.count + new_devices.count}!".green
57
+ else
58
+ Helper.log.info "Device list up to date, all #{device_objs.count} devices are already registered. Total devices registed: #{existing_devices.count}.".green
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -10,7 +10,7 @@ module Fastlane
10
10
 
11
11
  Helper.log.info "Setting Team ID to '#{team}' for all build steps"
12
12
 
13
- [:CERT_TEAM_ID, :SIGH_TEAM_ID, :PEM_TEAM_ID, :PRODUCE_TEAM_ID, :SIGH_TEAM_ID, :FASTLANE_TEAM_ID].each do |current|
13
+ [:CERT_TEAM_ID, :SIGH_TEAM_ID, :PEM_TEAM_ID, :PRODUCE_TEAM_ID, :SIGH_TEAM_ID, :CUPERTINO_TEAM_ID, :FASTLANE_TEAM_ID].each do |current|
14
14
  ENV[current.to_s] = team
15
15
  end
16
16
  end
@@ -5,6 +5,7 @@ module Fastlane
5
5
  key = key.to_sym
6
6
  Helper.log.info "Driving the lane '#{key}'".green
7
7
  Actions.lane_context[Actions::SharedValues::LANE_NAME] = key
8
+ ENV["FASTLANE_LANE_NAME"] = key.to_s
8
9
 
9
10
  return_val = nil
10
11
 
@@ -1,3 +1,3 @@
1
1
  module Fastlane
2
- VERSION = '0.4.2'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -94,20 +94,40 @@ dependencies:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: cupertino
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: '1.3'
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: 1.3.1
107
+ type: :runtime
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ~>
112
+ - !ruby/object:Gem::Version
113
+ version: '1.3'
114
+ - - '>='
115
+ - !ruby/object:Gem::Version
116
+ version: 1.3.1
97
117
  - !ruby/object:Gem::Dependency
98
118
  name: fastlane_core
99
119
  requirement: !ruby/object:Gem::Requirement
100
120
  requirements:
101
121
  - - '>='
102
122
  - !ruby/object:Gem::Version
103
- version: 0.3.4
123
+ version: 0.4.0
104
124
  type: :runtime
105
125
  prerelease: false
106
126
  version_requirements: !ruby/object:Gem::Requirement
107
127
  requirements:
108
128
  - - '>='
109
129
  - !ruby/object:Gem::Version
110
- version: 0.3.4
130
+ version: 0.4.0
111
131
  - !ruby/object:Gem::Dependency
112
132
  name: deliver
113
133
  requirement: !ruby/object:Gem::Requirement
@@ -365,12 +385,14 @@ files:
365
385
  - lib/fastlane/actions/hipchat.rb
366
386
  - lib/fastlane/actions/hockey.rb
367
387
  - lib/fastlane/actions/increment_build_number.rb
388
+ - lib/fastlane/actions/increment_version_number.rb
368
389
  - lib/fastlane/actions/install_carthage.rb
369
390
  - lib/fastlane/actions/install_cocapods.rb
370
391
  - lib/fastlane/actions/ipa.rb
371
392
  - lib/fastlane/actions/notify.rb
372
393
  - lib/fastlane/actions/produce.rb
373
394
  - lib/fastlane/actions/push_to_git_remote.rb
395
+ - lib/fastlane/actions/register_devices.rb
374
396
  - lib/fastlane/actions/reset_git_repo.rb
375
397
  - lib/fastlane/actions/resign.rb
376
398
  - lib/fastlane/actions/s3.rb