fastlane-plugin-cordova 2.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b5b2458d8d510b739b9c972d12c42e5cd3f54639
4
- data.tar.gz: 3e8e159db5d56b803107684ec86c3eb6e2fe1c4d
2
+ SHA256:
3
+ metadata.gz: a6a4b5b48aa28034b00f28805ce38d774482cb0b1395276e2ca2f41e1be8cbb8
4
+ data.tar.gz: e19f9770b313b16898a2fcfd82f2fbd3c1bed883b1f7c98a4b85582b2ff6b85f
5
5
  SHA512:
6
- metadata.gz: 3cecb5a0af264f126416a023005dd2361b66bc26fdce87bdb84caad30747993f41ae25b1d1aec88a715337b713bca6e3ea6028ac5b0b5635c2033e0ead83327e
7
- data.tar.gz: 0b30240650e59f05a54d3e4060975fb54758bd0f9e5920e5d14995815fad2a2721b0e98e7b4551aa8d773bd4c0d8c934988d79b5d1cfe94c2c07aa7b023becfe
6
+ metadata.gz: 29793953c8d3ba76fced81de00c853cd9b7f2627b4f535fccc77c83d8930a60ca08d61cbb7095d10d4f3c09494f678011f09375f77792da91465d5cccf764f0f
7
+ data.tar.gz: d2736e308f3da7e4cd4586c3a61717a711fadf50bd358eb6adbbb903baa61996775e6455cdab1fbe7db91cfd754d90a9d8d5c6f6328e0061448d3cfd336fd9d1
data/README.md CHANGED
@@ -41,6 +41,16 @@ platform :android do
41
41
  keystore_password: 'password'
42
42
  )
43
43
  supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])
44
+
45
+ # Alternatively, deploy an Android Application Bundle
46
+ # cordova(
47
+ # package_type: 'bundle',
48
+ # platform: 'android',
49
+ # keystore_path: './prod.keystore',
50
+ # keystore_alias: 'prod',
51
+ # keystore_password: 'password'
52
+ # )
53
+ # supply(aab: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])
44
54
  end
45
55
  end
