fastlane-plugin-cordova 0.1.1
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 +76 -0
- data/lib/fastlane/plugin/cordova.rb +16 -0
- data/lib/fastlane/plugin/cordova/actions/cordova_action.rb +217 -0
- data/lib/fastlane/plugin/cordova/helper/cordova_helper.rb +12 -0
- data/lib/fastlane/plugin/cordova/version.rb +5 -0
- metadata +133 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bbc060c12a34016f10a016a43f2cfdaae74e8778
|
4
|
+
data.tar.gz: a174b6e4f6234bd6e107e3990aae6725ab3ef66c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f67ce2f6991ce8af597e8a3d801fc2cdd0fd0eca580dcbab2151137339ce371d28a3464065db332e663a021d0ad3d53e0e5284faafdbeeb6196d2e3526e749e2
|
7
|
+
data.tar.gz: ece030bb8ef2549686a2ed7fdd46728435b16409a2c2a8bab5a15109cdd6fcc6f3e96a7941c4118e82a420840e5e3bc99d16c0d4660e1053bef84e428ef45703
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Almouro <contact@almouro.com>
|
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,76 @@
|
|
1
|
+
# Cordova Plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-cordova)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-cordova`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin cordova
|
11
|
+
```
|
12
|
+
|
13
|
+
Then you can integrate it into your Fastlane setup:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
platform :ios do
|
17
|
+
desc "Deploy ios app on the appstore"
|
18
|
+
|
19
|
+
lane :deploy do
|
20
|
+
match(type: "appstore")
|
21
|
+
cordova(platform: 'ios')
|
22
|
+
appstore(ipa: ENV('CORDOVA_IOS_RELEASE_BUILD_PATH'))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
platform :android do
|
27
|
+
desc "Deploy android app on play store"
|
28
|
+
|
29
|
+
lane :deploy do
|
30
|
+
cordova(
|
31
|
+
platform: 'android',
|
32
|
+
keystore_path: './prod.keystore',
|
33
|
+
keystore_alias: 'prod',
|
34
|
+
keystore_password: 'password'
|
35
|
+
)
|
36
|
+
supply(apk: ENV('CORDOVA_ANDROID_RELEASE_BUILD_PATH'))
|
37
|
+
end
|
38
|
+
end
|
39
|
+
```
|
40
|
+
|
41
|
+
with an `Appfile` such as
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
app_identifier com.awesome.app
|
45
|
+
apple_id apple@id.com
|
46
|
+
team_id 28323HT
|
47
|
+
```
|
48
|
+
|
49
|
+
## Run tests for this plugin
|
50
|
+
|
51
|
+
To run both the tests, and code style validation, run
|
52
|
+
|
53
|
+
```
|
54
|
+
rake
|
55
|
+
```
|
56
|
+
|
57
|
+
To automatically fix many of the styling issues, use
|
58
|
+
```
|
59
|
+
rubocop -a
|
60
|
+
```
|
61
|
+
|
62
|
+
## Issues and Feedback
|
63
|
+
|
64
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
65
|
+
|
66
|
+
## Troubleshooting
|
67
|
+
|
68
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md) doc in the main `fastlane` repo.
|
69
|
+
|
70
|
+
## Using `fastlane` Plugins
|
71
|
+
|
72
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md).
|
73
|
+
|
74
|
+
## About `fastlane`
|
75
|
+
|
76
|
+
`fastlane` is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/cordova/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Cordova
|
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::Cordova.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,217 @@
|
|
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 CordovaAction < Action
|
9
|
+
ANDROID_ARGS_MAP = {
|
10
|
+
keystore_path: 'keystore',
|
11
|
+
keystore_password: 'storePassword',
|
12
|
+
key_password: 'password',
|
13
|
+
keystore_alias: 'alias'
|
14
|
+
}
|
15
|
+
|
16
|
+
IOS_ARGS_MAP = {
|
17
|
+
type: 'packageType',
|
18
|
+
team_id: 'developmentTeam',
|
19
|
+
provisioning_profile: 'provisioningProfile'
|
20
|
+
}
|
21
|
+
|
22
|
+
def self.get_platform_args(params, args_map)
|
23
|
+
platform_args = []
|
24
|
+
args_map.each do |action_key, cli_param|
|
25
|
+
param_value = params[action_key]
|
26
|
+
unless param_value.empty?
|
27
|
+
platform_args << "--#{cli_param}=\"#{param_value}\""
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
return platform_args.join(' ')
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.get_android_args(params)
|
35
|
+
if params[:key_password].empty?
|
36
|
+
params[:key_password] = params[:keystore_password]
|
37
|
+
end
|
38
|
+
|
39
|
+
return self.get_platform_args(params, ANDROID_ARGS_MAP)
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.get_ios_args(params)
|
43
|
+
app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
|
44
|
+
params[:provisioning_profile] ||=
|
45
|
+
ENV['SIGH_UUID'] ||
|
46
|
+
ENV["sigh_#{app_identifier}_#{params[:type]}"] ||
|
47
|
+
''
|
48
|
+
return self.get_platform_args(params, IOS_ARGS_MAP)
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.check_platform(platform)
|
52
|
+
if platform && !File.directory?("./platforms/#{platform}")
|
53
|
+
sh "cordova platform add #{platform}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.get_app_name()
|
58
|
+
config = REXML::Document.new(File.open('config.xml'))
|
59
|
+
return config.elements['widget'].elements['name'].first.value
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.build(params)
|
63
|
+
prod = params[:release] ? 'release' : 'debug'
|
64
|
+
device = params[:device] ? ' --device' : ''
|
65
|
+
android_args = self.get_android_args(params)
|
66
|
+
ios_args = self.get_ios_args(params)
|
67
|
+
|
68
|
+
sh "cordova build #{params[:platform]} --#{prod}#{device} #{ios_args} -- #{android_args}"
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.set_build_paths()
|
72
|
+
app_name = self.get_app_name()
|
73
|
+
|
74
|
+
ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'] = "./platforms/android/build/outputs/apk/android-release.apk"
|
75
|
+
ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'] = "./platforms/ios/build/device/#{app_name}.ipa"
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.run(params)
|
79
|
+
self.check_platform(params[:platform])
|
80
|
+
self.build(params)
|
81
|
+
self.set_build_paths()
|
82
|
+
end
|
83
|
+
|
84
|
+
#####################################################
|
85
|
+
# @!group Documentation
|
86
|
+
#####################################################
|
87
|
+
|
88
|
+
def self.description
|
89
|
+
"Build your Cordova app"
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.details
|
93
|
+
"Easily integrate your cordova build into a Fastlane setup"
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.available_options
|
97
|
+
[
|
98
|
+
FastlaneCore::ConfigItem.new(
|
99
|
+
key: :platform,
|
100
|
+
env_name: "CORDOVA_PLATFORM",
|
101
|
+
description: "Platform to build on. Should be either android or ios",
|
102
|
+
is_string: true,
|
103
|
+
default_value: '',
|
104
|
+
verify_block: proc do |value|
|
105
|
+
UI.user_error!("Platform should be either android or ios") unless ['', 'android', 'ios'].include? value
|
106
|
+
end
|
107
|
+
),
|
108
|
+
FastlaneCore::ConfigItem.new(
|
109
|
+
key: :release,
|
110
|
+
env_name: "CORDOVA_RELEASE",
|
111
|
+
description: "Build for release",
|
112
|
+
is_string: false,
|
113
|
+
default_value: true,
|
114
|
+
verify_block: proc do |value|
|
115
|
+
UI.user_error!("Release should be boolean") unless [false, true].include? value
|
116
|
+
end
|
117
|
+
),
|
118
|
+
FastlaneCore::ConfigItem.new(
|
119
|
+
key: :device,
|
120
|
+
env_name: "CORDOVA_DEVICE",
|
121
|
+
description: "Build for device",
|
122
|
+
is_string: false,
|
123
|
+
default_value: true,
|
124
|
+
verify_block: proc do |value|
|
125
|
+
UI.user_error!("Device should be boolean") unless [false, true].include? value
|
126
|
+
end
|
127
|
+
),
|
128
|
+
FastlaneCore::ConfigItem.new(
|
129
|
+
key: :type,
|
130
|
+
env_name: "CORDOVA_IOS_PACKAGE_TYPE",
|
131
|
+
description: "This will determine what type of build is generated by Xcode. Valid options are development, enterprise, ad-hoc, and app-store",
|
132
|
+
is_string: true,
|
133
|
+
default_value: 'app-store',
|
134
|
+
verify_block: proc do |value|
|
135
|
+
UI.user_error!("Valid options are development, enterprise, ad-hoc, and app-store.") unless ['development', 'enterprise', 'ad-hoc', 'app-store'].include? value
|
136
|
+
end
|
137
|
+
),
|
138
|
+
FastlaneCore::ConfigItem.new(
|
139
|
+
key: :team_id,
|
140
|
+
env_name: "CORDOVA_IOS_TEAM_ID",
|
141
|
+
description: "The development team (Team ID) to use for code signing",
|
142
|
+
is_string: true,
|
143
|
+
default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
|
144
|
+
),
|
145
|
+
FastlaneCore::ConfigItem.new(
|
146
|
+
key: :provisioning_profile,
|
147
|
+
env_name: "CORDOVA_IOS_PROVISIONING_PROFILE",
|
148
|
+
description: "GUID of the provisioning profile to be used for signing",
|
149
|
+
is_string: true,
|
150
|
+
default_value: ''
|
151
|
+
),
|
152
|
+
FastlaneCore::ConfigItem.new(
|
153
|
+
key: :keystore_path,
|
154
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_PATH",
|
155
|
+
description: "Path to the Keystore for Android",
|
156
|
+
is_string: true,
|
157
|
+
default_value: ''
|
158
|
+
),
|
159
|
+
FastlaneCore::ConfigItem.new(
|
160
|
+
key: :keystore_password,
|
161
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_PASSWORD",
|
162
|
+
description: "Android Keystore password",
|
163
|
+
is_string: true,
|
164
|
+
default_value: ''
|
165
|
+
),
|
166
|
+
FastlaneCore::ConfigItem.new(
|
167
|
+
key: :key_password,
|
168
|
+
env_name: "CORDOVA_ANDROID_KEY_PASSWORD",
|
169
|
+
description: "Android Key password (default is keystore password)",
|
170
|
+
is_string: true,
|
171
|
+
default_value: ''
|
172
|
+
),
|
173
|
+
FastlaneCore::ConfigItem.new(
|
174
|
+
key: :keystore_alias,
|
175
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_ALIAS",
|
176
|
+
description: "Android Keystore alias",
|
177
|
+
is_string: true,
|
178
|
+
default_value: ''
|
179
|
+
)
|
180
|
+
]
|
181
|
+
end
|
182
|
+
|
183
|
+
def self.output
|
184
|
+
[
|
185
|
+
['CORDOVA_ANDROID_RELEASE_BUILD_PATH', 'Path to the signed release APK if it was generated'],
|
186
|
+
['CORDOVA_IOS_RELEASE_BUILD_PATH', 'Path to the signed release IPA if it was generated']
|
187
|
+
]
|
188
|
+
end
|
189
|
+
|
190
|
+
def self.authors
|
191
|
+
['almouro']
|
192
|
+
end
|
193
|
+
|
194
|
+
def self.is_supported?(platform)
|
195
|
+
true
|
196
|
+
end
|
197
|
+
|
198
|
+
def self.example_code
|
199
|
+
[
|
200
|
+
"cordova(
|
201
|
+
platform: 'ios'
|
202
|
+
)",
|
203
|
+
"cordova(
|
204
|
+
platform: 'android',
|
205
|
+
keystore_path: './staging.keystore',
|
206
|
+
keystore_alias: 'alias_name',
|
207
|
+
keystore_password: 'store_password'
|
208
|
+
)"
|
209
|
+
]
|
210
|
+
end
|
211
|
+
|
212
|
+
def self.category
|
213
|
+
:building
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class CordovaHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::CordovaHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the cordova plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-cordova
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Almouro
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
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: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
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: rubocop
|
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: fastlane
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.111.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.111.0
|
97
|
+
description:
|
98
|
+
email: contact@almouro.com
|
99
|
+
executables: []
|
100
|
+
extensions: []
|
101
|
+
extra_rdoc_files: []
|
102
|
+
files:
|
103
|
+
- LICENSE
|
104
|
+
- README.md
|
105
|
+
- lib/fastlane/plugin/cordova.rb
|
106
|
+
- lib/fastlane/plugin/cordova/actions/cordova_action.rb
|
107
|
+
- lib/fastlane/plugin/cordova/helper/cordova_helper.rb
|
108
|
+
- lib/fastlane/plugin/cordova/version.rb
|
109
|
+
homepage: https://github.com/almouro/fastlane-plugin-cordova
|
110
|
+
licenses:
|
111
|
+
- MIT
|
112
|
+
metadata: {}
|
113
|
+
post_install_message:
|
114
|
+
rdoc_options: []
|
115
|
+
require_paths:
|
116
|
+
- lib
|
117
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
requirements: []
|
128
|
+
rubyforge_project:
|
129
|
+
rubygems_version: 2.4.5.1
|
130
|
+
signing_key:
|
131
|
+
specification_version: 4
|
132
|
+
summary: Build your Cordova app
|
133
|
+
test_files: []
|