fastlane-plugin-fivethree_ionic 0.1.4 → 0.1.5
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 +4 -4
- data/lib/fastlane/plugin/fivethree_ionic/actions/fiv_android_keystore_action.rb +129 -0
- data/lib/fastlane/plugin/fivethree_ionic/actions/fiv_clean_install.rb +98 -0
- data/lib/fastlane/plugin/fivethree_ionic/actions/fiv_ionic.rb +289 -0
- data/lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb +109 -0
- data/lib/fastlane/plugin/fivethree_ionic/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4aec649ee473a5d82c3c6e8fa933a065ab33efa2
|
4
|
+
data.tar.gz: d736a7dfd30c87a7971a4e98e27f1f0c3452ecc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 754cc6f0659efd2a61bb29541aaba65042d27853c85addd13745cae57db7363f2fd29fe27b430f933163d236fb7277e77e09ffc780523b731efcbd47bcce7c46
|
7
|
+
data.tar.gz: ca5b01f7c0251c565dca7df5306bc25166ed14559155f039d683d333e393da467577b9e66c1721ad491033ff0ef30dae5c8adf70718cd7ffcb49f065757862c7
|
@@ -0,0 +1,129 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
ANDROID_KEYSTORE_KEYSTORE_PATH = :ANDROID_KEYSTORE_KEYSTORE_PATH
|
5
|
+
ANDROID_KEYSTORE_RELEASE_SIGNING_PATH = :ANDROID_KEYSTORE_RELEASE_SIGNING_PATH
|
6
|
+
end
|
7
|
+
|
8
|
+
class FivAndroidKeystoreAction < Action
|
9
|
+
def self.run(params)
|
10
|
+
|
11
|
+
output_directory = params[:output_directory]
|
12
|
+
keystore_name = params[:keystore_name]
|
13
|
+
keystore_path = File.join(output_directory, keystore_name) + '.keystore'
|
14
|
+
|
15
|
+
# Validating output doesn't exist yet for our android signing info
|
16
|
+
if File.directory?(output_directory)
|
17
|
+
if File.exists?(keystore_path)
|
18
|
+
return keystore_path
|
19
|
+
end
|
20
|
+
else
|
21
|
+
UI.message "android keystore doesnt exist yet. creating one for you..."
|
22
|
+
Dir.mkdir output_directory
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
puts "Please enter the keystore password for new keystore:"
|
27
|
+
keychain_entry = CredentialsManager::AccountManager.new(user: "#{keystore_name}_android_keystore_storepass")
|
28
|
+
password = keychain_entry.password
|
29
|
+
|
30
|
+
puts "Please enter the keystore password for new keystore:"
|
31
|
+
keypass_entry = CredentialsManager::AccountManager.new(user: "#{keystore_name}_android_keystore_keypass")
|
32
|
+
key_password = keypass_entry.password
|
33
|
+
|
34
|
+
alias_name = Fastlane::Actions::PromptAction.run(text:"Enter kexystore alias")
|
35
|
+
|
36
|
+
|
37
|
+
full_name = Fastlane::Actions::PromptAction.run(text:"Enter kexystore full name")
|
38
|
+
org = Fastlane::Actions::PromptAction.run(text:"Enter kexystore org")
|
39
|
+
org_unit = Fastlane::Actions::PromptAction.run(text:"Enter kexystore org unit")
|
40
|
+
city_locality = Fastlane::Actions::PromptAction.run(text:"Enter city")
|
41
|
+
state_province = Fastlane::Actions::PromptAction.run(text:"Enter state")
|
42
|
+
country = Fastlane::Actions::PromptAction.run(text:"country")
|
43
|
+
|
44
|
+
Actions.lane_context[SharedValues::ANDROID_KEYSTORE_KEYSTORE_PATH] = keystore_path
|
45
|
+
|
46
|
+
# Create keystore with command
|
47
|
+
unless File.file?(keystore_path)
|
48
|
+
keytool_parts = [
|
49
|
+
"keytool -genkey -v",
|
50
|
+
"-keystore #{keystore_path}",
|
51
|
+
"-alias #{alias_name}",
|
52
|
+
"-keyalg RSA -keysize 2048 -validity 10000",
|
53
|
+
"-storepass #{password} ",
|
54
|
+
"-keypass #{key_password}",
|
55
|
+
"-dname \"CN=#{full_name}, OU=#{org_unit}, O=#{org}, L=#{city_locality}, S=#{state_province}, C=#{country}\"",
|
56
|
+
]
|
57
|
+
sh keytool_parts.join(" ")
|
58
|
+
else
|
59
|
+
UI.message "Keystore file already exists - #{keystore_path}"
|
60
|
+
end
|
61
|
+
|
62
|
+
# Create release-signing.properties for automatic signing with Ionic
|
63
|
+
|
64
|
+
release_signing_path = File.join(output_directory, "release-signing.properties")
|
65
|
+
Actions.lane_context[SharedValues::ANDROID_KEYSTORE_RELEASE_SIGNING_PATH] = release_signing_path
|
66
|
+
|
67
|
+
unless File.file?(release_signing_path)
|
68
|
+
out_file = File.new(release_signing_path, "w")
|
69
|
+
out_file.puts("storeFile=#{keystore_name}")
|
70
|
+
out_file.puts("storePassword=#{password}")
|
71
|
+
out_file.puts("keyAlias=#{alias_name}")
|
72
|
+
out_file.puts("keyPassword=#{key_password}")
|
73
|
+
out_file.close
|
74
|
+
else
|
75
|
+
UI.message "release-signing.properties file already exists - #{release_signing_path}"
|
76
|
+
end
|
77
|
+
|
78
|
+
return keystore_path
|
79
|
+
end
|
80
|
+
|
81
|
+
#####################################################
|
82
|
+
# @!group Documentation
|
83
|
+
#####################################################
|
84
|
+
|
85
|
+
def self.description
|
86
|
+
"Generate an Android keystore file"
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.details
|
90
|
+
"Generate an Android keystore file"
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.available_options
|
94
|
+
[
|
95
|
+
FastlaneCore::ConfigItem.new(key: :output_directory,
|
96
|
+
env_name: "ANDROID_KEYSTORE_OUTPUT_DIRECTORY",
|
97
|
+
description: "",
|
98
|
+
is_string: true,
|
99
|
+
optional: false,
|
100
|
+
default_value: File.absolute_path(File.join(Dir.pwd, ".android_signing"))),
|
101
|
+
FastlaneCore::ConfigItem.new(key: :keystore_name,
|
102
|
+
env_name: "ANDROID_KEYSTORE_KEYSTORE_NAME",
|
103
|
+
description: "",
|
104
|
+
is_string: true,
|
105
|
+
optional: false)
|
106
|
+
]
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.output
|
110
|
+
[
|
111
|
+
['ANDROID_KEYSTORE_KEYSTORE_PATH', 'Path to keystore'],
|
112
|
+
['ANDROID_KEYSTORE_RELEASE_SIGNING_PATH', 'Path to release-signing.properties']
|
113
|
+
]
|
114
|
+
end
|
115
|
+
|
116
|
+
def self.return_value
|
117
|
+
"Path to keystore"
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.authors
|
121
|
+
["fivethree"]
|
122
|
+
end
|
123
|
+
|
124
|
+
def self.is_supported?(platform)
|
125
|
+
platform == :android
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
FIV_BUILD_IONIC_ANDROID_CUSTOM_VALUE = :FIV_BUILD_IONIC_ANDROID_CUSTOM_VALUE
|
5
|
+
end
|
6
|
+
|
7
|
+
class FivCleanInstallAction < Action
|
8
|
+
def self.run(params)
|
9
|
+
if params[:platform].to_s == 'ios' || params[:platform].to_s == 'android'
|
10
|
+
sh "rm -rf node_modules platforms/#{params[:platform]}"
|
11
|
+
elsif params[:platform].to_s == 'browser'
|
12
|
+
sh "rm -rf node_modules www"
|
13
|
+
end
|
14
|
+
|
15
|
+
if params[:plugins]
|
16
|
+
sh "rm -rf plugins"
|
17
|
+
end
|
18
|
+
|
19
|
+
sh "#{params[:package_manager]} install"
|
20
|
+
|
21
|
+
if params[:platform].to_s == 'ios' || params[:platform].to_s == 'android'
|
22
|
+
sh "ionic cordova platform add #{params[:platform]}"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
#####################################################
|
28
|
+
# @!group Documentation
|
29
|
+
#####################################################
|
30
|
+
|
31
|
+
def self.description
|
32
|
+
"A short description with <= 80 characters of what this action does"
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.details
|
36
|
+
# Optional:
|
37
|
+
# this is your chance to provide a more detailed description of this action
|
38
|
+
"You can use this action to do cool things..."
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.available_options
|
42
|
+
# Define all options your action supports.
|
43
|
+
|
44
|
+
# Below a few examples
|
45
|
+
[
|
46
|
+
FastlaneCore::ConfigItem.new(
|
47
|
+
key: :platform,
|
48
|
+
env_name: "CORDOVA_PLATFORM",
|
49
|
+
description: "Platform to build on. Can be android, ios or browser",
|
50
|
+
is_string: true,
|
51
|
+
default_value: '',
|
52
|
+
verify_block: proc do |value|
|
53
|
+
UI.user_error!("Platform should be either android, ios or browser") unless ['', 'android', 'ios', 'browser'].include? value
|
54
|
+
end
|
55
|
+
),
|
56
|
+
FastlaneCore::ConfigItem.new(
|
57
|
+
key: :plugins,
|
58
|
+
env_name: "REFRESH_PLUGINS",
|
59
|
+
description: "also refresh plugins",
|
60
|
+
default_value: false,
|
61
|
+
is_string: false
|
62
|
+
),
|
63
|
+
FastlaneCore::ConfigItem.new(
|
64
|
+
key: :package_manager,
|
65
|
+
env_name: "PACKAGE_MANAGER",
|
66
|
+
description: "What package manager to use to install dependencies: e.g. yarn | npm",
|
67
|
+
is_string: true,
|
68
|
+
default_value: 'npm',
|
69
|
+
verify_block: proc do |value|
|
70
|
+
UI.user_error!("Platform should be either android, ios or browser") unless ['', 'yarn', 'npm'].include? value
|
71
|
+
end
|
72
|
+
),
|
73
|
+
]
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.output
|
77
|
+
# Define the shared values you are going to provide
|
78
|
+
# Example
|
79
|
+
[
|
80
|
+
['FIV_BUILD_IONIC_ANDROID_CUSTOM_VALUE', 'A description of what this value contains']
|
81
|
+
]
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.return_value
|
85
|
+
# If your method provides a return value, you can describe here what it does
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.authors
|
89
|
+
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
|
90
|
+
["Your GitHub/Twitter Name"]
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.is_supported?(platform)
|
94
|
+
platform == :android
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,289 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
CORDOVA_IOS_RELEASE_BUILD_PATH = :CORDOVA_IOS_RELEASE_BUILD_PATH
|
5
|
+
CORDOVA_ANDROID_RELEASE_BUILD_PATH = :CORDOVA_ANDROID_RELEASE_BUILD_PATH
|
6
|
+
CORDOVA_PWA_RELEASE_BUILD_PATH = :CORDOVA_PWA_RELEASE_BUILD_PATH
|
7
|
+
end
|
8
|
+
|
9
|
+
class FivIonicAction < Action
|
10
|
+
|
11
|
+
ANDROID_ARGS_MAP = {
|
12
|
+
keystore_path: 'keystore',
|
13
|
+
keystore_password: 'storePassword',
|
14
|
+
key_password: 'password',
|
15
|
+
keystore_alias: 'alias',
|
16
|
+
}
|
17
|
+
|
18
|
+
IOS_ARGS_MAP = {
|
19
|
+
type: 'packageType',
|
20
|
+
team_id: 'developmentTeam',
|
21
|
+
provisioning_profile: 'provisioningProfile'
|
22
|
+
}
|
23
|
+
|
24
|
+
PWA_ARGS_MAP = {
|
25
|
+
|
26
|
+
}
|
27
|
+
|
28
|
+
# do rewriting and copying of action params
|
29
|
+
def self.get_platform_args(params, args_map)
|
30
|
+
platform_args = []
|
31
|
+
args_map.each do |action_key, cli_param|
|
32
|
+
param_value = params[action_key]
|
33
|
+
unless param_value.to_s.empty?
|
34
|
+
platform_args << "--#{cli_param}=#{Shellwords.escape(param_value)}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
return platform_args.join(' ')
|
39
|
+
end
|
40
|
+
|
41
|
+
# map action params to the cli param they will be used for
|
42
|
+
|
43
|
+
def self.get_android_args(params)
|
44
|
+
# TODO document magic in README
|
45
|
+
if params[:key_password].empty?
|
46
|
+
params[:key_password] = params[:keystore_password]
|
47
|
+
end
|
48
|
+
|
49
|
+
return self.get_platform_args(params, ANDROID_ARGS_MAP)
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.get_ios_args(params)
|
53
|
+
app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
|
54
|
+
|
55
|
+
if params[:provisioning_profile].empty?
|
56
|
+
# If `match` or `sigh` were used before this, use the certificates returned from there
|
57
|
+
params[:provisioning_profile] = ENV['SIGH_UUID'] || ENV["sigh_#{app_identifier}_#{params[:type].sub('-', '')}"]
|
58
|
+
end
|
59
|
+
|
60
|
+
if params[:type] == 'adhoc'
|
61
|
+
params[:type] = 'ad-hoc'
|
62
|
+
end
|
63
|
+
if params[:type] == 'appstore'
|
64
|
+
params[:type] = 'app-store'
|
65
|
+
end
|
66
|
+
|
67
|
+
return self.get_platform_args(params, IOS_ARGS_MAP)
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.get_pwa_args(params)
|
71
|
+
return self.get_platform_args(params, PWA_ARGS_MAP)
|
72
|
+
end
|
73
|
+
|
74
|
+
# add cordova platform if missing (run #1)
|
75
|
+
def self.check_and_add_platform(platform)
|
76
|
+
if platform && !File.directory?("./platforms/#{platform}")
|
77
|
+
sh "ionic cordova platform add #{platform}"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# app_name
|
82
|
+
def self.get_app_name
|
83
|
+
config = REXML::Document.new(File.open('config.xml'))
|
84
|
+
return config.elements['widget'].elements['name'].first.value # TODO: Simplify!? (Check logic in cordova)
|
85
|
+
end
|
86
|
+
|
87
|
+
# actual building! (run #2)
|
88
|
+
def self.build(params)
|
89
|
+
args = [params[:release] ? '--release' : '--debug']
|
90
|
+
args << '--prod' if params[:prod]
|
91
|
+
android_args = self.get_android_args(params) if params[:platform].to_s == 'android'
|
92
|
+
ios_args = self.get_ios_args(params) if params[:platform].to_s == 'ios'
|
93
|
+
pwa_args = self.get_pwa_args(params) if params[:platform].to_s == 'browser'
|
94
|
+
|
95
|
+
if params[:cordova_prepare]
|
96
|
+
# TODO: Remove params not allowed/used for `prepare`
|
97
|
+
sh "ionic cordova prepare #{params[:platform]} #{args.join(' ')}"
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
if params[:platform].to_s == 'ios'
|
102
|
+
sh "ionic cordova compile #{params[:platform]} #{args.join(' ')} -- #{ios_args}"
|
103
|
+
elsif params[:platform].to_s == 'android'
|
104
|
+
sh "ionic cordova compile #{params[:platform]} #{args.join(' ')} -- -- #{android_args}"
|
105
|
+
elsif params[:platform].to_s == 'browser'
|
106
|
+
sh "ionic cordova compile #{params[:platform]} #{args.join(' ')} -- -- #{pwa_args}"
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# export build paths (run #3)
|
111
|
+
def self.set_build_paths(is_release)
|
112
|
+
app_name = self.get_app_name
|
113
|
+
build_type = is_release ? 'release' : 'debug'
|
114
|
+
|
115
|
+
ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'] = "./platforms/android/build/outputs/apk/android-#{build_type}.apk"
|
116
|
+
ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'] = "./platforms/ios/build/device/#{app_name}.ipa"
|
117
|
+
ENV['CORDOVA_PWA_RELEASE_BUILD_PATH'] = "./www"
|
118
|
+
|
119
|
+
# TODO: https://github.com/bamlab/fastlane-plugin-cordova/issues/7
|
120
|
+
end
|
121
|
+
|
122
|
+
def self.run(params)
|
123
|
+
if params[:fresh]
|
124
|
+
Fastlane::Actions::FivCleanInstallAction.run(params)
|
125
|
+
end
|
126
|
+
self.check_and_add_platform(params[:platform])
|
127
|
+
self.build(params)
|
128
|
+
self.set_build_paths(params[:release])
|
129
|
+
end
|
130
|
+
|
131
|
+
#####################################################
|
132
|
+
# @!group Documentation
|
133
|
+
#####################################################
|
134
|
+
|
135
|
+
def self.description
|
136
|
+
"Build your Ionic app"
|
137
|
+
end
|
138
|
+
|
139
|
+
def self.details
|
140
|
+
"Easily integrate your Ionic build into a Fastlane setup"
|
141
|
+
end
|
142
|
+
|
143
|
+
def self.available_options
|
144
|
+
[
|
145
|
+
FastlaneCore::ConfigItem.new(
|
146
|
+
key: :platform,
|
147
|
+
env_name: "CORDOVA_PLATFORM",
|
148
|
+
description: "Platform to build on. Can be android, ios or browser",
|
149
|
+
is_string: true,
|
150
|
+
default_value: '',
|
151
|
+
verify_block: proc do |value|
|
152
|
+
UI.user_error!("Platform should be either android or ios") unless ['', 'android', 'ios', 'browser'].include? value
|
153
|
+
end
|
154
|
+
),
|
155
|
+
FastlaneCore::ConfigItem.new(
|
156
|
+
key: :release,
|
157
|
+
env_name: "CORDOVA_RELEASE",
|
158
|
+
description: "Build for release if true, or for debug if false",
|
159
|
+
is_string: false,
|
160
|
+
default_value: true,
|
161
|
+
verify_block: proc do |value|
|
162
|
+
UI.user_error!("Release should be boolean") unless [false, true].include? value
|
163
|
+
end
|
164
|
+
),
|
165
|
+
FastlaneCore::ConfigItem.new(
|
166
|
+
key: :prod,
|
167
|
+
env_name: "IONIC_PROD",
|
168
|
+
description: "Build for production",
|
169
|
+
is_string: false,
|
170
|
+
default_value: false,
|
171
|
+
verify_block: proc do |value|
|
172
|
+
UI.user_error!("Prod should be boolean") unless [false, true].include? value
|
173
|
+
end
|
174
|
+
),
|
175
|
+
FastlaneCore::ConfigItem.new(
|
176
|
+
key: :type,
|
177
|
+
env_name: "CORDOVA_IOS_PACKAGE_TYPE",
|
178
|
+
description: "This will determine what type of build is generated by Xcode. Valid options are development, enterprise, adhoc, and appstore",
|
179
|
+
is_string: true,
|
180
|
+
default_value: 'appstore',
|
181
|
+
verify_block: proc do |value|
|
182
|
+
UI.user_error!("Valid options are development, enterprise, adhoc, and appstore.") unless ['development', 'enterprise', 'adhoc', 'appstore', 'ad-hoc', 'app-store'].include? value
|
183
|
+
end
|
184
|
+
),
|
185
|
+
FastlaneCore::ConfigItem.new(
|
186
|
+
key: :team_id,
|
187
|
+
env_name: "CORDOVA_IOS_TEAM_ID",
|
188
|
+
description: "The development team (Team ID) to use for code signing",
|
189
|
+
is_string: true,
|
190
|
+
default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
|
191
|
+
),
|
192
|
+
FastlaneCore::ConfigItem.new(
|
193
|
+
key: :provisioning_profile,
|
194
|
+
env_name: "CORDOVA_IOS_PROVISIONING_PROFILE",
|
195
|
+
description: "GUID of the provisioning profile to be used for signing",
|
196
|
+
is_string: true,
|
197
|
+
default_value: ''
|
198
|
+
),
|
199
|
+
FastlaneCore::ConfigItem.new(
|
200
|
+
key: :keystore_path,
|
201
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_PATH",
|
202
|
+
description: "Path to the Keystore for Android",
|
203
|
+
is_string: true,
|
204
|
+
default_value: ''
|
205
|
+
),
|
206
|
+
FastlaneCore::ConfigItem.new(
|
207
|
+
key: :keystore_password,
|
208
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_PASSWORD",
|
209
|
+
description: "Android Keystore password",
|
210
|
+
is_string: true,
|
211
|
+
default_value: ''
|
212
|
+
),
|
213
|
+
FastlaneCore::ConfigItem.new(
|
214
|
+
key: :key_password,
|
215
|
+
env_name: "CORDOVA_ANDROID_KEY_PASSWORD",
|
216
|
+
description: "Android Key password (default is keystore password)",
|
217
|
+
is_string: true,
|
218
|
+
default_value: ''
|
219
|
+
),
|
220
|
+
FastlaneCore::ConfigItem.new(
|
221
|
+
key: :keystore_alias,
|
222
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_ALIAS",
|
223
|
+
description: "Android Keystore alias",
|
224
|
+
is_string: true,
|
225
|
+
default_value: ''
|
226
|
+
),
|
227
|
+
FastlaneCore::ConfigItem.new(
|
228
|
+
key: :cordova_prepare,
|
229
|
+
env_name: "CORDOVA_PREPARE",
|
230
|
+
description: "Specifies whether to run `ionic cordova prepare` before building",
|
231
|
+
default_value: true,
|
232
|
+
is_string: false
|
233
|
+
),
|
234
|
+
FastlaneCore::ConfigItem.new(
|
235
|
+
key: :fresh,
|
236
|
+
env_name: "BUILD_FRESH",
|
237
|
+
description: "Clean install packages, plugins and platform",
|
238
|
+
default_value: false,
|
239
|
+
is_string: false
|
240
|
+
),
|
241
|
+
FastlaneCore::ConfigItem.new(
|
242
|
+
key: :plugins,
|
243
|
+
env_name: "REFRESH_PLUGINS",
|
244
|
+
description: "also refresh plugins",
|
245
|
+
default_value: false,
|
246
|
+
is_string: false
|
247
|
+
),
|
248
|
+
FastlaneCore::ConfigItem.new(
|
249
|
+
key: :package_manager,
|
250
|
+
env_name: "PACKAGE_MANAGER",
|
251
|
+
description: "What package manager to use to install dependencies: e.g. yarn | npm",
|
252
|
+
is_string: true,
|
253
|
+
default_value: 'npm',
|
254
|
+
verify_block: proc do |value|
|
255
|
+
UI.user_error!("Platform should be either android, ios or browser") unless ['', 'yarn', 'npm'].include? value
|
256
|
+
end
|
257
|
+
),
|
258
|
+
]
|
259
|
+
end
|
260
|
+
|
261
|
+
def self.output
|
262
|
+
[
|
263
|
+
['CORDOVA_ANDROID_RELEASE_BUILD_PATH', 'Path to the signed release APK if it was generated'],
|
264
|
+
['CORDOVA_IOS_RELEASE_BUILD_PATH', 'Path to the signed release IPA if it was generated']
|
265
|
+
]
|
266
|
+
end
|
267
|
+
|
268
|
+
def self.authors
|
269
|
+
['fivethree']
|
270
|
+
end
|
271
|
+
|
272
|
+
def self.is_supported?(platform)
|
273
|
+
true
|
274
|
+
end
|
275
|
+
|
276
|
+
def self.example_code
|
277
|
+
[
|
278
|
+
"ionic(
|
279
|
+
platform: 'ios'
|
280
|
+
)"
|
281
|
+
]
|
282
|
+
end
|
283
|
+
|
284
|
+
def self.category
|
285
|
+
:building
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
@@ -0,0 +1,109 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
CORDOVA_IOS_RELEASE_BUILD_PATH = :CORDOVA_IOS_RELEASE_BUILD_PATH
|
5
|
+
CORDOVA_ANDROID_RELEASE_BUILD_PATH = :CORDOVA_ANDROID_RELEASE_BUILD_PATH
|
6
|
+
end
|
7
|
+
|
8
|
+
class FivSignAndroidAction < Action
|
9
|
+
def self.run(params)
|
10
|
+
|
11
|
+
|
12
|
+
keystore_path = Fastlane::Actions::FivAndroidKeystoreAction.run(params)
|
13
|
+
|
14
|
+
keychain_entry = CredentialsManager::AccountManager.new(user: "#{params[:keystore_name]}_android_keystore_storepass")
|
15
|
+
keystore_storepass = keychain_entry.password
|
16
|
+
|
17
|
+
keychain_entry = CredentialsManager::AccountManager.new(user: "#{params[:keystore_name]}_android_keystore_keypass")
|
18
|
+
keystore_keypass = keychain_entry.password
|
19
|
+
|
20
|
+
puts "Silent execution of jarsigner because we don't want to print passwords. You can delete the password if they are wrong stored in the keychain: 'fastlane fastlane-credentials remove --username android_keystore_storepass' and 'fastlane fastlane-credentials remove --username android_keystore_keypass'"
|
21
|
+
sign = "jarsigner -tsa http://timestamp.digicert.com -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore #{keystore_path} -storepass #{keystore_storepass} -keypass #{keystore_keypass} ./platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk fivethree"
|
22
|
+
path = "./platforms/android/app/build/outputs/apk/release/app-release-#{params[:version]}-#{params[:build_no]}.apk"
|
23
|
+
zipalign = "$ANDROID_SDK/build-tools/$ANDROID_BUILD_TOOL_VERSION/zipalign -v 4 \"./platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk\" \"#{path}\""
|
24
|
+
self.run_silent(sign)
|
25
|
+
self.run_silent(zipalign)
|
26
|
+
|
27
|
+
return path
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
#####################################################
|
32
|
+
# @!group Documentation
|
33
|
+
#####################################################
|
34
|
+
|
35
|
+
def self.description
|
36
|
+
"A short description with <= 80 characters of what this action does"
|
37
|
+
end
|
38
|
+
def self.run_silent(command)
|
39
|
+
Fastlane::Actions::sh(command, log: false)
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
def self.details
|
44
|
+
# Optional:
|
45
|
+
# this is your chance to provide a more detailed description of this action
|
46
|
+
"You can use this action to do cool things..."
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.available_options
|
50
|
+
# Define all options your action supports.
|
51
|
+
|
52
|
+
# Below a few examples
|
53
|
+
[
|
54
|
+
FastlaneCore::ConfigItem.new(key: :output_directory,
|
55
|
+
env_name: "ANDROID_KEYSTORE_OUTPUT_DIRECTORY",
|
56
|
+
description: "",
|
57
|
+
is_string: true,
|
58
|
+
optional: false,
|
59
|
+
default_value: File.absolute_path(File.join(Dir.pwd, ".android_signing"))),
|
60
|
+
FastlaneCore::ConfigItem.new(key: :keystore_name,
|
61
|
+
env_name: "ANDROID_KEYSTORE_KEYSTORE_NAME",
|
62
|
+
description: "",
|
63
|
+
is_string: true,
|
64
|
+
optional: false),
|
65
|
+
FastlaneCore::ConfigItem.new(key: :alias,
|
66
|
+
env_name: "ANDROID_KEYSTORE_KEYSTORE_ALIAS",
|
67
|
+
description: "",
|
68
|
+
is_string: true,
|
69
|
+
optional: false),
|
70
|
+
FastlaneCore::ConfigItem.new(
|
71
|
+
key: :version,
|
72
|
+
env_name: "CURRENT_BUILD_VERSION",
|
73
|
+
description: "current build version from config.xml",
|
74
|
+
is_string: true,
|
75
|
+
default_value: ''
|
76
|
+
),
|
77
|
+
FastlaneCore::ConfigItem.new(
|
78
|
+
key: :build_no,
|
79
|
+
env_name: "CURRENT_BUILD_NUMBER",
|
80
|
+
description: "current build number from config.xml",
|
81
|
+
is_string: true,
|
82
|
+
default_value: ''
|
83
|
+
)
|
84
|
+
]
|
85
|
+
end
|
86
|
+
|
87
|
+
def self.output
|
88
|
+
# Define the shared values you are going to provide
|
89
|
+
# Example
|
90
|
+
[
|
91
|
+
['FIV_BUILD_IONIC_ANDROID_CUSTOM_VALUE', 'A description of what this value contains']
|
92
|
+
]
|
93
|
+
end
|
94
|
+
|
95
|
+
def self.return_value
|
96
|
+
# If your method provides a return value, you can describe here what it does
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.authors
|
100
|
+
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
|
101
|
+
["Your GitHub/Twitter Name"]
|
102
|
+
end
|
103
|
+
|
104
|
+
def self.is_supported?(platform)
|
105
|
+
platform == :android
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-fivethree_ionic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Stammerjohann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -146,9 +146,13 @@ files:
|
|
146
146
|
- README.md
|
147
147
|
- lib/fastlane/plugin/fivethree_ionic.rb
|
148
148
|
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_add_transparent_statusbar.rb
|
149
|
+
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_android_keystore_action.rb
|
149
150
|
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_build_ionic_android.rb
|
150
151
|
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_bump_version.rb
|
152
|
+
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_clean_install.rb
|
151
153
|
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_increment_build_no.rb
|
154
|
+
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_ionic.rb
|
155
|
+
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_sign_android.rb
|
152
156
|
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version.rb
|
153
157
|
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_update_version_and_build_no.rb
|
154
158
|
- lib/fastlane/plugin/fivethree_ionic/actions/fiv_version.rb
|