-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFastfile
77 lines (66 loc) · 2.84 KB
/
Fastfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
actions_path("lib/actions")
fastlane_version "2.69.0"
default_platform :ios
platform :android do
desc "Run Android unit tests"
lane :test do
# for development on a Mac. Override with the env. var.
ENV['ANDROID_HOME'] ||= "#{ENV['HOME']}/Library/Android/sdk"
gradle task: "test", project_dir: "native-tests/android"
end
end
platform :ios do
# fastlane ios test [opts]
# opts:
# verbose:[yes|no] (REACT_NATIVE_BRANCH_VERBOSE env. var., default: no)
# repo_update:[yes|no] (REACT_NATIVE_BRANCH_REPO_UPDATE env. var., default: yes)
desc "Run iOS unit tests"
lane :test do |opts|
helper = UpdateHelper
# Options
verbose = opts[:verbose]
verbose = verbose.nil? ? helper.boolean_env_var?(:REACT_NATIVE_BRANCH_VERBOSE, default_value: false) : verbose
repo_update = opts[:repo_update]
repo_update = repo_update.nil? ? helper.boolean_env_var?(:REACT_NATIVE_BRANCH_REPO_UPDATE, default_value: true) : repo_update
# Make sure Pods are installed for native-tests before running scan
helper.pod_install_if_required '../native-tests/ios', verbose: verbose, repo_update: repo_update
scan
end
end
# Examples:
# bundle exec fastlane npm_update commit:no, # Don't commit the results. Default: true
# bundle exec fastlane npm_update repo_update:no # Don't update CocoaPods repo
# bundle exec fastlane npm_update include_examples:yes # Also update all example lockfiles
desc "Update NPM deps"
lane :npm_update do |opts|
helper = UpdateHelper
helper.update_npm_deps self, include_examples: opts[:include_examples]
helper.update_pods_in_tests_and_examples(
self,
repo_update: opts[:repo_update],
verbose: opts[:verbose],
include_examples: opts[:include_examples]
)
# default is to commit, use commit:no to suppress
helper.sh 'git', 'commit', '-a', '-m[Fastlane] Updated all JS lockfiles', chdir: '..' if opts[:commit] || opts[:commit].nil?
end
# Examples:
# bundle exec fastlane native_update android_version:"3.2.0", # Android SDK version from Maven
# bundle exec fastlane native_update ios_version:"0.27.1", # iOS SDK version from CocoaPods
# bundle exec fastlane native_update repo_update:no # Don't update CocoaPods repo
# bundle exec fastlane native_update include_examples:yes # Also update all example lockfiles
# bundle exec fastlane native_update commit:no, # Don't commit the results. Default: true
desc "Update native SDKs"
lane :native_update do |opts|
update_native_sdks opts
end
# Examples:
# bundle exec fastlane bump # patch increment
# bundle exec fastlane bump version:2.3.0 # update to any specific version
# bundle exec fastlane bump tag:yes # add a tag after committing
# bundle exec fastlane bump repo_update:no # Don't update CocoaPods repo
# bundle exec fastlane bump include_examples:yes # Also update all example lockfiles
desc "Increment version number"
lane :bump do |opts|
version_bump opts
end