46
56
  ```
@@ -79,7 +89,9 @@ Which will produce:
79
89
  | **device** | Build for device | CORDOVA_DEVICE | *true* |
80
90
  | **type** | This will determine what type of build is generated by Xcode. <br>Valid options are development, enterprise, adhoc, and appstore| CORDOVA_IOS_PACKAGE_TYPE | appstore |
81
91
  | **team_id** | The development team (Team ID) to use for code signing | CORDOVA_IOS_TEAM_ID | *28323HT* |
92
+ | **build_flag** | An array of Xcode buildFlag. Will be appended on compile command. | CORDOVA_IOS_BUILD_FLAG | [] |
82
93
  | **provisioning_profile** | GUID of the provisioning profile to be used for signing | CORDOVA_IOS_PROVISIONING_PROFILE | |
94
+ | **package_type** | This will determine what type of Android build is generated. <br>Valid options are apk and bundle | CORDOVA_ANDROID_PACKAGE_TYPE | apk |
83
95
  | **keystore_path** | Path to the Keystore for Android | CORDOVA_ANDROID_KEYSTORE_PATH | |
84
96
  | **keystore_password** | Android Keystore password | CORDOVA_ANDROID_KEYSTORE_PASSWORD | |
85
97
  | **key_password** | Android Key password (default is keystore password) | CORDOVA_ANDROID_KEY_PASSWORD | |
@@ -89,6 +101,7 @@ Which will produce:
89
101
  | **browserify** | Specifies whether to browserify build or not | CORDOVA_BROWSERIFY | *false* |
90
102
  | **cordova_prepare** | Specifies whether to run `cordova prepare` before building | CORDOVA_PREPARE | *true* |
91
103
  | **cordova_no_fetch** | Specifies whether to run `cordova platform add` with `--nofetch` parameter | CORDOVA_NO_FETCH | *false* |
104
+ | **cordova_build_config_file** | Call `cordova compile` with `--buildConfig=<ConfigFile>` to specify build config file path | CORDOVA_BUILD_CONFIG_FILE | |
92
105
 
93
106
  ## Run tests for this plugin
94
107
 
@@ -13,21 +13,32 @@ module Fastlane
13
13
  keystore_alias: 'alias',
14
14
  build_number: 'versionCode',
15
15
  min_sdk_version: 'gradleArg=-PcdvMinSdkVersion',
16
- cordova_no_fetch: 'cordovaNoFetch'
16
+ cordova_no_fetch: 'cordovaNoFetch',
17
+ package_type: 'packageType'
17
18
  }
18
19
 
19
20
  IOS_ARGS_MAP = {
20
21
  type: 'packageType',
21
22
  team_id: 'developmentTeam',
22
23
  provisioning_profile: 'provisioningProfile',
24
+ build_flag: 'buildFlag'
23
25
  }
24
26
 
25
27
  def self.get_platform_args(params, args_map)
26
28
  platform_args = []
27
29
  args_map.each do |action_key, cli_param|
28
30
  param_value = params[action_key]
29
- unless param_value.to_s.empty?
30
- platform_args << "--#{cli_param}=#{Shellwords.escape(param_value)}"
31
+
32
+ if action_key.to_s == 'build_flag' && param_value.kind_of?(Array)
33
+ unless param_value.empty?
34
+ param_value.each do |flag|
35
+ platform_args << "--#{cli_param}=#{flag.shellescape}"
36
+ end
37
+ end
38
+ else
39
+ unless param_value.to_s.empty?
40
+ platform_args << "--#{cli_param}=#{Shellwords.escape(param_value)}"
41
+ end
31
42
  end
32
43
  end
33
44
 
@@ -63,9 +74,9 @@ module Fastlane
63
74
  platform = params[:platform]
64
75
  if platform && !File.directory?("./platforms/#{platform}")
65
76
  if params[:cordova_no_fetch]
66
- sh "cordova platform add #{platform} --nofetch"
77
+ sh "npx --no-install cordova platform add #{platform} --nofetch"
67
78
  else
68
- sh "cordova platform add #{platform}"
79
+ sh "npx --no-install cordova platform add #{platform}"
69
80
  end
70
81
  end
71
82
  end
@@ -79,11 +90,16 @@ module Fastlane
79
90
  args = [params[:release] ? '--release' : '--debug']
80
91
  args << '--device' if params[:device]
81
92
  args << '--browserify' if params[:browserify]
93
+
94
+ if !params[:cordova_build_config_file].to_s.empty?
95
+ args << "--buildConfig=#{Shellwords.escape(params[:cordova_build_config_file])}"
96
+ end
97
+
82
98
  android_args = self.get_android_args(params) if params[:platform].to_s == 'android'
83
99
  ios_args = self.get_ios_args(params) if params[:platform].to_s == 'ios'
84
100
 
85
101
  if params[:cordova_prepare]
86
- sh "cordova prepare #{params[:platform]} #{args.join(' ')} #{ios_args} -- #{android_args}"
102
+ sh "npx --no-install cordova prepare #{params[:platform]} #{args.join(' ')} #{ios_args} -- #{android_args}"
87
103
  end
88
104
 
89
105
  if params[:platform].to_s == 'ios' && !params[:build_number].to_s.empty?
@@ -97,14 +113,19 @@ module Fastlane
97
113
  )
98
114
  end
99
115
 
100
- sh "cordova compile #{params[:platform]} #{args.join(' ')} #{ios_args} -- #{android_args}"
116
+ sh "npx --no-install cordova compile #{params[:platform]} #{args.join(' ')} #{ios_args} -- #{android_args}"
101
117
  end
102
118
 
103
119
  def self.set_build_paths(is_release)
104
120
  app_name = self.get_app_name()
105
121
  build_type = is_release ? 'release' : 'debug'
106
122
 
107
- ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'] = "./platforms/android/app/build/outputs/apk/release/app-#{build_type}.apk"
123
+ # Update the build path accordingly if Android is being
124
+ # built as an Android Application Bundle.
125
+ android_package_type = params[:package_type] || 'apk'
126
+ android_package_extension = android_package_type == 'bundle' ? '.aab' : '.apk'
127
+
128
+ ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'] = "./platforms/android/app/build/outputs/#{android_package_type}/#{build_type}/app-#{build_type}#{android_package_extension}"
108
129
  ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'] = "./platforms/ios/build/device/#{app_name}.ipa"
109
130
  end
110
131
 
@@ -182,6 +203,16 @@ module Fastlane
182
203
  is_string: true,
183
204
  default_value: ''
184
205
  ),
206
+ FastlaneCore::ConfigItem.new(
207
+ key: :package_type,
208
+ env_name: "CORDOVA_ANDROID_PACKAGE_TYPE",
209
+ description: "This will determine what type of Android build is generated. Valid options are apk or bundle",
210
+ is_string: true,
211
+ default_value: 'apk',
212
+ verify_block: proc do |value|
213
+ UI.user_error!("Valid options are apk or bundle.") unless ['apk', 'bundle'].include? value
214
+ end
215
+ ),
185
216
  FastlaneCore::ConfigItem.new(
186
217
  key: :keystore_path,
187
218
  env_name: "CORDOVA_ANDROID_KEYSTORE_PATH",
@@ -227,7 +258,7 @@ module Fastlane
227
258
  FastlaneCore::ConfigItem.new(
228
259
  key: :cordova_prepare,
229
260
  env_name: "CORDOVA_PREPARE",
230
- description: "Specifies whether to run `cordova prepare` before building",
261
+ description: "Specifies whether to run `npx cordova prepare` before building",
231
262
  default_value: true,
232
263
  is_string: false
233
264
  ),
@@ -241,16 +272,32 @@ module Fastlane
241
272
  FastlaneCore::ConfigItem.new(
242
273
  key: :cordova_no_fetch,
243
274
  env_name: "CORDOVA_NO_FETCH",
244
- description: "Call `cordova platform add` with `--nofetch` parameter",
275
+ description: "Call `npx cordova platform add` with `--nofetch` parameter",
245
276
  default_value: false,
246
277
  is_string: false
278
+ ),
279
+ FastlaneCore::ConfigItem.new(
280
+ key: :build_flag,
281
+ env_name: "CORDOVA_IOS_BUILD_FLAG",
282
+ description: "An array of Xcode buildFlag. Will be appended on compile command",
283
+ is_string: false,
284
+ optional: true,
285
+ default_value: []
286
+ ),
287
+ FastlaneCore::ConfigItem.new(
288
+ key: :cordova_build_config_file,
289
+ env_name: "CORDOVA_BUILD_CONFIG_FILE",
290
+ description: "Call `npx cordova compile` with `--buildConfig=<ConfigFile>` to specify build config file path",
291
+ is_string: true,
292
+ optional: true,
293
+ default_value: ''
247
294
  )
248
295
  ]
249
296
  end
250
297
 
251
298
  def self.output
252
299
  [
253
- ['CORDOVA_ANDROID_RELEASE_BUILD_PATH', 'Path to the signed release APK if it was generated'],
300
+ ['CORDOVA_ANDROID_RELEASE_BUILD_PATH', 'Path to the signed release APK or AAB if it was generated'],
254
301
  ['CORDOVA_IOS_RELEASE_BUILD_PATH', 'Path to the signed release IPA if it was generated']
255
302
  ]
256
303
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Cordova
3
- VERSION = "2.0.0"
3
+ VERSION = "3.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-cordova
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Almouro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.111.0
97
- description:
97
+ description:
98
98
  email: contact@almouro.com
99
99
  executables: []
100
100
  extensions: []
@@ -110,7 +110,7 @@ homepage: https://github.com/almouro/fastlane-plugin-cordova
110
110
  licenses:
111
111
  - MIT
112
112
  metadata: {}
113
- post_install_message:
113
+ post_install_message:
114
114
  rdoc_options: []
115
115
  require_paths:
116
116
  - lib
@@ -125,9 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubyforge_project:
129
- rubygems_version: 2.4.5.1
130
- signing_key:
128
+ rubygems_version: 3.1.2
129
+ signing_key:
131
130
  specification_version: 4
132
131
  summary: Build your Cordova app
133
132
  test_files: []