fastlane-plugin-ionic 0.0.2 → 0.0.3
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/README.md +12 -8
- data/lib/fastlane/plugin/ionic/actions/ionic_action.rb +24 -11
- data/lib/fastlane/plugin/ionic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6eec2eb14314f04375f251a8a83d28c310ba63b
|
4
|
+
data.tar.gz: 901a1527245a86578b3d0df24c1f98349cc7b9d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cf5d0dd574748686010767ca61c356b83ac180b7960877c6cc769b78325091aba08d151520d5d7f8de4a32511c39d9e4eca29cf3422d96d6691c42857b181b6
|
7
|
+
data.tar.gz: 25cd713d21cab83a37b6c0b98daca713c2e863b95a4c3d873b51e8ade8f3c67f2c482ab2897cdd4f254f3e6d90e100b95916057e93a814c622290c7ce70e7fe0
|
data/README.md
CHANGED
@@ -3,8 +3,9 @@
|
|
3
3
|
[](https://rubygems.org/gems/fastlane-plugin-ionic) [](https://github.com/ionic-zone/fastlane-plugin-ionic/blob/master/LICENSE)
|
4
4
|
[](http://rubygems.org/gems/fastlane-plugin-ionic)
|
5
5
|
|
6
|
-
This _fastlane_ plugin
|
7
|
-
|
6
|
+
This _fastlane_ plugin helps you build your **Ionic Cordova** project via the [`ionic` CLI](https://ionicframework.com/docs/cli/) and its `ionic cordova build` command.
|
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!).
|
8
9
|
|
9
10
|
## Getting Started
|
10
11
|
|
@@ -18,12 +19,12 @@ fastlane add_plugin ionic
|
|
18
19
|
|
19
20
|
### `ionic`
|
20
21
|
|
21
|
-
|
22
|
+
Runs `ionic cordova build` to build your Ionic project.
|
22
23
|
|
23
24
|
```ruby
|
24
25
|
ionic(
|
25
26
|
platform: 'ios', # Build your iOS Ionic project
|
26
|
-
)
|
27
|
+
)
|
27
28
|
ionic(
|
28
29
|
platform: 'android', # Build your Android Ionic project
|
29
30
|
release: false # Build a "Debug" app
|
@@ -42,7 +43,7 @@ platform :ios do
|
|
42
43
|
lane :deploy do
|
43
44
|
match(type: "appstore")
|
44
45
|
ionic(platform: 'ios')
|
45
|
-
|
46
|
+
deliver(ipa: ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'])
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
@@ -70,10 +71,11 @@ team_id "28323HT"
|
|
70
71
|
```
|
71
72
|
|
72
73
|
If you're using **Crosswalk**, replace `supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])` (and equivalents) by:
|
73
|
-
|
74
|
+
|
75
|
+
```ruby
|
74
76
|
supply(
|
75
77
|
apk_paths: [
|
76
|
-
'platforms/android/build/outputs/apk/android-armv7-release.apk',
|
78
|
+
'platforms/android/build/outputs/apk/android-armv7-release.apk',
|
77
79
|
'platforms/android/build/outputs/apk/android-x86-release.apk'
|
78
80
|
],
|
79
81
|
)
|
@@ -82,6 +84,7 @@ supply(
|
|
82
84
|
## Plugin API
|
83
85
|
|
84
86
|
To check what's available in the plugin, install it in a project and run at the root of the project:
|
87
|
+
|
85
88
|
```
|
86
89
|
fastlane actions ionic
|
87
90
|
```
|
@@ -93,6 +96,7 @@ Which will produce:
|
|
93
96
|
| **platform** | Platform to build on. <br>Should be either android or ios | CORDOVA_PLATFORM | |
|
94
97
|
| **release** | Build for release if true,<br>or for debug if false | CORDOVA_RELEASE | *true* |
|
95
98
|
| **device** | Build for device | CORDOVA_DEVICE | *true* |
|
99
|
+
| **prod** | Build for production | IONIC_PROD | *true* |
|
96
100
|
| **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 |
|
97
101
|
| **team_id** | The development team (Team ID) to use for code signing | CORDOVA_IOS_TEAM_ID | *28323HT* |
|
98
102
|
| **provisioning_profile** | GUID of the provisioning profile to be used for signing | CORDOVA_IOS_PROVISIONING_PROFILE | |
|
@@ -102,7 +106,7 @@ Which will produce:
|
|
102
106
|
| **keystore_alias** | Android Keystore alias | CORDOVA_ANDROID_KEYSTORE_ALIAS | |
|
103
107
|
| **build_number** | Build Number for iOS and Android | CORDOVA_BUILD_NUMBER | |
|
104
108
|
| **browserify** | Specifies whether to browserify build or not | CORDOVA_BROWSERIFY | *false* |
|
105
|
-
| **cordova_prepare** | Specifies whether to run `cordova prepare` before building | CORDOVA_PREPARE | *true* |
|
109
|
+
| **cordova_prepare** | Specifies whether to run `ionic cordova prepare` before building | CORDOVA_PREPARE | *true* |
|
106
110
|
|
107
111
|
## Run tests for this plugin
|
108
112
|
|
@@ -6,7 +6,6 @@ module Fastlane
|
|
6
6
|
end
|
7
7
|
|
8
8
|
class IonicAction < Action
|
9
|
-
|
10
9
|
# valid action params
|
11
10
|
|
12
11
|
ANDROID_ARGS_MAP = {
|
@@ -20,7 +19,7 @@ module Fastlane
|
|
20
19
|
IOS_ARGS_MAP = {
|
21
20
|
type: 'packageType',
|
22
21
|
team_id: 'developmentTeam',
|
23
|
-
provisioning_profile: 'provisioningProfile'
|
22
|
+
provisioning_profile: 'provisioningProfile'
|
24
23
|
}
|
25
24
|
|
26
25
|
# do rewriting and copying of action params
|
@@ -50,7 +49,8 @@ module Fastlane
|
|
50
49
|
app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
|
51
50
|
|
52
51
|
if params[:provisioning_profile].empty?
|
53
|
-
|
52
|
+
# If `match` or `sigh` were used before this, use the certificates returned from there
|
53
|
+
params[:provisioning_profile] = ENV['SIGH_UUID'] || ENV["sigh_#{app_identifier}_#{params[:type].sub('-', '')}"]
|
54
54
|
end
|
55
55
|
|
56
56
|
if params[:type] == 'adhoc'
|
@@ -71,24 +71,26 @@ module Fastlane
|
|
71
71
|
end
|
72
72
|
|
73
73
|
# app_name
|
74
|
-
def self.get_app_name
|
74
|
+
def self.get_app_name
|
75
75
|
config = REXML::Document.new(File.open('config.xml'))
|
76
|
-
return config.elements['widget'].elements['name'].first.value # TODO Simplify!? (Check logic in cordova)
|
76
|
+
return config.elements['widget'].elements['name'].first.value # TODO: Simplify!? (Check logic in cordova)
|
77
77
|
end
|
78
78
|
|
79
79
|
# actual building! (run #2)
|
80
80
|
def self.build(params)
|
81
81
|
args = [params[:release] ? '--release' : '--debug']
|
82
82
|
args << '--device' if params[:device]
|
83
|
+
args << '--prod' if params[:prod]
|
83
84
|
args << '--browserify' if params[:browserify]
|
84
85
|
android_args = self.get_android_args(params) if params[:platform].to_s == 'android'
|
85
86
|
ios_args = self.get_ios_args(params) if params[:platform].to_s == 'ios'
|
86
87
|
|
87
|
-
# TODO Extract param string for prepare and compile here
|
88
88
|
if params[:cordova_prepare]
|
89
|
-
|
89
|
+
# TODO: Remove params not allowed/used for `prepare`
|
90
|
+
sh "ionic cordova prepare #{params[:platform]} #{args.join(' ')}"
|
90
91
|
end
|
91
92
|
|
93
|
+
# special handling for `build_number` param
|
92
94
|
if params[:platform].to_s == 'ios' && !params[:build_number].to_s.empty?
|
93
95
|
cf_bundle_version = params[:build_number].to_s
|
94
96
|
Actions::UpdateInfoPlistAction.run(
|
@@ -100,18 +102,19 @@ module Fastlane
|
|
100
102
|
)
|
101
103
|
end
|
102
104
|
|
103
|
-
|
105
|
+
# TODO: extract params - only attach correct platform args
|
106
|
+
sh "ionic cordova compile #{params[:platform]} #{args.join(' ')} -- #{ios_args} -- -- #{android_args}"
|
104
107
|
end
|
105
108
|
|
106
109
|
# export build paths (run #3)
|
107
110
|
def self.set_build_paths(is_release)
|
108
|
-
app_name = self.get_app_name
|
111
|
+
app_name = self.get_app_name
|
109
112
|
build_type = is_release ? 'release' : 'debug'
|
110
113
|
|
111
114
|
ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'] = "./platforms/android/build/outputs/apk/android-#{build_type}.apk"
|
112
115
|
ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'] = "./platforms/ios/build/device/#{app_name}.ipa"
|
113
116
|
|
114
|
-
# TODO https://github.com/bamlab/fastlane-plugin-cordova/issues/7
|
117
|
+
# TODO: https://github.com/bamlab/fastlane-plugin-cordova/issues/7
|
115
118
|
end
|
116
119
|
|
117
120
|
def self.run(params)
|
@@ -164,6 +167,16 @@ module Fastlane
|
|
164
167
|
UI.user_error!("Device should be boolean") unless [false, true].include? value
|
165
168
|
end
|
166
169
|
),
|
170
|
+
FastlaneCore::ConfigItem.new(
|
171
|
+
key: :prod,
|
172
|
+
env_name: "IONIC_PROD",
|
173
|
+
description: "Build for production",
|
174
|
+
is_string: false,
|
175
|
+
default_value: false,
|
176
|
+
verify_block: proc do |value|
|
177
|
+
UI.user_error!("Prod should be boolean") unless [false, true].include? value
|
178
|
+
end
|
179
|
+
),
|
167
180
|
FastlaneCore::ConfigItem.new(
|
168
181
|
key: :type,
|
169
182
|
env_name: "CORDOVA_IOS_PACKAGE_TYPE",
|
@@ -221,7 +234,7 @@ module Fastlane
|
|
221
234
|
env_name: "CORDOVA_BUILD_NUMBER",
|
222
235
|
description: "Build Number for iOS",
|
223
236
|
optional: true,
|
224
|
-
is_string: false
|
237
|
+
is_string: false
|
225
238
|
),
|
226
239
|
FastlaneCore::ConfigItem.new(
|
227
240
|
key: :browserify,
|
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.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Piotrowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|