fastlane 1.92.0.beta2 → 1.92.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 +0 -2
- data/lib/fastlane.rb +0 -1
- data/lib/fastlane/action_collector.rb +2 -34
- data/lib/fastlane/actions/actions_helper.rb +0 -4
- data/lib/fastlane/actions/appium.rb +1 -1
- data/lib/fastlane/actions/changelog_from_git_commits.rb +4 -0
- data/lib/fastlane/actions/copy_artifacts.rb +26 -14
- data/lib/fastlane/actions/gradle.rb +1 -1
- data/lib/fastlane/actions/increment_build_number.rb +1 -1
- data/lib/fastlane/actions/increment_version_number.rb +1 -1
- data/lib/fastlane/actions/jira.rb +1 -1
- data/lib/fastlane/actions/onesignal.rb +1 -1
- data/lib/fastlane/actions/pod_lib_lint.rb +22 -1
- data/lib/fastlane/actions/push_to_git_remote.rb +1 -1
- data/lib/fastlane/actions/slather.rb +49 -21
- data/lib/fastlane/actions/upload_symbols_to_sentry.rb +1 -0
- data/lib/fastlane/actions/xcake.rb +35 -0
- data/lib/fastlane/commands_generator.rb +11 -62
- data/lib/fastlane/lane_manager.rb +2 -6
- data/lib/fastlane/one_off.rb +1 -7
- data/lib/fastlane/runner.rb +12 -34
- data/lib/fastlane/version.rb +1 -1
- metadata +32 -83
- data/lib/assets/Plugins.md.erb +0 -8
- data/lib/fastlane/plugins/plugin_fetcher.rb +0 -59
- data/lib/fastlane/plugins/plugin_generator.rb +0 -109
- data/lib/fastlane/plugins/plugin_generator_ui.rb +0 -19
- data/lib/fastlane/plugins/plugin_info.rb +0 -47
- data/lib/fastlane/plugins/plugin_info_collector.rb +0 -120
- data/lib/fastlane/plugins/plugin_manager.rb +0 -333
- data/lib/fastlane/plugins/plugin_search.rb +0 -46
- data/lib/fastlane/plugins/plugins.rb +0 -7
- data/lib/fastlane/plugins/templates/Gemfile.erb +0 -3
- data/lib/fastlane/plugins/templates/LICENSE.erb +0 -21
- data/lib/fastlane/plugins/templates/README.md.erb +0 -31
- data/lib/fastlane/plugins/templates/Rakefile.erb +0 -1
- data/lib/fastlane/plugins/templates/action.rb.erb +0 -35
- data/lib/fastlane/plugins/templates/action_spec.rb.erb +0 -9
- data/lib/fastlane/plugins/templates/assets/fastlane_logo.png +0 -0
- data/lib/fastlane/plugins/templates/assets/plugin-badge.svg +0 -1
- data/lib/fastlane/plugins/templates/dot_gitignore.erb +0 -8
- data/lib/fastlane/plugins/templates/dot_rspec.erb +0 -3
- data/lib/fastlane/plugins/templates/helper.rb.erb +0 -12
- data/lib/fastlane/plugins/templates/plugin.gemspec.erb +0 -26
- data/lib/fastlane/plugins/templates/plugin.rb.erb +0 -16
- data/lib/fastlane/plugins/templates/spec_helper.rb.erb +0 -8
- data/lib/fastlane/plugins/templates/version.rb.erb +0 -5
@@ -44,14 +44,10 @@ module Fastlane
|
|
44
44
|
e = nil
|
45
45
|
begin
|
46
46
|
ff.runner.execute(lane, platform, parameters)
|
47
|
-
rescue
|
48
|
-
# We also catch Exception, since the implemented action might send a SystemExit signal
|
49
|
-
# (or similar). We still want to catch that, since we want properly finish running fastlane
|
50
|
-
# Tested with `xcake`, which throws a `Xcake::Informative` object
|
51
|
-
|
47
|
+
rescue => ex
|
52
48
|
UI.important 'Variable Dump:'.yellow
|
53
49
|
UI.message Actions.lane_context
|
54
|
-
UI.error ex.to_s
|
50
|
+
UI.error ex.to_s
|
55
51
|
e = ex
|
56
52
|
end
|
57
53
|
|
data/lib/fastlane/one_off.rb
CHANGED
@@ -29,13 +29,7 @@ module Fastlane
|
|
29
29
|
begin
|
30
30
|
class_ref = Fastlane::Actions.const_get(class_name)
|
31
31
|
rescue NameError
|
32
|
-
|
33
|
-
# This was a formerly bundled action which is now a plugin.
|
34
|
-
UI.verbose(caller.join("\n"))
|
35
|
-
UI.user_error!("The action '#{action}' is no longer bundled with fastlane. You can install it using `fastlane add_plugin #{action}`")
|
36
|
-
else
|
37
|
-
UI.user_error!("Action '#{action}' not available, run `fastlane actions` to get a full list")
|
38
|
-
end
|
32
|
+
UI.user_error!("Action '#{action}' not available, run `fastlane actions` to get a full list")
|
39
33
|
end
|
40
34
|
|
41
35
|
r = Runner.new
|
data/lib/fastlane/runner.rb
CHANGED
@@ -96,38 +96,19 @@ module Fastlane
|
|
96
96
|
begin
|
97
97
|
class_ref = Fastlane::Actions.const_get(class_name)
|
98
98
|
rescue NameError
|
99
|
+
# Action not found
|
100
|
+
# Is there a lane under this name?
|
101
|
+
return self.try_switch_to_lane(method_sym, arguments)
|
99
102
|
end
|
100
103
|
|
101
104
|
# It's important to *not* have this code inside the rescue block
|
102
|
-
# otherwise all NameErrors will be
|
105
|
+
# otherwise all NameErrors will be caugth and the error message is
|
103
106
|
# confusing
|
104
|
-
if class_ref
|
105
|
-
|
106
|
-
|
107
|
-
return self.execute_action(method_sym, class_ref, arguments, custom_dir: custom_dir)
|
108
|
-
else
|
109
|
-
UI.user_error!("Action '#{method_sym}' of class '#{class_name}' was found, but has no `run` method.")
|
110
|
-
end
|
107
|
+
if class_ref && class_ref.respond_to?(:run)
|
108
|
+
# Action is available, now execute it
|
109
|
+
return self.execute_action(method_sym, class_ref, arguments, custom_dir: custom_dir)
|
111
110
|
else
|
112
|
-
#
|
113
|
-
# Is there a lane under this name?
|
114
|
-
begin
|
115
|
-
return self.try_switch_to_lane(method_sym, arguments)
|
116
|
-
rescue LaneNotAvailableError
|
117
|
-
# No lane, no action, let's at least show the correct error message
|
118
|
-
if PluginManager.new.plugin_is_added_as_dependency?(PluginManager.plugin_prefix + method_sym.to_s)
|
119
|
-
# That's a plugin, but for some reason we can't find it
|
120
|
-
UI.user_error!("Plugin '#{method_sym}' was not properly loaded, make sure to follow the plugin docs for troubleshooting: #{PluginManager::TROUBLESHOOTING_URL}")
|
121
|
-
elsif Fastlane::Actions.formerly_bundled_actions.include?(method_str)
|
122
|
-
# This was a formerly bundled action which is now a plugin.
|
123
|
-
UI.verbose(caller.join("\n"))
|
124
|
-
UI.user_error!("The action '#{method_sym}' is no longer bundled with fastlane. You can install it using `fastlane add_plugin #{method_sym}`")
|
125
|
-
else
|
126
|
-
# So there is no plugin under that name, so just show the error message generated by the lane switch
|
127
|
-
UI.verbose(caller.join("\n"))
|
128
|
-
UI.user_error!("Could not find action or lane '#{method_sym}'. Check out the README for more details: https://github.com/fastlane/fastlane/tree/master/fastlane")
|
129
|
-
end
|
130
|
-
end
|
111
|
+
UI.user_error!("Action '#{method_sym}' of class '#{class_name}' was found, but has no `run` method.")
|
131
112
|
end
|
132
113
|
end
|
133
114
|
|
@@ -135,9 +116,6 @@ module Fastlane
|
|
135
116
|
# All the methods that are usually called on execution
|
136
117
|
#
|
137
118
|
|
138
|
-
class LaneNotAvailableError < StandardError
|
139
|
-
end
|
140
|
-
|
141
119
|
def try_switch_to_lane(new_lane, parameters)
|
142
120
|
block = lanes.fetch(current_platform, {}).fetch(new_lane, nil)
|
143
121
|
block ||= lanes.fetch(nil, {}).fetch(new_lane, nil) # fallback to general lane for multiple platforms
|
@@ -167,7 +145,9 @@ module Fastlane
|
|
167
145
|
UI.success "Cruising back to lane '#{original_full}' 🚘".green
|
168
146
|
return result
|
169
147
|
else
|
170
|
-
|
148
|
+
# No action and no lane, raising an exception now
|
149
|
+
UI.error caller.join("\n")
|
150
|
+
UI.user_error!("Could not find action or lane '#{new_lane}'. Check out the README for more details: https://github.com/fastlane/fastlane/tree/master/fastlane")
|
171
151
|
end
|
172
152
|
end
|
173
153
|
|
@@ -200,9 +180,7 @@ module Fastlane
|
|
200
180
|
rescue FastlaneCore::Interface::FastlaneError => e # user_error!
|
201
181
|
collector.did_raise_error(method_sym)
|
202
182
|
raise e
|
203
|
-
rescue
|
204
|
-
# high chance this is actually FastlaneCore::Interface::FastlaneCrash, but can be anything else
|
205
|
-
# Catches all exceptions, since some plugins might use system exits to get out
|
183
|
+
rescue => e # high chance this is actually FastlaneCore::Interface::FastlaneCrash, but can be anything else
|
206
184
|
collector.did_crash(method_sym)
|
207
185
|
raise e
|
208
186
|
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: 1.92.0
|
4
|
+
version: 1.92.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: 2016-05-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: krausefx-shenzhen
|
@@ -156,27 +156,13 @@ dependencies:
|
|
156
156
|
- - "~>"
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: 1.4.0
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
|
-
name: word_wrap
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
162
|
-
requirements:
|
163
|
-
- - "~>"
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: 1.0.0
|
166
|
-
type: :runtime
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: 1.0.0
|
173
159
|
- !ruby/object:Gem::Dependency
|
174
160
|
name: fastlane_core
|
175
161
|
requirement: !ruby/object:Gem::Requirement
|
176
162
|
requirements:
|
177
163
|
- - ">="
|
178
164
|
- !ruby/object:Gem::Version
|
179
|
-
version: 0.
|
165
|
+
version: 0.44.2
|
180
166
|
- - "<"
|
181
167
|
- !ruby/object:Gem::Version
|
182
168
|
version: 1.0.0
|
@@ -186,24 +172,10 @@ dependencies:
|
|
186
172
|
requirements:
|
187
173
|
- - ">="
|
188
174
|
- !ruby/object:Gem::Version
|
189
|
-
version: 0.
|
175
|
+
version: 0.44.2
|
190
176
|
- - "<"
|
191
177
|
- !ruby/object:Gem::Version
|
192
178
|
version: 1.0.0
|
193
|
-
- !ruby/object:Gem::Dependency
|
194
|
-
name: bundler
|
195
|
-
requirement: !ruby/object:Gem::Requirement
|
196
|
-
requirements:
|
197
|
-
- - "~>"
|
198
|
-
- !ruby/object:Gem::Version
|
199
|
-
version: '1.12'
|
200
|
-
type: :runtime
|
201
|
-
prerelease: false
|
202
|
-
version_requirements: !ruby/object:Gem::Requirement
|
203
|
-
requirements:
|
204
|
-
- - "~>"
|
205
|
-
- !ruby/object:Gem::Version
|
206
|
-
version: '1.12'
|
207
179
|
- !ruby/object:Gem::Dependency
|
208
180
|
name: credentials_manager
|
209
181
|
requirement: !ruby/object:Gem::Requirement
|
@@ -230,7 +202,7 @@ dependencies:
|
|
230
202
|
requirements:
|
231
203
|
- - ">="
|
232
204
|
- !ruby/object:Gem::Version
|
233
|
-
version: 0.27.
|
205
|
+
version: 0.27.1
|
234
206
|
- - "<"
|
235
207
|
- !ruby/object:Gem::Version
|
236
208
|
version: 1.0.0
|
@@ -240,7 +212,7 @@ dependencies:
|
|
240
212
|
requirements:
|
241
213
|
- - ">="
|
242
214
|
- !ruby/object:Gem::Version
|
243
|
-
version: 0.27.
|
215
|
+
version: 0.27.1
|
244
216
|
- - "<"
|
245
217
|
- !ruby/object:Gem::Version
|
246
218
|
version: 1.0.0
|
@@ -250,7 +222,7 @@ dependencies:
|
|
250
222
|
requirements:
|
251
223
|
- - ">="
|
252
224
|
- !ruby/object:Gem::Version
|
253
|
-
version: 1.11.
|
225
|
+
version: 1.11.3
|
254
226
|
- - "<"
|
255
227
|
- !ruby/object:Gem::Version
|
256
228
|
version: 2.0.0
|
@@ -260,7 +232,7 @@ dependencies:
|
|
260
232
|
requirements:
|
261
233
|
- - ">="
|
262
234
|
- !ruby/object:Gem::Version
|
263
|
-
version: 1.11.
|
235
|
+
version: 1.11.3
|
264
236
|
- - "<"
|
265
237
|
- !ruby/object:Gem::Version
|
266
238
|
version: 2.0.0
|
@@ -410,7 +382,7 @@ dependencies:
|
|
410
382
|
requirements:
|
411
383
|
- - ">="
|
412
384
|
- !ruby/object:Gem::Version
|
413
|
-
version: 1.
|
385
|
+
version: 1.7.0
|
414
386
|
- - "<"
|
415
387
|
- !ruby/object:Gem::Version
|
416
388
|
version: 2.0.0
|
@@ -420,7 +392,7 @@ dependencies:
|
|
420
392
|
requirements:
|
421
393
|
- - ">="
|
422
394
|
- !ruby/object:Gem::Version
|
423
|
-
version: 1.
|
395
|
+
version: 1.7.0
|
424
396
|
- - "<"
|
425
397
|
- !ruby/object:Gem::Version
|
426
398
|
version: 2.0.0
|
@@ -450,7 +422,7 @@ dependencies:
|
|
450
422
|
requirements:
|
451
423
|
- - ">="
|
452
424
|
- !ruby/object:Gem::Version
|
453
|
-
version: 0.
|
425
|
+
version: 0.7.1
|
454
426
|
- - "<"
|
455
427
|
- !ruby/object:Gem::Version
|
456
428
|
version: 1.0.0
|
@@ -460,7 +432,7 @@ dependencies:
|
|
460
432
|
requirements:
|
461
433
|
- - ">="
|
462
434
|
- !ruby/object:Gem::Version
|
463
|
-
version: 0.
|
435
|
+
version: 0.7.1
|
464
436
|
- - "<"
|
465
437
|
- !ruby/object:Gem::Version
|
466
438
|
version: 1.0.0
|
@@ -470,7 +442,7 @@ dependencies:
|
|
470
442
|
requirements:
|
471
443
|
- - ">="
|
472
444
|
- !ruby/object:Gem::Version
|
473
|
-
version: 0.
|
445
|
+
version: 0.6.0
|
474
446
|
- - "<"
|
475
447
|
- !ruby/object:Gem::Version
|
476
448
|
version: 1.0.0
|
@@ -480,7 +452,7 @@ dependencies:
|
|
480
452
|
requirements:
|
481
453
|
- - ">="
|
482
454
|
- !ruby/object:Gem::Version
|
483
|
-
version: 0.
|
455
|
+
version: 0.6.0
|
484
456
|
- - "<"
|
485
457
|
- !ruby/object:Gem::Version
|
486
458
|
version: 1.0.0
|
@@ -504,6 +476,20 @@ dependencies:
|
|
504
476
|
- - "<"
|
505
477
|
- !ruby/object:Gem::Version
|
506
478
|
version: 1.0.0
|
479
|
+
- !ruby/object:Gem::Dependency
|
480
|
+
name: bundler
|
481
|
+
requirement: !ruby/object:Gem::Requirement
|
482
|
+
requirements:
|
483
|
+
- - ">="
|
484
|
+
- !ruby/object:Gem::Version
|
485
|
+
version: '0'
|
486
|
+
type: :development
|
487
|
+
prerelease: false
|
488
|
+
version_requirements: !ruby/object:Gem::Requirement
|
489
|
+
requirements:
|
490
|
+
- - ">="
|
491
|
+
- !ruby/object:Gem::Version
|
492
|
+
version: '0'
|
507
493
|
- !ruby/object:Gem::Dependency
|
508
494
|
name: rake
|
509
495
|
requirement: !ruby/object:Gem::Requirement
|
@@ -630,20 +616,6 @@ dependencies:
|
|
630
616
|
- - "~>"
|
631
617
|
- !ruby/object:Gem::Version
|
632
618
|
version: 0.38.0
|
633
|
-
- !ruby/object:Gem::Dependency
|
634
|
-
name: appium_lib
|
635
|
-
requirement: !ruby/object:Gem::Requirement
|
636
|
-
requirements:
|
637
|
-
- - "~>"
|
638
|
-
- !ruby/object:Gem::Version
|
639
|
-
version: 4.1.0
|
640
|
-
type: :development
|
641
|
-
prerelease: false
|
642
|
-
version_requirements: !ruby/object:Gem::Requirement
|
643
|
-
requirements:
|
644
|
-
- - "~>"
|
645
|
-
- !ruby/object:Gem::Version
|
646
|
-
version: 4.1.0
|
647
619
|
- !ruby/object:Gem::Dependency
|
648
620
|
name: rest-client
|
649
621
|
requirement: !ruby/object:Gem::Requirement
|
@@ -690,7 +662,6 @@ files:
|
|
690
662
|
- lib/assets/AppfileTemplateAndroid
|
691
663
|
- lib/assets/DefaultFastfileTemplate
|
692
664
|
- lib/assets/FastfileTemplateAndroid
|
693
|
-
- lib/assets/Plugins.md.erb
|
694
665
|
- lib/assets/completions/completion.bash
|
695
666
|
- lib/assets/completions/completion.sh
|
696
667
|
- lib/assets/completions/completion.zsh
|
@@ -876,6 +847,7 @@ files:
|
|
876
847
|
- lib/fastlane/actions/verify_xcode.rb
|
877
848
|
- lib/fastlane/actions/version_bump_podspec.rb
|
878
849
|
- lib/fastlane/actions/version_get_podspec.rb
|
850
|
+
- lib/fastlane/actions/xcake.rb
|
879
851
|
- lib/fastlane/actions/xcode_install.rb
|
880
852
|
- lib/fastlane/actions/xcode_select.rb
|
881
853
|
- lib/fastlane/actions/xcode_server_get_assets.rb
|
@@ -911,29 +883,6 @@ files:
|
|
911
883
|
- lib/fastlane/new_action.rb
|
912
884
|
- lib/fastlane/one_off.rb
|
913
885
|
- lib/fastlane/other_action.rb
|
914
|
-
- lib/fastlane/plugins/plugin_fetcher.rb
|
915
|
-
- lib/fastlane/plugins/plugin_generator.rb
|
916
|
-
- lib/fastlane/plugins/plugin_generator_ui.rb
|
917
|
-
- lib/fastlane/plugins/plugin_info.rb
|
918
|
-
- lib/fastlane/plugins/plugin_info_collector.rb
|
919
|
-
- lib/fastlane/plugins/plugin_manager.rb
|
920
|
-
- lib/fastlane/plugins/plugin_search.rb
|
921
|
-
- lib/fastlane/plugins/plugins.rb
|
922
|
-
- lib/fastlane/plugins/templates/Gemfile.erb
|
923
|
-
- lib/fastlane/plugins/templates/LICENSE.erb
|
924
|
-
- lib/fastlane/plugins/templates/README.md.erb
|
925
|
-
- lib/fastlane/plugins/templates/Rakefile.erb
|
926
|
-
- lib/fastlane/plugins/templates/action.rb.erb
|
927
|
-
- lib/fastlane/plugins/templates/action_spec.rb.erb
|
928
|
-
- lib/fastlane/plugins/templates/assets/fastlane_logo.png
|
929
|
-
- lib/fastlane/plugins/templates/assets/plugin-badge.svg
|
930
|
-
- lib/fastlane/plugins/templates/dot_gitignore.erb
|
931
|
-
- lib/fastlane/plugins/templates/dot_rspec.erb
|
932
|
-
- lib/fastlane/plugins/templates/helper.rb.erb
|
933
|
-
- lib/fastlane/plugins/templates/plugin.gemspec.erb
|
934
|
-
- lib/fastlane/plugins/templates/plugin.rb.erb
|
935
|
-
- lib/fastlane/plugins/templates/spec_helper.rb.erb
|
936
|
-
- lib/fastlane/plugins/templates/version.rb.erb
|
937
886
|
- lib/fastlane/runner.rb
|
938
887
|
- lib/fastlane/setup/setup.rb
|
939
888
|
- lib/fastlane/setup/setup_android.rb
|
@@ -956,12 +905,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
956
905
|
version: 2.0.0
|
957
906
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
958
907
|
requirements:
|
959
|
-
- - "
|
908
|
+
- - ">="
|
960
909
|
- !ruby/object:Gem::Version
|
961
|
-
version:
|
910
|
+
version: '0'
|
962
911
|
requirements: []
|
963
912
|
rubyforge_project:
|
964
|
-
rubygems_version: 2.4.
|
913
|
+
rubygems_version: 2.4.0
|
965
914
|
signing_key:
|
966
915
|
specification_version: 4
|
967
916
|
summary: The easiest way to automate building and releasing your iOS and Android apps
|
data/lib/assets/Plugins.md.erb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
module Fastlane
|
2
|
-
# Use the RubyGems API to get all fastlane plugins
|
3
|
-
class PluginFetcher
|
4
|
-
require 'fastlane_core'
|
5
|
-
require 'fastlane/plugins/plugin_manager'
|
6
|
-
|
7
|
-
# Returns an array of FastlanePlugin objects
|
8
|
-
def self.fetch_gems(search_query: nil)
|
9
|
-
require 'json'
|
10
|
-
require 'open-uri'
|
11
|
-
url = "https://rubygems.org/api/v1/search.json?query=#{PluginManager.plugin_prefix}"
|
12
|
-
results = JSON.parse(open(url).read)
|
13
|
-
|
14
|
-
plugins = results.collect do |current|
|
15
|
-
FastlanePlugin.new(current)
|
16
|
-
end
|
17
|
-
|
18
|
-
return plugins if search_query.to_s.length == 0
|
19
|
-
|
20
|
-
plugins.keep_if do |current|
|
21
|
-
current.full_name.include?(search_query)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.update_md_file!
|
26
|
-
@plugins = fetch_gems
|
27
|
-
|
28
|
-
lib_path = FastlaneCore::Helper.gem_path('fastlane')
|
29
|
-
template_path = File.join(lib_path, "lib/assets/Plugins.md.erb")
|
30
|
-
md = ERB.new(File.read(template_path), nil, '<>').result(binding) # http://www.rrn.dk/rubys-erb-templating-system
|
31
|
-
|
32
|
-
puts md
|
33
|
-
output_path = "docs/AvailablePlugins.md"
|
34
|
-
File.write(output_path, md)
|
35
|
-
FastlaneCore::UI.success("Successfully written plugin file to '#{output_path}'")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
class FastlanePlugin
|
40
|
-
attr_accessor :full_name
|
41
|
-
attr_accessor :name
|
42
|
-
attr_accessor :downloads
|
43
|
-
attr_accessor :info
|
44
|
-
attr_accessor :homepage
|
45
|
-
|
46
|
-
def initialize(hash)
|
47
|
-
self.full_name = hash["name"]
|
48
|
-
self.name = self.full_name.gsub(PluginManager.plugin_prefix, '')
|
49
|
-
self.downloads = hash["downloads"]
|
50
|
-
self.info = hash["info"]
|
51
|
-
self.homepage = hash["homepage_uri"]
|
52
|
-
end
|
53
|
-
|
54
|
-
def linked_title
|
55
|
-
return "`#{name}`" if homepage.to_s.length == 0
|
56
|
-
return "[#{name}](#{homepage})"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
@@ -1,109 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
require 'erb'
|
3
|
-
|
4
|
-
module Fastlane
|
5
|
-
class PluginGenerator
|
6
|
-
def initialize(ui = PluginGeneratorUI.new,
|
7
|
-
info_collector = PluginInfoCollector.new(ui))
|
8
|
-
@ui = ui
|
9
|
-
@info_collector = info_collector
|
10
|
-
end
|
11
|
-
|
12
|
-
# entry point
|
13
|
-
def generate(plugin_name = nil)
|
14
|
-
plugin_info = @info_collector.collect_info(plugin_name)
|
15
|
-
|
16
|
-
generate_paths(plugin_info)
|
17
|
-
|
18
|
-
generate_dot_rspec(plugin_info)
|
19
|
-
generate_dot_gitignore(plugin_info)
|
20
|
-
generate_gemfile(plugin_info)
|
21
|
-
generate_gemspec(plugin_info)
|
22
|
-
generate_plugin_rb(plugin_info)
|
23
|
-
generate_readme(plugin_info)
|
24
|
-
generate_version(plugin_info)
|
25
|
-
generate_license(plugin_info)
|
26
|
-
generate_action(plugin_info)
|
27
|
-
generate_helper(plugin_info)
|
28
|
-
generate_spec_helper(plugin_info)
|
29
|
-
generate_action_spec(plugin_info)
|
30
|
-
generate_rakefile(plugin_info)
|
31
|
-
|
32
|
-
@ui.success "\nYour plugin was successfully generated at #{plugin_info.gem_name}/ 🚀"
|
33
|
-
@ui.success "\nTo get started with using this plugin, run"
|
34
|
-
@ui.message "\n fastlane add_plugin #{plugin_info.plugin_name}\n"
|
35
|
-
@ui.success "\nfrom a fastlane-enabled app project directory and provide the following as the path:"
|
36
|
-
@ui.message "\n #{File.expand_path(plugin_info.gem_name)}\n\n"
|
37
|
-
end
|
38
|
-
|
39
|
-
def generate_paths(plugin_info)
|
40
|
-
FileUtils.mkdir_p(plugin_path(plugin_info, 'lib', plugin_info.require_path))
|
41
|
-
FileUtils.mkdir_p(plugin_path(plugin_info, 'lib', plugin_info.actions_path))
|
42
|
-
FileUtils.mkdir_p(plugin_path(plugin_info, 'lib', plugin_info.helper_path))
|
43
|
-
FileUtils.mkdir_p(plugin_path(plugin_info, 'spec'))
|
44
|
-
end
|
45
|
-
|
46
|
-
def generate_dot_rspec(plugin_info)
|
47
|
-
write_template(plugin_info, 'dot_rspec.erb', plugin_path(plugin_info, ".rspec"))
|
48
|
-
end
|
49
|
-
|
50
|
-
def generate_dot_gitignore(plugin_info)
|
51
|
-
write_template(plugin_info, 'dot_gitignore.erb', plugin_path(plugin_info, ".gitignore"))
|
52
|
-
end
|
53
|
-
|
54
|
-
def generate_gemfile(plugin_info)
|
55
|
-
write_template(plugin_info, 'Gemfile.erb', plugin_path(plugin_info, "Gemfile"))
|
56
|
-
end
|
57
|
-
|
58
|
-
def generate_gemspec(plugin_info)
|
59
|
-
write_template(plugin_info, 'plugin.gemspec.erb', plugin_path(plugin_info, "#{plugin_info.gem_name}.gemspec"))
|
60
|
-
end
|
61
|
-
|
62
|
-
def generate_plugin_rb(plugin_info)
|
63
|
-
write_template(plugin_info, 'plugin.rb.erb', plugin_path(plugin_info, 'lib', 'fastlane', 'plugin', "#{plugin_info.plugin_name}.rb"))
|
64
|
-
end
|
65
|
-
|
66
|
-
def generate_version(plugin_info)
|
67
|
-
write_template(plugin_info, 'version.rb.erb', plugin_path(plugin_info, 'lib', plugin_info.require_path, 'version.rb'))
|
68
|
-
end
|
69
|
-
|
70
|
-
def generate_readme(plugin_info)
|
71
|
-
write_template(plugin_info, 'README.md.erb', plugin_path(plugin_info, "README.md"))
|
72
|
-
end
|
73
|
-
|
74
|
-
def generate_license(plugin_info)
|
75
|
-
write_template(plugin_info, 'LICENSE.erb', plugin_path(plugin_info, "LICENSE"))
|
76
|
-
end
|
77
|
-
|
78
|
-
def generate_action(plugin_info)
|
79
|
-
write_template(plugin_info, 'action.rb.erb', plugin_path(plugin_info, 'lib', plugin_info.actions_path, "#{plugin_info.plugin_name}_action.rb"))
|
80
|
-
end
|
81
|
-
|
82
|
-
def generate_helper(plugin_info)
|
83
|
-
write_template(plugin_info, 'helper.rb.erb', plugin_path(plugin_info, 'lib', plugin_info.helper_path, "#{plugin_info.plugin_name}_helper.rb"))
|
84
|
-
end
|
85
|
-
|
86
|
-
def generate_spec_helper(plugin_info)
|
87
|
-
write_template(plugin_info, 'spec_helper.rb.erb', plugin_path(plugin_info, 'spec', 'spec_helper.rb'))
|
88
|
-
end
|
89
|
-
|
90
|
-
def generate_action_spec(plugin_info)
|
91
|
-
write_template(plugin_info, 'action_spec.rb.erb', plugin_path(plugin_info, 'spec', 'action_spec.rb'))
|
92
|
-
end
|
93
|
-
|
94
|
-
def generate_rakefile(plugin_info)
|
95
|
-
write_template(plugin_info, 'Rakefile.erb', plugin_path(plugin_info, 'Rakefile'))
|
96
|
-
end
|
97
|
-
|
98
|
-
def write_template(plugin_info, template_name, dest_path)
|
99
|
-
template = File.join(File.dirname(__FILE__), 'templates', template_name)
|
100
|
-
erb = ERB.new(File.read(template))
|
101
|
-
result = erb.result(plugin_info.get_binding)
|
102
|
-
File.write(dest_path, result)
|
103
|
-
end
|
104
|
-
|
105
|
-
def plugin_path(plugin_info, *path)
|
106
|
-
File.join(plugin_info.gem_name, *path)
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|