fastlane 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -6
- data/lib/assets/FastfileTemplate +1 -5
- data/lib/fastlane/actions/commit_version_bump.rb +23 -9
- data/lib/fastlane/actions/install_carthage +9 -0
- data/lib/fastlane/actions/xcodebuild.rb +19 -14
- data/lib/fastlane/runner.rb +3 -1
- data/lib/fastlane/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64f1a81d7ec4ad739a33b9dba38c780bcc07737c
|
4
|
+
data.tar.gz: a3154316dee6147a0913d14574338719af912b8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 264bfa8c54093d531463cf67e60ca431866acd3ae1b3d20f74424215be314912c3a48e9b0bf019c8d130cf04e07f9f273479aad6335b3af64e2248a2763f9cff
|
7
|
+
data.tar.gz: 3cb2045749cacced43d5644c304010cfcd440adc815df4dca653f20b2f5fe04c2d7eba7fbfa537f182061e2ebaa201ace5ac5c7c82c8ea6fd38d5b99f90635f3
|
data/README.md
CHANGED
@@ -139,6 +139,7 @@ When one command fails, the execution will be aborted.
|
|
139
139
|
|
140
140
|
### Project
|
141
141
|
- [CocoaPods](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#cocoapods): Setup your CocoaPods project
|
142
|
+
- [Carthage](https://github.com/KrauseFx/fastlane/blob/master/Actions.md#carthage): Setup your Carthage project
|
142
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
|
143
144
|
|
144
145
|
### Testing
|
@@ -267,16 +268,17 @@ before_all do |lane|
|
|
267
268
|
cocoapods
|
268
269
|
|
269
270
|
xctool :test
|
271
|
+
end
|
270
272
|
|
271
|
-
|
272
|
-
|
273
|
-
})
|
273
|
+
lane :test do
|
274
|
+
snapshot
|
274
275
|
end
|
275
276
|
|
276
277
|
lane :beta do
|
277
278
|
cert
|
278
|
-
|
279
279
|
sigh :adhoc
|
280
|
+
|
281
|
+
ipa
|
280
282
|
|
281
283
|
deliver :beta
|
282
284
|
|
@@ -288,8 +290,8 @@ end
|
|
288
290
|
|
289
291
|
lane :deploy do
|
290
292
|
cert
|
291
|
-
|
292
293
|
sigh
|
294
|
+
ipa
|
293
295
|
|
294
296
|
snapshot
|
295
297
|
|
@@ -315,7 +317,8 @@ error do |lane, exception|
|
|
315
317
|
reset_git_repo
|
316
318
|
|
317
319
|
slack({
|
318
|
-
message: "An error occured"
|
320
|
+
message: "An error occured",
|
321
|
+
success: false
|
319
322
|
})
|
320
323
|
end
|
321
324
|
```
|
data/lib/assets/FastfileTemplate
CHANGED
@@ -11,25 +11,39 @@ module Fastlane
|
|
11
11
|
params = params.first
|
12
12
|
|
13
13
|
commit_message = (params && params[:message]) || 'Version Bump'
|
14
|
+
xcodeproj_path = (params && params[:xcodeproj]) ? File.expand_path(File.join('.', params[:xcodeproj])) : nil
|
14
15
|
|
15
16
|
# find the repo root path
|
16
17
|
repo_path = `git rev-parse --show-toplevel`.strip
|
18
|
+
repo_pathname = Pathname.new(repo_path)
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
+
if xcodeproj_path
|
21
|
+
# ensure that the xcodeproj passed in was OK
|
22
|
+
raise "Could not find the specified xcodeproj: #{xcodeproj_path}" unless File.directory?(xcodeproj_path)
|
23
|
+
else
|
24
|
+
# find an xcodeproj (ignoring the Cocoapods one)
|
25
|
+
xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))].reject { |path| /Pods\/.*.xcodeproj/ =~ path }
|
20
26
|
|
21
|
-
|
22
|
-
|
23
|
-
|
27
|
+
# no projects found: error
|
28
|
+
raise 'Could not find a .xcodeproj in the current repository\'s working directory.'.red if xcodeproj_paths.count == 0
|
29
|
+
|
30
|
+
# too many projects found: error
|
31
|
+
if xcodeproj_paths.count > 1
|
32
|
+
relative_projects = xcodeproj_paths.map { |e| Pathname.new(e).relative_path_from(repo_pathname).to_s }.join("\n")
|
33
|
+
raise "Found multiple .xcodeproj projects in the current repository's working directory. Please specify your app's main project: \n#{relative_projects}".red
|
34
|
+
end
|
35
|
+
|
36
|
+
# one project found: great
|
37
|
+
xcodeproj_path = xcodeproj_paths.first
|
38
|
+
end
|
24
39
|
|
25
40
|
# find the pbxproj path, relative to git directory
|
26
|
-
git_pathname = Pathname.new(repo_path)
|
27
41
|
pbxproj_pathname = Pathname.new(File.join(xcodeproj_path, 'project.pbxproj'))
|
28
|
-
pbxproj_path = pbxproj_pathname.relative_path_from(
|
42
|
+
pbxproj_path = pbxproj_pathname.relative_path_from(repo_pathname).to_s
|
29
43
|
|
30
44
|
# find the info_plist files
|
31
45
|
project = Xcodeproj::Project.open(xcodeproj_path)
|
32
|
-
info_plist_files = project.objects.select { |object| object.isa == 'XCBuildConfiguration' }.map(&:to_hash).map { |object_hash| object_hash['buildSettings'] }.select { |build_settings| build_settings.
|
46
|
+
info_plist_files = project.objects.select { |object| object.isa == 'XCBuildConfiguration' }.map(&:to_hash).map { |object_hash| object_hash['buildSettings'] }.select { |build_settings| build_settings.key?('INFOPLIST_FILE') }.map { |build_settings| build_settings['INFOPLIST_FILE'] }.uniq.map { |info_plist_path| Pathname.new(File.expand_path(File.join(xcodeproj_path, '..', info_plist_path))).relative_path_from(repo_pathname).to_s }
|
33
47
|
|
34
48
|
# create our list of files that we expect to have changed, they should all be relative to the project root, which should be equal to the git workdir root
|
35
49
|
expected_changed_files = []
|
@@ -48,7 +62,7 @@ module Fastlane
|
|
48
62
|
raise "Found unexpected uncommited changes in the working directory. Expected these files to have changed: #{expected_changed_files}. But found these actual changes: #{git_dirty_files}. Make sure you have cleaned up the build artifacts and are only left with the changed version files at this stage in your lane, and don't touch the working directory while your lane is running.".red unless changed_files_as_expected
|
49
63
|
|
50
64
|
# get the absolute paths to the files
|
51
|
-
git_add_paths = expected_changed_files.map { |path| File.expand_path(File.join(
|
65
|
+
git_add_paths = expected_changed_files.map { |path| File.expand_path(File.join(repo_pathname, path)) }
|
52
66
|
|
53
67
|
# then create a commit with a message
|
54
68
|
Actions.sh("git add #{git_add_paths.map(&:shellescape).join(' ')}")
|
@@ -76,7 +76,10 @@ module Fastlane
|
|
76
76
|
params[:export_format] ||= "ipa"
|
77
77
|
|
78
78
|
# If not passed, construct export path from env vars
|
79
|
-
params[:export_path]
|
79
|
+
if params[:export_path] == nil
|
80
|
+
ipa_filename = scheme ? scheme : File.basename(params[:archive_path], ".*")
|
81
|
+
params[:export_path] = "#{build_path}#{ipa_filename}"
|
82
|
+
end
|
80
83
|
|
81
84
|
# Store IPA path for later deploy steps (i.e. Crashlytics)
|
82
85
|
Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = params[:export_path] + "." + params[:export_format].downcase
|
@@ -113,13 +116,6 @@ module Fastlane
|
|
113
116
|
# Default args
|
114
117
|
xcpretty_args = [ "--color" ]
|
115
118
|
|
116
|
-
# Stdout format
|
117
|
-
if testing && !archiving
|
118
|
-
xcpretty_args.push "--test"
|
119
|
-
else
|
120
|
-
xcpretty_args.push "--simple"
|
121
|
-
end
|
122
|
-
|
123
119
|
if testing
|
124
120
|
# Test report file format
|
125
121
|
if params[:report_formats]
|
@@ -129,21 +125,30 @@ module Fastlane
|
|
129
125
|
|
130
126
|
xcpretty_args.push report_formats
|
131
127
|
|
128
|
+
# Save screenshots flag
|
129
|
+
if params[:report_formats].include?("html") && params[:report_screenshots]
|
130
|
+
xcpretty_args.push "--screenshots"
|
131
|
+
end
|
132
|
+
|
133
|
+
xcpretty_args.sort!
|
134
|
+
|
132
135
|
# Test report file path
|
133
136
|
if params[:report_path]
|
134
137
|
xcpretty_args.push "--output \"#{params[:report_path]}\""
|
135
138
|
elsif build_path
|
136
139
|
xcpretty_args.push "--output \"#{build_path}report\""
|
137
140
|
end
|
138
|
-
|
139
|
-
# Save screenshots flag
|
140
|
-
if params[:report_formats].include?("html") && params[:report_screenshots]
|
141
|
-
xcpretty_args.push "--screenshots"
|
142
|
-
end
|
143
141
|
end
|
144
142
|
end
|
145
143
|
|
146
|
-
|
144
|
+
# Stdout format
|
145
|
+
if testing && !archiving
|
146
|
+
xcpretty_args.push "--test"
|
147
|
+
else
|
148
|
+
xcpretty_args.push "--simple"
|
149
|
+
end
|
150
|
+
|
151
|
+
xcpretty_args = xcpretty_args.join(" ")
|
147
152
|
|
148
153
|
Actions.sh "set -o pipefail && xcodebuild #{xcodebuild_args} | xcpretty #{xcpretty_args}"
|
149
154
|
end
|
data/lib/fastlane/runner.rb
CHANGED
@@ -26,7 +26,9 @@ module Fastlane
|
|
26
26
|
return return_val
|
27
27
|
rescue => ex
|
28
28
|
Dir.chdir(path_to_use) do
|
29
|
-
|
29
|
+
# Provide error block exception without colour code
|
30
|
+
error_ex = ex.exception(ex.message.gsub(/\033\[\d+m/, ''))
|
31
|
+
@error.call(key, error_ex) if @error # notify the block
|
30
32
|
end
|
31
33
|
raise ex
|
32
34
|
end
|
data/lib/fastlane/version.rb
CHANGED
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
|
+
version: 0.4.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-
|
11
|
+
date: 2015-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.3.
|
103
|
+
version: 0.3.3
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.3.
|
110
|
+
version: 0.3.3
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: deliver
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -365,6 +365,7 @@ files:
|
|
365
365
|
- lib/fastlane/actions/hipchat.rb
|
366
366
|
- lib/fastlane/actions/hockey.rb
|
367
367
|
- lib/fastlane/actions/increment_build_number.rb
|
368
|
+
- lib/fastlane/actions/install_carthage
|
368
369
|
- lib/fastlane/actions/install_cocapods.rb
|
369
370
|
- lib/fastlane/actions/ipa.rb
|
370
371
|
- lib/fastlane/actions/notify.rb
|