fastlane-plugin-creator 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +2 -6
- data/lib/fastlane/plugin/creator/actions/creator_build_android_action.rb +80 -0
- data/lib/fastlane/plugin/creator/actions/creator_build_ios_action.rb +82 -0
- data/lib/fastlane/plugin/creator/helper/creator_helper.rb +28 -4
- data/lib/fastlane/plugin/creator/version.rb +1 -1
- metadata +6 -4
- data/lib/fastlane/plugin/creator/actions/creator_action.rb +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: '0820975e8f10bdfcee7a3514692cbb2f30104163'
|
4
|
+
data.tar.gz: 25e69d5609a10e639f459598e2987660bc570024
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0ae86e6e7d2d06651b82b70f1da128b32881b7ff0a7a4dbda2e93602ed8d4681c9b676008a057206f950d0a6d22080f7a77fc233cdd05cd0a2aa129cf597e44
|
7
|
+
data.tar.gz: d1197737d8dbe01c351c0e1cdc9b3ee32923fea965625f4eebc7af8d3b9fd83d59a2e379584584903cb1833e2f156e4bc1e19219edcdb6cbd723b3137d601865
|
data/README.md
CHANGED
@@ -12,15 +12,11 @@ fastlane add_plugin creator
|
|
12
12
|
|
13
13
|
## About creator
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
**Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
|
15
|
+
Goal of the creator project is to make it simple to create and build Android and iOS projects with Rust and connect them with Substrate Blockchain. This plugin works only with [creator tool](https://github.com/creator-rs/creator) so you will need to [install it](https://github.com/creator-rs/creator/wiki/Command-line-tool) first.
|
18
16
|
|
19
17
|
## Example
|
20
18
|
|
21
|
-
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
22
|
-
|
23
|
-
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
19
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`. You will need to change Fastlane props to yours. To read more about this - please check out our [documentation](https://github.com/creator-rs/creator/wiki/Fastlane-automation) for this.
|
24
20
|
|
25
21
|
## Run tests for this plugin
|
26
22
|
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/creator_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class CreatorBuildAndroidAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
UI.message("Building project for android with creator")
|
9
|
+
|
10
|
+
(!params.nil? && !params[:project_path].nil?) || UI.user_error!("Mandatory parameter :project_path not specified")
|
11
|
+
|
12
|
+
#
|
13
|
+
# Params
|
14
|
+
#
|
15
|
+
project_path = params[:project_path]
|
16
|
+
sign_key_path = params[:sign_key_path]
|
17
|
+
sign_key_pass = params[:sign_key_pass]
|
18
|
+
build_envs = params[:build_envs]
|
19
|
+
|
20
|
+
creator_bin = Helper::CreatorHelper.ensure_creator_exists
|
21
|
+
if !creator_bin.nil?
|
22
|
+
UI.message("Creator exists!")
|
23
|
+
else
|
24
|
+
UI.message("Creator does not exists!")
|
25
|
+
end
|
26
|
+
|
27
|
+
cmd = "#{build_envs} #{creator_bin} build android --release"
|
28
|
+
cmd += " --sign-key-path=#{sign_key_path} --sign-key-pass=#{sign_key_pass}"
|
29
|
+
if system("cd #{project_path} && #{cmd}")
|
30
|
+
UI.message("Success!")
|
31
|
+
else
|
32
|
+
UI.user_error!("Failed to build project with creator")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.description
|
37
|
+
"Builds apk file from rust project"
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.authors
|
41
|
+
["David Ackerman"]
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.return_value
|
45
|
+
# If your method provides a return value, you can describe here what it does
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.details
|
49
|
+
# Optional
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.available_options
|
53
|
+
[
|
54
|
+
FastlaneCore::ConfigItem.new(key: :project_path,
|
55
|
+
env_name: 'CREATOR_PROJECT_PATH',
|
56
|
+
description: 'Path to Rust project with Cargo.toml',
|
57
|
+
optional: false),
|
58
|
+
FastlaneCore::ConfigItem.new(key: :sign_key_path,
|
59
|
+
env_name: 'CREATOR_SIGN_KEY_PATH',
|
60
|
+
description: 'Path to the signing key',
|
61
|
+
optional: false),
|
62
|
+
FastlaneCore::ConfigItem.new(key: :sign_key_pass,
|
63
|
+
env_name: 'CREATOR_SIGN_KEY_PASS',
|
64
|
+
description: 'Password for the signing key',
|
65
|
+
optional: false),
|
66
|
+
FastlaneCore::ConfigItem.new(key: :build_envs,
|
67
|
+
env_name: 'CREATOR_BUILD_ENVS',
|
68
|
+
description: 'Build environment variables',
|
69
|
+
optional: true)
|
70
|
+
]
|
71
|
+
end
|
72
|
+
|
73
|
+
def self.is_supported?(platform)
|
74
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
75
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
76
|
+
[:android].include?(platform)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/creator_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class CreatorBuildIosAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
UI.message("Building project for ios with creator")
|
9
|
+
|
10
|
+
(!params.nil? && !params[:project_path].nil?) || UI.user_error!("Mandatory parameter :project_path not specified")
|
11
|
+
|
12
|
+
#
|
13
|
+
# Params
|
14
|
+
#
|
15
|
+
project_path = params[:project_path]
|
16
|
+
profile_path = params[:profile_path]
|
17
|
+
team_id = params[:team_id]
|
18
|
+
identity = params[:identity]
|
19
|
+
|
20
|
+
creator_bin = Helper::CreatorHelper.ensure_creator_exists
|
21
|
+
if !creator_bin.nil?
|
22
|
+
UI.message("Creator exists!")
|
23
|
+
else
|
24
|
+
UI.message("Creator does not exists!")
|
25
|
+
end
|
26
|
+
|
27
|
+
cmd = "#{creator_bin} build apple --release --target=aarch64-apple-ios"
|
28
|
+
cmd += " --profile-path=#{profile_path}"
|
29
|
+
cmd += " --team-identifier=#{team_id}"
|
30
|
+
cmd += " --identity=#{identity}"
|
31
|
+
if system("cd #{project_path} && #{cmd}")
|
32
|
+
UI.message("Success!")
|
33
|
+
else
|
34
|
+
UI.user_error!("Failed to build project with creator")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.description
|
39
|
+
"Builds ipa file from rust project"
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.authors
|
43
|
+
["David Ackerman"]
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.return_value
|
47
|
+
# If your method provides a return value, you can describe here what it does
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.details
|
51
|
+
# Optional
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.available_options
|
55
|
+
[
|
56
|
+
FastlaneCore::ConfigItem.new(key: :project_path,
|
57
|
+
env_name: 'CREATOR_PROJECT_PATH',
|
58
|
+
description: 'Path to Rust project with Cargo.toml',
|
59
|
+
optional: false),
|
60
|
+
FastlaneCore::ConfigItem.new(key: :profile_path,
|
61
|
+
env_name: 'CREATOR_PROFILE_PATH',
|
62
|
+
description: 'Apple Profile path for signing',
|
63
|
+
optional: false),
|
64
|
+
FastlaneCore::ConfigItem.new(key: :team_id,
|
65
|
+
env_name: 'CREATOR_TEAM_ID',
|
66
|
+
description: 'Apple Team ID for signing',
|
67
|
+
optional: false),
|
68
|
+
FastlaneCore::ConfigItem.new(key: :identity,
|
69
|
+
env_name: 'CREATOR_IDENTITY',
|
70
|
+
description: 'Apple identity for signing',
|
71
|
+
optional: false)
|
72
|
+
]
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.is_supported?(platform)
|
76
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
77
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
78
|
+
[:ios].include?(platform)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -5,11 +5,35 @@ module Fastlane
|
|
5
5
|
|
6
6
|
module Helper
|
7
7
|
class CreatorHelper
|
8
|
-
|
9
|
-
|
8
|
+
def self.ensure_creator_exists
|
9
|
+
if !self.which("creator").nil?
|
10
|
+
return "creator"
|
11
|
+
elsif !self.which("cargo-creator").nil?
|
12
|
+
return "cargo-creator"
|
13
|
+
else
|
14
|
+
return nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# Cross-platform way of finding an executable in the $PATH.
|
19
|
+
#
|
20
|
+
# which('ruby') #=> /usr/bin/ruby
|
21
|
+
def self.which(cmd)
|
22
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
23
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
24
|
+
exts.each do |ext|
|
25
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
26
|
+
return exe if File.executable?(exe) && !File.directory?(exe)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Find any existing Rust project
|
10
34
|
#
|
11
|
-
def self.
|
12
|
-
|
35
|
+
def self.find_default_rust_project
|
36
|
+
Dir["./*.toml"].last || nil
|
13
37
|
end
|
14
38
|
end
|
15
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-creator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Ackerman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -145,7 +145,8 @@ files:
|
|
145
145
|
- LICENSE
|
146
146
|
- README.md
|
147
147
|
- lib/fastlane/plugin/creator.rb
|
148
|
-
- lib/fastlane/plugin/creator/actions/
|
148
|
+
- lib/fastlane/plugin/creator/actions/creator_build_android_action.rb
|
149
|
+
- lib/fastlane/plugin/creator/actions/creator_build_ios_action.rb
|
149
150
|
- lib/fastlane/plugin/creator/helper/creator_helper.rb
|
150
151
|
- lib/fastlane/plugin/creator/version.rb
|
151
152
|
homepage: https://github.com/creator-rs/fastlane-plugin
|
@@ -167,7 +168,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
168
|
- !ruby/object:Gem::Version
|
168
169
|
version: '0'
|
169
170
|
requirements: []
|
170
|
-
|
171
|
+
rubyforge_project:
|
172
|
+
rubygems_version: 2.6.14.4
|
171
173
|
signing_key:
|
172
174
|
specification_version: 4
|
173
175
|
summary: Mobile build framework for rust-lang
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'fastlane/action'
|
2
|
-
require_relative '../helper/creator_helper'
|
3
|
-
|
4
|
-
module Fastlane
|
5
|
-
module Actions
|
6
|
-
class CreatorAction < Action
|
7
|
-
def self.run(params)
|
8
|
-
UI.message("The creator plugin is working!")
|
9
|
-
end
|
10
|
-
|
11
|
-
def self.description
|
12
|
-
"Mobile build framework for rust-lang"
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.authors
|
16
|
-
["David Ackerman"]
|
17
|
-
end
|
18
|
-
|
19
|
-
def self.return_value
|
20
|
-
# If your method provides a return value, you can describe here what it does
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.details
|
24
|
-
# Optional:
|
25
|
-
"Mobile build framework for rust-lang"
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.available_options
|
29
|
-
[
|
30
|
-
# FastlaneCore::ConfigItem.new(key: :your_option,
|
31
|
-
# env_name: "CREATOR_YOUR_OPTION",
|
32
|
-
# description: "A description of your option",
|
33
|
-
# optional: false,
|
34
|
-
# type: String)
|
35
|
-
]
|
36
|
-
end
|
37
|
-
|
38
|
-
def self.is_supported?(platform)
|
39
|
-
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
40
|
-
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
41
|
-
#
|
42
|
-
# [:ios, :mac, :android].include?(platform)
|
43
|
-
true
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|