fastlane-plugin-ionic 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +22 -22
- data/README.md +146 -138
- data/lib/fastlane/plugin/ionic.rb +16 -16
- data/lib/fastlane/plugin/ionic/actions/ionic_action.rb +345 -294
- data/lib/fastlane/plugin/ionic/helper/ionic_helper.rb +12 -12
- data/lib/fastlane/plugin/ionic/version.rb +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8f4609dd838294349cf26fdb60735e9a86bc856
|
4
|
+
data.tar.gz: d519bc0267d2430b05849464797d75570d6304c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5e5f539141e43ce3154291163885bd6bf89c7bb6352f0edab0597b7b5ab2e4c6d5ae75a2ea86f1d16c1a172a396907eb6385d7549e5d9d4320664f3a75550c8
|
7
|
+
data.tar.gz: adbaede51e3ee70c67644b2cec9ecffbab751e6dfd9c762ea9ad10f38f285cd86aed547a485dc100ee6a79da617602bf964f7b05802c6de38d18016746dec7cc
|
data/LICENSE
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2017 Jan Piotrowski <piotrowski@gmail.com>
|
4
|
-
Copyright (c) 2016 Almouro <contact@almouro.com>
|
5
|
-
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
8
|
-
in the Software without restriction, including without limitation the rights
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
11
|
-
furnished to do so, subject to the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be included in all
|
14
|
-
copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
-
SOFTWARE.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Jan Piotrowski <piotrowski@gmail.com>
|
4
|
+
Copyright (c) 2016 Almouro <contact@almouro.com>
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,138 +1,146 @@
|
|
1
|
-
# _fastlane_ Plugin for Ionic CLI
|
2
|
-
|
3
|
-
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-ionic) [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/ionic-zone/fastlane-plugin-ionic/blob/master/LICENSE)
|
4
|
-
[![Gem](https://img.shields.io/gem/v/fastlane-plugin-ionic.svg?style=flat)](http://rubygems.org/gems/fastlane-plugin-ionic)
|
5
|
-
|
6
|
-
This _fastlane_ plugin helps you build your **Ionic Cordova** project via the [`ionic` CLI](https://ionicframework.com/docs/cli/)
|
7
|
-
|
8
|
-
It is based on [fastlane-plugin-cordova](https://github.com/bamlab/fastlane-plugin-cordova) (where it borrows a lot of its code. Thanks!).
|
9
|
-
|
10
|
-
## Getting Started
|
11
|
-
|
12
|
-
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-ionic`, add it to your project by running:
|
13
|
-
|
14
|
-
```bash
|
15
|
-
fastlane add_plugin ionic
|
16
|
-
```
|
17
|
-
|
18
|
-
## Actions
|
19
|
-
|
20
|
-
### `ionic`
|
21
|
-
|
22
|
-
Runs `ionic cordova build` to build your Ionic project.
|
23
|
-
|
24
|
-
```ruby
|
25
|
-
ionic(
|
26
|
-
platform: 'ios', # Build your iOS Ionic project
|
27
|
-
)
|
28
|
-
ionic(
|
29
|
-
platform: 'android', # Build your Android Ionic project
|
30
|
-
release: false # Build a "Debug" app
|
31
|
-
)
|
32
|
-
```
|
33
|
-
|
34
|
-
|
35
|
-
## Examples
|
36
|
-
|
37
|
-
Lanes using these actions could look like this:
|
38
|
-
|
39
|
-
```ruby
|
40
|
-
platform :ios do
|
41
|
-
desc "Deploy ios app on the appstore"
|
42
|
-
|
43
|
-
lane :deploy do
|
44
|
-
match(type: "appstore")
|
45
|
-
ionic(platform: 'ios')
|
46
|
-
deliver(ipa: ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'])
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
platform :android do
|
51
|
-
desc "Deploy android app on play store"
|
52
|
-
|
53
|
-
lane :deploy do
|
54
|
-
ionic(
|
55
|
-
platform: 'android',
|
56
|
-
keystore_path: './prod.keystore',
|
57
|
-
keystore_alias: 'prod',
|
58
|
-
keystore_password: 'password'
|
59
|
-
)
|
60
|
-
supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])
|
61
|
-
end
|
62
|
-
end
|
63
|
-
```
|
64
|
-
|
65
|
-
with an `Appfile` such as
|
66
|
-
|
67
|
-
```ruby
|
68
|
-
app_identifier "com.awesome.app"
|
69
|
-
apple_id "apple@id.com"
|
70
|
-
team_id "28323HT"
|
71
|
-
```
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
|
99
|
-
|
100
|
-
| **
|
101
|
-
| **
|
102
|
-
| **
|
103
|
-
| **
|
104
|
-
| **
|
105
|
-
| **
|
106
|
-
| **
|
107
|
-
| **
|
108
|
-
| **
|
109
|
-
| **
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
##
|
133
|
-
|
134
|
-
For
|
135
|
-
|
136
|
-
##
|
137
|
-
|
138
|
-
|
1
|
+
# _fastlane_ Plugin for Ionic CLI
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-ionic) [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/ionic-zone/fastlane-plugin-ionic/blob/master/LICENSE)
|
4
|
+
[![Gem](https://img.shields.io/gem/v/fastlane-plugin-ionic.svg?style=flat)](http://rubygems.org/gems/fastlane-plugin-ionic)
|
5
|
+
|
6
|
+
This _fastlane_ plugin helps you build your **Ionic Cordova** project via the [`ionic` CLI](https://ionicframework.com/docs/cli/).
|
7
|
+
|
8
|
+
It is based on [fastlane-plugin-cordova](https://github.com/bamlab/fastlane-plugin-cordova) (where it borrows a lot of its code. Thanks!).
|
9
|
+
|
10
|
+
## Getting Started
|
11
|
+
|
12
|
+
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-ionic`, add it to your project by running:
|
13
|
+
|
14
|
+
```bash
|
15
|
+
fastlane add_plugin ionic
|
16
|
+
```
|
17
|
+
|
18
|
+
## Actions
|
19
|
+
|
20
|
+
### `ionic`
|
21
|
+
|
22
|
+
Runs `ionic cordova build` (technically: `ionic cordova prepare` first, then `ionic cordova compile` [which is the same as what `build` does internally]) to build your Ionic project.
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
ionic(
|
26
|
+
platform: 'ios', # Build your iOS Ionic project
|
27
|
+
)
|
28
|
+
ionic(
|
29
|
+
platform: 'android', # Build your Android Ionic project
|
30
|
+
release: false # Build a "Debug" app
|
31
|
+
)
|
32
|
+
```
|
33
|
+
|
34
|
+
|
35
|
+
## Examples
|
36
|
+
|
37
|
+
Lanes using these actions could look like this:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
platform :ios do
|
41
|
+
desc "Deploy ios app on the appstore"
|
42
|
+
|
43
|
+
lane :deploy do
|
44
|
+
match(type: "appstore")
|
45
|
+
ionic(platform: 'ios')
|
46
|
+
deliver(ipa: ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'])
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
platform :android do
|
51
|
+
desc "Deploy android app on play store"
|
52
|
+
|
53
|
+
lane :deploy do
|
54
|
+
ionic(
|
55
|
+
platform: 'android',
|
56
|
+
keystore_path: './prod.keystore',
|
57
|
+
keystore_alias: 'prod',
|
58
|
+
keystore_password: 'password'
|
59
|
+
)
|
60
|
+
supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])
|
61
|
+
end
|
62
|
+
end
|
63
|
+
```
|
64
|
+
|
65
|
+
with an `Appfile` such as
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
app_identifier "com.awesome.app"
|
69
|
+
apple_id "apple@id.com"
|
70
|
+
team_id "28323HT"
|
71
|
+
```
|
72
|
+
|
73
|
+
---
|
74
|
+
|
75
|
+
The `ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH']` is only valid for `cordova-android` 7.x and newer (which you should be using anyway!).
|
76
|
+
|
77
|
+
If you're using **Crosswalk** (which oyu should not really be doing anymore), replace `supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])` (and equivalents) by:
|
78
|
+
|
79
|
+
```ruby
|
80
|
+
supply(
|
81
|
+
apk_paths: [
|
82
|
+
'platforms/android/build/outputs/apk/android-armv7-release.apk',
|
83
|
+
'platforms/android/build/outputs/apk/android-x86-release.apk'
|
84
|
+
],
|
85
|
+
)
|
86
|
+
```
|
87
|
+
|
88
|
+
## Plugin API
|
89
|
+
|
90
|
+
To check what's available in the plugin, install it in a project and run at the root of the project:
|
91
|
+
|
92
|
+
```
|
93
|
+
fastlane actions ionic
|
94
|
+
```
|
95
|
+
|
96
|
+
Which will produce:
|
97
|
+
|
98
|
+
| Key | Description | Env Var | Default |
|
99
|
+
|-----|-------------|---------|---------|
|
100
|
+
| **platform** | Platform to build on. <br>Should be either android or ios | CORDOVA_PLATFORM | |
|
101
|
+
| **release** | Build for release if true,<br>or for debug if false | CORDOVA_RELEASE | *true* |
|
102
|
+
| **device** | Build for device | CORDOVA_DEVICE | *true* |
|
103
|
+
| **prod** | Build for production | IONIC_PROD | *false* |
|
104
|
+
| **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 |
|
105
|
+
| **team_id** | The development team (Team ID) to use for code signing | CORDOVA_IOS_TEAM_ID | *28323HT* |
|
106
|
+
| **build_flag** | An array of Xcode buildFlag. Will be appended on compile command. | CORDOVA_IOS_BUILD_FLAG | [] |
|
107
|
+
| **provisioning_profile** | GUID of the provisioning profile to be used for signing | CORDOVA_IOS_PROVISIONING_PROFILE | |
|
108
|
+
| **keystore_path** | Path to the Keystore for Android | CORDOVA_ANDROID_KEYSTORE_PATH | |
|
109
|
+
| **keystore_password** | Android Keystore password | CORDOVA_ANDROID_KEYSTORE_PASSWORD | |
|
110
|
+
| **key_password** | Android Key password (default is keystore password) | CORDOVA_ANDROID_KEY_PASSWORD | |
|
111
|
+
| **keystore_alias** | Android Keystore alias | CORDOVA_ANDROID_KEYSTORE_ALIAS | |
|
112
|
+
| **min_sdk_version** | Overrides the value of minSdkVersion | CORDOVA_ANDROID_MIN_SDK_VERSION | |
|
113
|
+
| **build_number** | Build Number for iOS and Android | CORDOVA_BUILD_NUMBER | |
|
114
|
+
| **browserify** | Specifies whether to browserify build or not | CORDOVA_BROWSERIFY | *false* |
|
115
|
+
| **cordova_prepare** | Specifies whether to run `ionic cordova prepare` before building | CORDOVA_PREPARE | *true* |
|
116
|
+
| **cordova_no_fetch** | Specifies whether to run `ionic cordova platform add` with `--nofetch` parameter | CORDOVA_NO_FETCH | *false* |
|
117
|
+
| **cordova_build_config_file** | Call `ionic cordova compile` with `--buildConfig=<ConfigFile>` to specify build config file path | CORDOVA_BUILD_CONFIG_FILE | |
|
118
|
+
|
119
|
+
## Run tests for this plugin
|
120
|
+
|
121
|
+
To run both the tests, and code style validation, run
|
122
|
+
|
123
|
+
```
|
124
|
+
rake
|
125
|
+
```
|
126
|
+
|
127
|
+
To automatically fix many of the styling issues, use
|
128
|
+
```
|
129
|
+
rubocop -a
|
130
|
+
```
|
131
|
+
|
132
|
+
## Issues and Feedback
|
133
|
+
|
134
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
135
|
+
|
136
|
+
## Troubleshooting
|
137
|
+
|
138
|
+
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.
|
139
|
+
|
140
|
+
## Using `fastlane` Plugins
|
141
|
+
|
142
|
+
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).
|
143
|
+
|
144
|
+
## About `fastlane`
|
145
|
+
|
146
|
+
`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).
|
@@ -1,16 +1,16 @@
|
|
1
|
-
require 'fastlane/plugin/ionic/version'
|
2
|
-
|
3
|
-
module Fastlane
|
4
|
-
module Ionic
|
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::Ionic.all_classes.each do |current|
|
15
|
-
require current
|
16
|
-
end
|
1
|
+
require 'fastlane/plugin/ionic/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Ionic
|
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::Ionic.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -1,294 +1,345 @@
|
|
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 IonicAction < Action
|
9
|
-
# valid action params
|
10
|
-
|
11
|
-
ANDROID_ARGS_MAP = {
|
12
|
-
keystore_path: 'keystore',
|
13
|
-
keystore_password: 'storePassword',
|
14
|
-
key_password: 'password',
|
15
|
-
keystore_alias: 'alias',
|
16
|
-
build_number: 'versionCode'
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
if
|
70
|
-
|
71
|
-
end
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
),
|
215
|
-
FastlaneCore::ConfigItem.new(
|
216
|
-
key: :
|
217
|
-
env_name: "
|
218
|
-
description: "
|
219
|
-
is_string: true,
|
220
|
-
default_value:
|
221
|
-
),
|
222
|
-
FastlaneCore::ConfigItem.new(
|
223
|
-
key: :
|
224
|
-
env_name: "
|
225
|
-
description: "
|
226
|
-
is_string: true,
|
227
|
-
default_value: ''
|
228
|
-
),
|
229
|
-
FastlaneCore::ConfigItem.new(
|
230
|
-
key: :
|
231
|
-
env_name: "
|
232
|
-
description: "
|
233
|
-
is_string: true,
|
234
|
-
default_value: ''
|
235
|
-
),
|
236
|
-
FastlaneCore::ConfigItem.new(
|
237
|
-
key: :
|
238
|
-
env_name: "
|
239
|
-
description: "
|
240
|
-
|
241
|
-
|
242
|
-
),
|
243
|
-
FastlaneCore::ConfigItem.new(
|
244
|
-
key: :
|
245
|
-
env_name: "
|
246
|
-
description: "
|
247
|
-
|
248
|
-
|
249
|
-
),
|
250
|
-
FastlaneCore::ConfigItem.new(
|
251
|
-
key: :
|
252
|
-
env_name: "
|
253
|
-
description: "
|
254
|
-
|
255
|
-
|
256
|
-
)
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
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 IonicAction < Action
|
9
|
+
# valid action params
|
10
|
+
|
11
|
+
ANDROID_ARGS_MAP = {
|
12
|
+
keystore_path: 'keystore',
|
13
|
+
keystore_password: 'storePassword',
|
14
|
+
key_password: 'password',
|
15
|
+
keystore_alias: 'alias',
|
16
|
+
build_number: 'versionCode',
|
17
|
+
min_sdk_version: 'gradleArg=-PcdvMinSdkVersion',
|
18
|
+
cordova_no_fetch: 'cordovaNoFetch'
|
19
|
+
}
|
20
|
+
|
21
|
+
IOS_ARGS_MAP = {
|
22
|
+
type: 'packageType',
|
23
|
+
team_id: 'developmentTeam',
|
24
|
+
provisioning_profile: 'provisioningProfile',
|
25
|
+
build_flag: 'buildFlag'
|
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
|
+
|
34
|
+
if action_key.to_s == 'build_flag' && param_value.kind_of?(Array)
|
35
|
+
unless param_value.empty?
|
36
|
+
param_value.each do |flag|
|
37
|
+
platform_args << "--#{cli_param}=#{flag.shellescape}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
else
|
41
|
+
unless param_value.to_s.empty?
|
42
|
+
platform_args << "--#{cli_param}=#{Shellwords.escape(param_value)}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
return platform_args.join(' ')
|
48
|
+
end
|
49
|
+
|
50
|
+
# map action params to the cli param they will be used for
|
51
|
+
|
52
|
+
def self.get_android_args(params)
|
53
|
+
# TODO document magic in README
|
54
|
+
if params[:key_password].empty?
|
55
|
+
params[:key_password] = params[:keystore_password]
|
56
|
+
end
|
57
|
+
|
58
|
+
return self.get_platform_args(params, ANDROID_ARGS_MAP)
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.get_ios_args(params)
|
62
|
+
app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
|
63
|
+
|
64
|
+
if params[:provisioning_profile].empty?
|
65
|
+
# If `match` or `sigh` were used before this, use the certificates returned from there
|
66
|
+
params[:provisioning_profile] = ENV['SIGH_UUID'] || ENV["sigh_#{app_identifier}_#{params[:type].sub('-', '')}"]
|
67
|
+
end
|
68
|
+
|
69
|
+
if params[:type] == 'adhoc'
|
70
|
+
params[:type] = 'ad-hoc'
|
71
|
+
end
|
72
|
+
if params[:type] == 'appstore'
|
73
|
+
params[:type] = 'app-store'
|
74
|
+
end
|
75
|
+
|
76
|
+
return self.get_platform_args(params, IOS_ARGS_MAP)
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.check_platform(params)
|
80
|
+
platform = params[:platform]
|
81
|
+
if platform && !File.directory?("./platforms/#{platform}")
|
82
|
+
if params[:cordova_no_fetch]
|
83
|
+
sh "ionic cordova platform add #{platform} --no-interactive --nofetch"
|
84
|
+
else
|
85
|
+
sh "ionic cordova platform add #{platform} --no-interactive"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# app_name
|
91
|
+
def self.get_app_name
|
92
|
+
config = REXML::Document.new(File.open('config.xml'))
|
93
|
+
return config.elements['widget'].elements['name'].first.value # TODO: Simplify!? (Check logic in cordova)
|
94
|
+
end
|
95
|
+
|
96
|
+
# actual building! (run #2)
|
97
|
+
def self.build(params)
|
98
|
+
args = [params[:release] ? '--release' : '--debug']
|
99
|
+
args << '--device' if params[:device]
|
100
|
+
args << '--prod' if params[:prod]
|
101
|
+
args << '--browserify' if params[:browserify]
|
102
|
+
|
103
|
+
if !params[:cordova_build_config_file].to_s.empty?
|
104
|
+
args << "--buildConfig=#{Shellwords.escape(params[:cordova_build_config_file])}"
|
105
|
+
end
|
106
|
+
|
107
|
+
android_args = self.get_android_args(params) if params[:platform].to_s == 'android'
|
108
|
+
ios_args = self.get_ios_args(params) if params[:platform].to_s == 'ios'
|
109
|
+
|
110
|
+
if params[:cordova_prepare]
|
111
|
+
# TODO: Remove params not allowed/used for `prepare`
|
112
|
+
sh "ionic cordova prepare #{params[:platform]} --no-interactive #{args.join(' ')}"
|
113
|
+
end
|
114
|
+
|
115
|
+
# special handling for `build_number` param
|
116
|
+
if params[:platform].to_s == 'ios' && !params[:build_number].to_s.empty?
|
117
|
+
cf_bundle_version = params[:build_number].to_s
|
118
|
+
Actions::UpdateInfoPlistAction.run(
|
119
|
+
xcodeproj: "./platforms/ios/#{self.get_app_name}.xcodeproj",
|
120
|
+
plist_path: "#{self.get_app_name}/#{self.get_app_name}-Info.plist",
|
121
|
+
block: lambda { |plist|
|
122
|
+
plist['CFBundleVersion'] = cf_bundle_version
|
123
|
+
}
|
124
|
+
)
|
125
|
+
end
|
126
|
+
|
127
|
+
if params[:platform].to_s == 'ios'
|
128
|
+
sh "ionic cordova compile #{params[:platform]} --no-interactive #{args.join(' ')} -- #{ios_args}"
|
129
|
+
elsif params[:platform].to_s == 'android'
|
130
|
+
sh "ionic cordova compile #{params[:platform]} --no-interactive #{args.join(' ')} -- -- #{android_args}"
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
# export build paths (run #3)
|
135
|
+
def self.set_build_paths(is_release)
|
136
|
+
app_name = self.get_app_name
|
137
|
+
build_type = is_release ? 'release' : 'debug'
|
138
|
+
|
139
|
+
ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'] = "./platforms/android/app/build/outputs/apk/#{build_type}/app-#{build_type}.apk"
|
140
|
+
ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'] = "./platforms/ios/build/device/#{app_name}.ipa"
|
141
|
+
|
142
|
+
# TODO: https://github.com/bamlab/fastlane-plugin-cordova/issues/7
|
143
|
+
end
|
144
|
+
|
145
|
+
def self.run(params)
|
146
|
+
self.check_platform(params)
|
147
|
+
self.build(params)
|
148
|
+
self.set_build_paths(params[:release])
|
149
|
+
end
|
150
|
+
|
151
|
+
#####################################################
|
152
|
+
# @!group Documentation
|
153
|
+
#####################################################
|
154
|
+
|
155
|
+
def self.description
|
156
|
+
"Build your Ionic app"
|
157
|
+
end
|
158
|
+
|
159
|
+
def self.details
|
160
|
+
"Easily integrate your Ionic build into a Fastlane setup"
|
161
|
+
end
|
162
|
+
|
163
|
+
def self.available_options
|
164
|
+
[
|
165
|
+
FastlaneCore::ConfigItem.new(
|
166
|
+
key: :platform,
|
167
|
+
env_name: "CORDOVA_PLATFORM",
|
168
|
+
description: "Platform to build on. Should be either android or ios",
|
169
|
+
is_string: true,
|
170
|
+
default_value: '',
|
171
|
+
verify_block: proc do |value|
|
172
|
+
UI.user_error!("Platform should be either android or ios") unless ['', 'android', 'ios'].include? value
|
173
|
+
end
|
174
|
+
),
|
175
|
+
FastlaneCore::ConfigItem.new(
|
176
|
+
key: :release,
|
177
|
+
env_name: "CORDOVA_RELEASE",
|
178
|
+
description: "Build for release if true, or for debug if false",
|
179
|
+
is_string: false,
|
180
|
+
default_value: true,
|
181
|
+
verify_block: proc do |value|
|
182
|
+
UI.user_error!("Release should be boolean") unless [false, true].include? value
|
183
|
+
end
|
184
|
+
),
|
185
|
+
FastlaneCore::ConfigItem.new(
|
186
|
+
key: :device,
|
187
|
+
env_name: "CORDOVA_DEVICE",
|
188
|
+
description: "Build for device",
|
189
|
+
is_string: false,
|
190
|
+
default_value: true,
|
191
|
+
verify_block: proc do |value|
|
192
|
+
UI.user_error!("Device should be boolean") unless [false, true].include? value
|
193
|
+
end
|
194
|
+
),
|
195
|
+
FastlaneCore::ConfigItem.new(
|
196
|
+
key: :prod,
|
197
|
+
env_name: "IONIC_PROD",
|
198
|
+
description: "Build for production",
|
199
|
+
is_string: false,
|
200
|
+
default_value: false,
|
201
|
+
verify_block: proc do |value|
|
202
|
+
UI.user_error!("Prod should be boolean") unless [false, true].include? value
|
203
|
+
end
|
204
|
+
),
|
205
|
+
FastlaneCore::ConfigItem.new(
|
206
|
+
key: :type,
|
207
|
+
env_name: "CORDOVA_IOS_PACKAGE_TYPE",
|
208
|
+
description: "This will determine what type of build is generated by Xcode. Valid options are development, enterprise, adhoc, and appstore",
|
209
|
+
is_string: true,
|
210
|
+
default_value: 'appstore',
|
211
|
+
verify_block: proc do |value|
|
212
|
+
UI.user_error!("Valid options are development, enterprise, adhoc, and appstore.") unless ['development', 'enterprise', 'adhoc', 'appstore', 'ad-hoc', 'app-store'].include? value
|
213
|
+
end
|
214
|
+
),
|
215
|
+
FastlaneCore::ConfigItem.new(
|
216
|
+
key: :team_id,
|
217
|
+
env_name: "CORDOVA_IOS_TEAM_ID",
|
218
|
+
description: "The development team (Team ID) to use for code signing",
|
219
|
+
is_string: true,
|
220
|
+
default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
|
221
|
+
),
|
222
|
+
FastlaneCore::ConfigItem.new(
|
223
|
+
key: :provisioning_profile,
|
224
|
+
env_name: "CORDOVA_IOS_PROVISIONING_PROFILE",
|
225
|
+
description: "GUID of the provisioning profile to be used for signing",
|
226
|
+
is_string: true,
|
227
|
+
default_value: ''
|
228
|
+
),
|
229
|
+
FastlaneCore::ConfigItem.new(
|
230
|
+
key: :keystore_path,
|
231
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_PATH",
|
232
|
+
description: "Path to the Keystore for Android",
|
233
|
+
is_string: true,
|
234
|
+
default_value: ''
|
235
|
+
),
|
236
|
+
FastlaneCore::ConfigItem.new(
|
237
|
+
key: :keystore_password,
|
238
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_PASSWORD",
|
239
|
+
description: "Android Keystore password",
|
240
|
+
is_string: true,
|
241
|
+
default_value: ''
|
242
|
+
),
|
243
|
+
FastlaneCore::ConfigItem.new(
|
244
|
+
key: :key_password,
|
245
|
+
env_name: "CORDOVA_ANDROID_KEY_PASSWORD",
|
246
|
+
description: "Android Key password (default is keystore password)",
|
247
|
+
is_string: true,
|
248
|
+
default_value: ''
|
249
|
+
),
|
250
|
+
FastlaneCore::ConfigItem.new(
|
251
|
+
key: :keystore_alias,
|
252
|
+
env_name: "CORDOVA_ANDROID_KEYSTORE_ALIAS",
|
253
|
+
description: "Android Keystore alias",
|
254
|
+
is_string: true,
|
255
|
+
default_value: ''
|
256
|
+
),
|
257
|
+
FastlaneCore::ConfigItem.new(
|
258
|
+
key: :build_number,
|
259
|
+
env_name: "CORDOVA_BUILD_NUMBER",
|
260
|
+
description: "Sets the build number for iOS and version code for Android",
|
261
|
+
optional: true,
|
262
|
+
is_string: false
|
263
|
+
),
|
264
|
+
FastlaneCore::ConfigItem.new(
|
265
|
+
key: :browserify,
|
266
|
+
env_name: "CORDOVA_BROWSERIFY",
|
267
|
+
description: "Specifies whether to browserify build or not",
|
268
|
+
default_value: false,
|
269
|
+
is_string: false
|
270
|
+
),
|
271
|
+
FastlaneCore::ConfigItem.new(
|
272
|
+
key: :cordova_prepare,
|
273
|
+
env_name: "CORDOVA_PREPARE",
|
274
|
+
description: "Specifies whether to run `ionic cordova prepare` before building",
|
275
|
+
default_value: true,
|
276
|
+
is_string: false
|
277
|
+
),
|
278
|
+
FastlaneCore::ConfigItem.new(
|
279
|
+
key: :min_sdk_version,
|
280
|
+
env_name: "CORDOVA_ANDROID_MIN_SDK_VERSION",
|
281
|
+
description: "Overrides the value of minSdkVersion set in AndroidManifest.xml",
|
282
|
+
default_value: '',
|
283
|
+
is_string: false
|
284
|
+
),
|
285
|
+
FastlaneCore::ConfigItem.new(
|
286
|
+
key: :cordova_no_fetch,
|
287
|
+
env_name: "CORDOVA_NO_FETCH",
|
288
|
+
description: "Call `cordova platform add` with `--nofetch` parameter",
|
289
|
+
default_value: false,
|
290
|
+
is_string: false
|
291
|
+
),
|
292
|
+
FastlaneCore::ConfigItem.new(
|
293
|
+
key: :build_flag,
|
294
|
+
env_name: "CORDOVA_IOS_BUILD_FLAG",
|
295
|
+
description: "An array of Xcode buildFlag. Will be appended on compile command",
|
296
|
+
is_string: false,
|
297
|
+
optional: true,
|
298
|
+
default_value: []
|
299
|
+
),
|
300
|
+
FastlaneCore::ConfigItem.new(
|
301
|
+
key: :cordova_build_config_file,
|
302
|
+
env_name: "CORDOVA_BUILD_CONFIG_FILE",
|
303
|
+
description: "Call `ionic cordova compile` with `--buildConfig=<ConfigFile>` to specify build config file path",
|
304
|
+
is_string: true,
|
305
|
+
optional: true,
|
306
|
+
default_value: ''
|
307
|
+
)
|
308
|
+
]
|
309
|
+
end
|
310
|
+
|
311
|
+
def self.output
|
312
|
+
[
|
313
|
+
['CORDOVA_ANDROID_RELEASE_BUILD_PATH', 'Path to the signed release APK if it was generated'],
|
314
|
+
['CORDOVA_IOS_RELEASE_BUILD_PATH', 'Path to the signed release IPA if it was generated']
|
315
|
+
]
|
316
|
+
end
|
317
|
+
|
318
|
+
def self.authors
|
319
|
+
['Jan Piotrowski']
|
320
|
+
end
|
321
|
+
|
322
|
+
def self.is_supported?(platform)
|
323
|
+
true
|
324
|
+
end
|
325
|
+
|
326
|
+
def self.example_code
|
327
|
+
[
|
328
|
+
"ionic(
|
329
|
+
platform: 'ios'
|
330
|
+
)",
|
331
|
+
"ionic(
|
332
|
+
platform: 'android',
|
333
|
+
keystore_path: './staging.keystore',
|
334
|
+
keystore_alias: 'alias_name',
|
335
|
+
keystore_password: 'store_password'
|
336
|
+
)"
|
337
|
+
]
|
338
|
+
end
|
339
|
+
|
340
|
+
def self.category
|
341
|
+
:building
|
342
|
+
end
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Fastlane
|
2
|
-
module Helper
|
3
|
-
class IonicHelper
|
4
|
-
# class methods that you define here become available in your action
|
5
|
-
# as `Helper::IonicHelper.your_method`
|
6
|
-
#
|
7
|
-
def self.show_message
|
8
|
-
UI.message("Hello from the ionic plugin helper!")
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class IonicHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::IonicHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the ionic plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module Fastlane
|
2
|
-
module Ionic
|
3
|
-
VERSION = "0.0
|
4
|
-
end
|
5
|
-
end
|
1
|
+
module Fastlane
|
2
|
+
module Ionic
|
3
|
+
VERSION = "0.1.0"
|
4
|
+
end
|
5
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-ionic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Piotrowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.6.
|
129
|
+
rubygems_version: 2.6.14.1
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Build your Ionic app
|