fastlane-plugin-ravn_mobile 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +64 -0
- data/lib/fastlane/plugin/ravn_mobile/actions/commit_version_action.rb +62 -0
- data/lib/fastlane/plugin/ravn_mobile/actions/increment_expo_version_action.rb +102 -0
- data/lib/fastlane/plugin/ravn_mobile/actions/increment_version_code_action.rb +82 -0
- data/lib/fastlane/plugin/ravn_mobile/actions/is_expo_action.rb +51 -0
- data/lib/fastlane/plugin/ravn_mobile/actions/is_flutter_action.rb +51 -0
- data/lib/fastlane/plugin/ravn_mobile/actions/is_react_native_action.rb +51 -0
- data/lib/fastlane/plugin/ravn_mobile/actions/setup_expo_project_action.rb +47 -0
- data/lib/fastlane/plugin/ravn_mobile/helper/framework_helper.rb +43 -0
- data/lib/fastlane/plugin/ravn_mobile/util/util.rb +7 -0
- data/lib/fastlane/plugin/ravn_mobile/version.rb +5 -0
- data/lib/fastlane/plugin/ravn_mobile.rb +16 -0
- metadata +197 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 05f6c7abbb0f386b8f91384568d827de1b66f2298ea95b7775463cb6f0c431db
|
4
|
+
data.tar.gz: f228cecaa1c464498862d8a74fddf48083267478a5b315c4b9e74a563ef6bebe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0220eed2ac4ae94e733d092f4a83bcd61e91c40b9b56753dceca7e831efac85090ace316bde55fe982cee7c79d3d425f701f4e6430ad8dd0e1a34012501d9b88
|
7
|
+
data.tar.gz: eb34517977f508573d2cac13db4ab79580ed06a862bf4f3a1e41793ef73919684ca42678d8eafe8bbc056bf1d00213a5fb06111e02ddcfe37419f5aa14648b41
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2023 Ravn
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# ravn_mobile plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-ravn_mobile)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started
|
8
|
+
with `fastlane-plugin-ravn_mobile`, add it to your project by running:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
fastlane add_plugin ravn_mobile
|
12
|
+
```
|
13
|
+
|
14
|
+
## About ravn_mobile
|
15
|
+
|
16
|
+
Utility actions for Fastlane build and deployment of Android and iOS apps for both native and cross-platform
|
17
|
+
implementations.
|
18
|
+
|
19
|
+
#### Available actions
|
20
|
+
|
21
|
+
- `increment_expo_version`: Increments Expo projects version code or build number for both iOS and Android.
|
22
|
+
- `increment_version_code`: Increments Android version code using `gradle.properties` to work with Groovy and KTS.
|
23
|
+
- `is_react_native`: Checks whether the current project uses React Native.
|
24
|
+
- `is_expo`: Checks whether the current project uses Expo.
|
25
|
+
- `is_flutter`: Checks whether the current project uses Flutter.
|
26
|
+
- `setup_expo_project`: Configures the current Expo project for building.
|
27
|
+
|
28
|
+
## Example
|
29
|
+
|
30
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo,
|
31
|
+
running `fastlane install_plugins` and `bundle exec fastlane test`.
|
32
|
+
|
33
|
+
## Run tests for this plugin
|
34
|
+
|
35
|
+
To run both the tests, and code style validation, run
|
36
|
+
|
37
|
+
```
|
38
|
+
rake
|
39
|
+
```
|
40
|
+
|
41
|
+
To automatically fix many of the styling issues, use
|
42
|
+
|
43
|
+
```
|
44
|
+
rubocop -a
|
45
|
+
```
|
46
|
+
|
47
|
+
## Issues and Feedback
|
48
|
+
|
49
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
50
|
+
|
51
|
+
## Troubleshooting
|
52
|
+
|
53
|
+
If you have trouble using plugins, check out
|
54
|
+
the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
55
|
+
|
56
|
+
## Using _fastlane_ Plugins
|
57
|
+
|
58
|
+
For more information about how the `fastlane` plugin system works, check out
|
59
|
+
the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
60
|
+
|
61
|
+
## About _fastlane_
|
62
|
+
|
63
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more,
|
64
|
+
check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'fastlane'
|
2
|
+
require_relative '../helper/framework_helper'
|
3
|
+
require_relative '../util/util'
|
4
|
+
|
5
|
+
module Fastlane
|
6
|
+
module Actions
|
7
|
+
class CommitVersionAction < Action
|
8
|
+
def self.run(params)
|
9
|
+
xcodeproj = params[:xcodeproj]
|
10
|
+
message = params[:message]
|
11
|
+
|
12
|
+
if Helper::FrameworkHelper.is_expo?
|
13
|
+
# noinspection RubyResolve
|
14
|
+
other_action.git_commit(path: ['app.json'], message: message)
|
15
|
+
elsif !blank?(xcodeproj)
|
16
|
+
# noinspection RubyResolve
|
17
|
+
other_action.commit_version_bump(message: message, xcodeproj: xcodeproj)
|
18
|
+
else
|
19
|
+
project_dir = Helper::FrameworkHelper.is_react_native? || Helper::FrameworkHelper.is_flutter? ? 'android/' : './'
|
20
|
+
properties_path = File.join(project_dir, 'gradle.properties')
|
21
|
+
|
22
|
+
# noinspection RubyResolve
|
23
|
+
other_action.git_commit(path: [properties_path], message: message)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
#####################################################
|
28
|
+
# @!group Documentation
|
29
|
+
#####################################################
|
30
|
+
|
31
|
+
def self.description
|
32
|
+
'Commit version change for iOS and Android projects'
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.details
|
36
|
+
'Commits changes made to version code, supports Android (via gradle.properties) and iOS'
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.available_options
|
40
|
+
[
|
41
|
+
FastlaneCore::ConfigItem.new(key: :message,
|
42
|
+
env_name: 'FL_COMMIT_VERSION_MESSAGE',
|
43
|
+
description: 'Commit message',
|
44
|
+
type: String,
|
45
|
+
default_value: 'chore: Version bump'),
|
46
|
+
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
47
|
+
env_name: 'FL_COMMIT_VERSION_XCODEPROJ',
|
48
|
+
description: 'Xcodeproj if running for iOS',
|
49
|
+
optional: true)
|
50
|
+
]
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.authors
|
54
|
+
['quebin31']
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.is_supported?(platform)
|
58
|
+
%i[ios android].include?(platform)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require 'fastlane'
|
2
|
+
require 'json'
|
3
|
+
require_relative '../util/util'
|
4
|
+
|
5
|
+
module Fastlane
|
6
|
+
module Actions
|
7
|
+
module SharedValues
|
8
|
+
# noinspection RubyConstantNamingConvention
|
9
|
+
INCREMENT_EXPO_VERSION_ANDROID_VALUE = :INCREMENT_EXPO_VERSION_ANDROID_VALUE
|
10
|
+
# noinspection RubyConstantNamingConvention
|
11
|
+
INCREMENT_EXPO_VERSION_IOS_VALUE = :INCREMENT_EXPO_VERSION_IOS_VALUE
|
12
|
+
end
|
13
|
+
|
14
|
+
# Action to increment version of Expo projects (in app.json)
|
15
|
+
class IncrementExpoVersionAction < Action
|
16
|
+
def self.run(params)
|
17
|
+
platform = params[:platform]
|
18
|
+
increment_android_version_code(params[:android_version_code]) if %w[android both].include?(platform)
|
19
|
+
increment_ios_build_number(params[:ios_build_number]) if %w[ios both].include?(platform)
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.increment_android_version_code(version_code)
|
23
|
+
app_config = read_app_json_config
|
24
|
+
android_config = app_config.fetch('expo', {}).fetch('android', {})
|
25
|
+
version_code = android_config.fetch('versionCode', 0) + 1 if blank?(version_code)
|
26
|
+
android_config['versionCode'] = version_code
|
27
|
+
Actions.lane_context[SharedValues::INCREMENT_EXPO_VERSION_ANDROID_VALUE] = version_code
|
28
|
+
|
29
|
+
# noinspection RubyMismatchedArgumentType
|
30
|
+
File.write('app.json', JSON.pretty_generate(app_config))
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.increment_ios_build_number(build_number)
|
34
|
+
app_config = read_app_json_config
|
35
|
+
ios_config = app_config.fetch('expo', {}).fetch('ios', {})
|
36
|
+
build_number = (Integer(ios_config['buildNumber'], exception: false) || 0) + 1 if blank?(build_number)
|
37
|
+
ios_config['buildNumber'] = build_number.to_s
|
38
|
+
Actions.lane_context[SharedValues::INCREMENT_EXPO_VERSION_IOS_VALUE] = build_number.to_s
|
39
|
+
|
40
|
+
# noinspection RubyMismatchedArgumentType
|
41
|
+
File.write('app.json', JSON.pretty_generate(app_config))
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.read_app_json_config
|
45
|
+
JSON.parse(File.read('app.json'))
|
46
|
+
rescue StandardError
|
47
|
+
{}
|
48
|
+
end
|
49
|
+
|
50
|
+
#####################################################
|
51
|
+
# @!group Documentation
|
52
|
+
#####################################################
|
53
|
+
|
54
|
+
def self.description
|
55
|
+
'Increment version code and/or build number in app.json for Expo projects'
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.details
|
59
|
+
'Increment version code (for Android) or build number (for iOS) for projects using Expo'
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.available_options
|
63
|
+
[
|
64
|
+
FastlaneCore::ConfigItem.new(key: :android_version_code,
|
65
|
+
env_name: 'FL_INCREMENT_EXPO_VERSION_ANDROID_VERSION_CODE',
|
66
|
+
description: 'Version code value for Android',
|
67
|
+
optional: true,
|
68
|
+
skip_type_validation: true),
|
69
|
+
FastlaneCore::ConfigItem.new(key: :ios_build_number,
|
70
|
+
env_name: 'FL_INCREMENT_EXPO_VERSION_IOS_BUILD_NUMBER',
|
71
|
+
description: 'Build number value for iOS',
|
72
|
+
optional: true,
|
73
|
+
skip_type_validation: true),
|
74
|
+
FastlaneCore::ConfigItem.new(key: :platform,
|
75
|
+
env_name: 'FL_INCREMENT_EXPO_VERSION_PLATFORM',
|
76
|
+
description: 'Platform to apply this change to (values: android, ios, both)',
|
77
|
+
type: String,
|
78
|
+
default_value: 'both',
|
79
|
+
verify_block: proc do |value|
|
80
|
+
is_valid = %w[android ios both].include?(value)
|
81
|
+
UI.user_error!("Invalid platform value '#{value}'") unless is_valid
|
82
|
+
end)
|
83
|
+
]
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.output
|
87
|
+
[
|
88
|
+
['INCREMENT_EXPO_VERSION_ANDROID_VALUE', 'Android version code value'],
|
89
|
+
['INCREMENT_EXPO_VERSION_IOS_VALUE', 'iOS build number value']
|
90
|
+
]
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.authors
|
94
|
+
['quebin31']
|
95
|
+
end
|
96
|
+
|
97
|
+
def self.is_supported?(platform)
|
98
|
+
%i[ios android].include?(platform)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'fastlane'
|
2
|
+
require_relative '../util/util'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
module SharedValues
|
7
|
+
INCREMENT_VERSION_CODE_VALUE = :INCREMENT_VERSION_CODE_VALUE
|
8
|
+
end
|
9
|
+
|
10
|
+
# Action to increment version code in gradle.properties
|
11
|
+
class IncrementVersionCodeAction < Action
|
12
|
+
def self.run(params)
|
13
|
+
project_dir = params[:project_dir]
|
14
|
+
|
15
|
+
properties_file = File.join(project_dir, 'gradle.properties')
|
16
|
+
properties_contents = File.read(properties_file)
|
17
|
+
|
18
|
+
version_code = params[:version_code]
|
19
|
+
version_code = get_version_code(properties_contents) if blank?(version_code)
|
20
|
+
version_code = [version_code.to_i, 1].max
|
21
|
+
|
22
|
+
updated_contents = properties_contents.gsub!(/^\s*version\.code\s*=\s*\S+/, "version.code=#{version_code}")
|
23
|
+
updated_contents = properties_contents + "\nversion.code=#{version_code}" if blank?(updated_contents)
|
24
|
+
|
25
|
+
# noinspection RubyMismatchedArgumentType
|
26
|
+
File.write(properties_file, updated_contents)
|
27
|
+
|
28
|
+
Actions.lane_context[SharedValues::INCREMENT_VERSION_CODE_VALUE] = version_code
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.get_version_code(contents)
|
32
|
+
extracted_version = contents.match(/^\s*version\.code\s*=\s*(\S+)/)&.[](1) || '0'
|
33
|
+
extracted_version.to_i + 1
|
34
|
+
end
|
35
|
+
|
36
|
+
#####################################################
|
37
|
+
# @!group Documentation
|
38
|
+
#####################################################
|
39
|
+
|
40
|
+
def self.description
|
41
|
+
'Increment version code for Android in gradle.properties'
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.details
|
45
|
+
"The updated value is located in the property 'version.code' inside gradle.properties file"
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.available_options
|
49
|
+
[
|
50
|
+
FastlaneCore::ConfigItem.new(key: :version_code,
|
51
|
+
env_name: 'FL_INCREMENT_VERSION_CODE_VERSION_CODE',
|
52
|
+
description: 'Value for version code',
|
53
|
+
optional: true,
|
54
|
+
skip_type_validation: true),
|
55
|
+
FastlaneCore::ConfigItem.new(key: :project_dir,
|
56
|
+
env_name: 'FL_INCREMENT_VERSION_CODE_PROJECT_DIR',
|
57
|
+
description: 'Android project dir',
|
58
|
+
is_string: true,
|
59
|
+
default_value: '.')
|
60
|
+
]
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.output
|
64
|
+
[
|
65
|
+
['INCREMENT_VERSION_CODE_VALUE', 'The new version code value']
|
66
|
+
]
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.return_value
|
70
|
+
'The incremented version code value'
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.authors
|
74
|
+
['quebin31']
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.is_supported?(platform)
|
78
|
+
platform == :android
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'fastlane'
|
2
|
+
require_relative '../helper/framework_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
module SharedValues
|
7
|
+
IS_EXPO_PROJECT = :IS_EXPO_PROJECT
|
8
|
+
end
|
9
|
+
|
10
|
+
# Action to detect if the current project uses Expo
|
11
|
+
class IsExpoAction < Action
|
12
|
+
def self.run(_params)
|
13
|
+
Action.lane_context[SharedValues::IS_EXPO_PROJECT] = Helper::FrameworkHelper.is_expo?
|
14
|
+
end
|
15
|
+
|
16
|
+
#####################################################
|
17
|
+
# @!group Documentation
|
18
|
+
#####################################################
|
19
|
+
|
20
|
+
def self.description
|
21
|
+
'Action to detect if the current project is using Expo'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.details
|
25
|
+
'The return value of this action is true if an Expo project is detected'
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.output
|
29
|
+
[
|
30
|
+
'IS_EXPO_PROJECT', 'Whether or not the project uses Expo'
|
31
|
+
]
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.available_options
|
35
|
+
[]
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.return_type
|
39
|
+
:bool
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.authors
|
43
|
+
['quebin31']
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.is_supported?(platform)
|
47
|
+
%i[ios android].include?(platform)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'fastlane'
|
2
|
+
require_relative '../helper/framework_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
module SharedValues
|
7
|
+
IS_FLUTTER_PROJECT = :IS_FLUTTER_PROJECT
|
8
|
+
end
|
9
|
+
|
10
|
+
# Action to detect if project is Flutter
|
11
|
+
class IsFlutterAction < Action
|
12
|
+
def self.run(_params)
|
13
|
+
Action.lane_context[SharedValues::IS_FLUTTER_PROJECT] = Helper::FrameworkHelper.is_flutter?
|
14
|
+
end
|
15
|
+
|
16
|
+
#####################################################
|
17
|
+
# @!group Documentation
|
18
|
+
#####################################################
|
19
|
+
|
20
|
+
def self.description
|
21
|
+
'Action to detect if the current project is using Flutter'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.details
|
25
|
+
'The return value of this action is true if a Flutter project is detected'
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.output
|
29
|
+
[
|
30
|
+
'IS_FLUTTER_PROJECT', 'Whether or not the project uses Flutter'
|
31
|
+
]
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.available_options
|
35
|
+
[]
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.return_type
|
39
|
+
:bool
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.authors
|
43
|
+
['quebin31']
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.is_supported?(platform)
|
47
|
+
%i[ios android].include?(platform)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'fastlane'
|
2
|
+
require_relative '../helper/framework_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
module SharedValues
|
7
|
+
IS_REACT_NATIVE_PROJECT = :IS_REACT_NATIVE_PROJECT
|
8
|
+
end
|
9
|
+
|
10
|
+
# Action to detect if project is React Native
|
11
|
+
class IsReactNativeAction < Action
|
12
|
+
def self.run(_params)
|
13
|
+
Action.lane_context[SharedValues::IS_REACT_NATIVE_PROJECT] = Helper::FrameworkHelper.is_react_native?
|
14
|
+
end
|
15
|
+
|
16
|
+
#####################################################
|
17
|
+
# @!group Documentation
|
18
|
+
#####################################################
|
19
|
+
|
20
|
+
def self.description
|
21
|
+
'Action to detect if the current project is using React Native'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.details
|
25
|
+
'The return value of this action is true if a React Native project is detected'
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.output
|
29
|
+
[
|
30
|
+
'IS_REACT_NATIVE_PROJECT', 'Whether or not the project uses React Native'
|
31
|
+
]
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.available_options
|
35
|
+
[]
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.return_type
|
39
|
+
:bool
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.authors
|
43
|
+
['quebin31']
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.is_supported?(platform)
|
47
|
+
%i[ios android].include?(platform)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'fastlane'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
# Action to setup an expo project (if any)
|
6
|
+
class SetupExpoProjectAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
platform = params[:platform] || 'all'
|
9
|
+
sh("npx expo prebuild --platform #{platform} --clean")
|
10
|
+
end
|
11
|
+
|
12
|
+
#####################################################
|
13
|
+
# @!group Documentation
|
14
|
+
#####################################################
|
15
|
+
|
16
|
+
def self.description
|
17
|
+
'Set up an expo project (based on React Native) to work with fastlane'
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.details
|
21
|
+
'Execute `npx expo prebuild --clean` to configure Android and iOS native projects'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.available_options
|
25
|
+
[
|
26
|
+
FastlaneCore::ConfigItem.new(key: :platform,
|
27
|
+
env_name: 'FL_SETUP_EXPO_PROJECT_PLATFORM',
|
28
|
+
description: 'Platform to sync (values: android, ios, all)',
|
29
|
+
type: String,
|
30
|
+
default_value: 'all',
|
31
|
+
verify_block: proc do |value|
|
32
|
+
is_valid = %w[android ios all].include?(value)
|
33
|
+
UI.user_error!("Invalid platform value '#{value}'") unless is_valid
|
34
|
+
end)
|
35
|
+
]
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.authors
|
39
|
+
['quebin31']
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.is_supported?(platform)
|
43
|
+
%i[ios android].include?(platform)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'psych'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Helper
|
6
|
+
class FrameworkHelper
|
7
|
+
def self.is_react_native?
|
8
|
+
return false unless File.exist?('package.json')
|
9
|
+
return false unless Dir.exist?('android') && Dir.exist?('ios')
|
10
|
+
|
11
|
+
package_contents = read_package_json
|
12
|
+
package_contents&.dig('dependencies')&.dig('react-native') ? true : false
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.is_expo?
|
16
|
+
return false unless File.exist?('package.json')
|
17
|
+
|
18
|
+
package_contents = read_package_json
|
19
|
+
package_contents&.dig('dependencies')&.dig('expo') ? true : false
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.is_flutter?
|
23
|
+
return false unless File.exist?('pubspec.yaml')
|
24
|
+
return false unless Dir.exist?('lib') && (Dir.exist?('android') || Dir.exist?('ios'))
|
25
|
+
|
26
|
+
pubspec_content = read_pubspec_yaml
|
27
|
+
pubspec_content&.dig('dependencies')&.dig('flutter')&.dig('sdk') == 'flutter'
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.read_package_json
|
31
|
+
JSON.parse(File.read('package.json'))
|
32
|
+
rescue StandardError
|
33
|
+
{}
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.read_pubspec_yaml
|
37
|
+
Psych.load_file('pubspec.yaml')
|
38
|
+
rescue StandardError
|
39
|
+
{}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require_relative './ravn_mobile/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module RavnMobile
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::RavnMobile.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-ravn_mobile
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- quebin31
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: fastlane
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.216.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.216.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec_junit_formatter
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.50.2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.50.2
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-performance
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-require_tools
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
description:
|
154
|
+
email: kevindelcastillo@ravn.co
|
155
|
+
executables: []
|
156
|
+
extensions: []
|
157
|
+
extra_rdoc_files: []
|
158
|
+
files:
|
159
|
+
- LICENSE
|
160
|
+
- README.md
|
161
|
+
- lib/fastlane/plugin/ravn_mobile.rb
|
162
|
+
- lib/fastlane/plugin/ravn_mobile/actions/commit_version_action.rb
|
163
|
+
- lib/fastlane/plugin/ravn_mobile/actions/increment_expo_version_action.rb
|
164
|
+
- lib/fastlane/plugin/ravn_mobile/actions/increment_version_code_action.rb
|
165
|
+
- lib/fastlane/plugin/ravn_mobile/actions/is_expo_action.rb
|
166
|
+
- lib/fastlane/plugin/ravn_mobile/actions/is_flutter_action.rb
|
167
|
+
- lib/fastlane/plugin/ravn_mobile/actions/is_react_native_action.rb
|
168
|
+
- lib/fastlane/plugin/ravn_mobile/actions/setup_expo_project_action.rb
|
169
|
+
- lib/fastlane/plugin/ravn_mobile/helper/framework_helper.rb
|
170
|
+
- lib/fastlane/plugin/ravn_mobile/util/util.rb
|
171
|
+
- lib/fastlane/plugin/ravn_mobile/version.rb
|
172
|
+
homepage: https://github.com/ravn-hq/fastlane-plugin-ravn_mobile
|
173
|
+
licenses:
|
174
|
+
- MIT
|
175
|
+
metadata:
|
176
|
+
rubygems_mfa_required: 'true'
|
177
|
+
post_install_message:
|
178
|
+
rdoc_options: []
|
179
|
+
require_paths:
|
180
|
+
- lib
|
181
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '2.6'
|
186
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
requirements: []
|
192
|
+
rubygems_version: 3.3.7
|
193
|
+
signing_key:
|
194
|
+
specification_version: 4
|
195
|
+
summary: Utility actions for Fastlane build and deployment of Android and iOS apps
|
196
|
+
for both native and cross platform implementations
|
197
|
+
test_files: []
|