fastlane-plugin-ionic 0.0.1 → 0.0.2
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 +26 -9
- data/lib/fastlane/plugin/ionic/actions/ionic_action.rb +20 -7
- data/lib/fastlane/plugin/ionic/version.rb +1 -1
- 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: 3f9a5b7b3ba70799970af36c04b593d103a24c94
|
4
|
+
data.tar.gz: 1beb8a562abe037dcfc1b3d63ff36ca2eccaf1df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 415582a5eb8c2c010c8bd19c2835b5606b2399b5a2d37723ee7d03b2e4001248f98a0c0078b0536563d16d32c1a9c72e101762ee68f3a4dfb75da1dfa7390f24
|
7
|
+
data.tar.gz: bd765bb631defb1237c6a331a01531e391d1d24dd863d5118addc08f4f947decbd4e310b9fb6dae805d5382f9aa6a27112872b26b573e608e649ecd5fec0ae15
|
data/README.md
CHANGED
@@ -1,12 +1,10 @@
|
|
1
|
-
# Ionic
|
1
|
+
# _fastlane_ Plugin for Ionic CLI
|
2
2
|
|
3
|
-
[](https://rubygems.org/gems/fastlane-plugin-ionic)
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-ionic) [](https://github.com/ionic-zone/fastlane-plugin-ionic/blob/master/LICENSE)
|
4
|
+
[](http://rubygems.org/gems/fastlane-plugin-ionic)
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
## Features
|
8
|
-
|
9
|
-
- Build your Ionic project inside a lane
|
6
|
+
This _fastlane_ plugin lets you build your Ionic Cordova project via the [Ionic Command line tool](https://ionicframework.com/docs/cli/), `ionic`, and its `ionic cordova build` command in a _fastlane_ lane.
|
7
|
+
It is based on [fastlane-plugin-cordova](https://github.com/bamlab/fastlane-plugin-cordova) (where it borrows most of its code).
|
10
8
|
|
11
9
|
## Getting Started
|
12
10
|
|
@@ -16,7 +14,26 @@ This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To ge
|
|
16
14
|
fastlane add_plugin ionic
|
17
15
|
```
|
18
16
|
|
19
|
-
|
17
|
+
## Actions
|
18
|
+
|
19
|
+
### `ionic`
|
20
|
+
|
21
|
+
Run `ionic cordova build` to build your Ionic project.
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
ionic(
|
25
|
+
platform: 'ios', # Build your iOS Ionic project
|
26
|
+
)
|
27
|
+
ionic(
|
28
|
+
platform: 'android', # Build your Android Ionic project
|
29
|
+
release: false # Build a "Debug" app
|
30
|
+
)
|
31
|
+
```
|
32
|
+
|
33
|
+
|
34
|
+
## Examples
|
35
|
+
|
36
|
+
Lanes using these actions could look like this:
|
20
37
|
|
21
38
|
```ruby
|
22
39
|
platform :ios do
|
@@ -52,7 +69,7 @@ apple_id "apple@id.com"
|
|
52
69
|
team_id "28323HT"
|
53
70
|
```
|
54
71
|
|
55
|
-
If using **Crosswalk**, replace `supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])` by:
|
72
|
+
If you're using **Crosswalk**, replace `supply(apk: ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'])` (and equivalents) by:
|
56
73
|
```
|
57
74
|
supply(
|
58
75
|
apk_paths: [
|
@@ -6,6 +6,9 @@ module Fastlane
|
|
6
6
|
end
|
7
7
|
|
8
8
|
class IonicAction < Action
|
9
|
+
|
10
|
+
# valid action params
|
11
|
+
|
9
12
|
ANDROID_ARGS_MAP = {
|
10
13
|
keystore_path: 'keystore',
|
11
14
|
keystore_password: 'storePassword',
|
@@ -20,6 +23,7 @@ module Fastlane
|
|
20
23
|
provisioning_profile: 'provisioningProfile',
|
21
24
|
}
|
22
25
|
|
26
|
+
# do rewriting and copying of action params
|
23
27
|
def self.get_platform_args(params, args_map)
|
24
28
|
platform_args = []
|
25
29
|
args_map.each do |action_key, cli_param|
|
@@ -32,6 +36,8 @@ module Fastlane
|
|
32
36
|
return platform_args.join(' ')
|
33
37
|
end
|
34
38
|
|
39
|
+
# map action params to the cli param they will be used for
|
40
|
+
|
35
41
|
def self.get_android_args(params)
|
36
42
|
if params[:key_password].empty?
|
37
43
|
params[:key_password] = params[:keystore_password]
|
@@ -44,7 +50,7 @@ module Fastlane
|
|
44
50
|
app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
|
45
51
|
|
46
52
|
if params[:provisioning_profile].empty?
|
47
|
-
params[:provisioning_profile] = ENV['SIGH_UUID'] || ENV["sigh_#{app_identifier}_#{params[:type].sub("-","")}"]
|
53
|
+
params[:provisioning_profile] = ENV['SIGH_UUID'] || ENV["sigh_#{app_identifier}_#{params[:type].sub("-","")}"] # TODO What does this do? Does it also work for `match`?
|
48
54
|
end
|
49
55
|
|
50
56
|
if params[:type] == 'adhoc'
|
@@ -57,17 +63,20 @@ module Fastlane
|
|
57
63
|
return self.get_platform_args(params, IOS_ARGS_MAP)
|
58
64
|
end
|
59
65
|
|
60
|
-
|
66
|
+
# add cordova platform if missing (run #1)
|
67
|
+
def self.check_and_add_platform(platform)
|
61
68
|
if platform && !File.directory?("./platforms/#{platform}")
|
62
69
|
sh "ionic cordova platform add #{platform}"
|
63
70
|
end
|
64
71
|
end
|
65
72
|
|
73
|
+
# app_name
|
66
74
|
def self.get_app_name()
|
67
75
|
config = REXML::Document.new(File.open('config.xml'))
|
68
|
-
return config.elements['widget'].elements['name'].first.value
|
76
|
+
return config.elements['widget'].elements['name'].first.value # TODO Simplify!? (Check logic in cordova)
|
69
77
|
end
|
70
78
|
|
79
|
+
# actual building! (run #2)
|
71
80
|
def self.build(params)
|
72
81
|
args = [params[:release] ? '--release' : '--debug']
|
73
82
|
args << '--device' if params[:device]
|
@@ -75,8 +84,9 @@ module Fastlane
|
|
75
84
|
android_args = self.get_android_args(params) if params[:platform].to_s == 'android'
|
76
85
|
ios_args = self.get_ios_args(params) if params[:platform].to_s == 'ios'
|
77
86
|
|
87
|
+
# TODO Extract param string for prepare and compile here
|
78
88
|
if params[:cordova_prepare]
|
79
|
-
sh "ionic cordova prepare #{params[:platform]} #{args.join(' ')} #{ios_args} -- #{android_args}"
|
89
|
+
sh "ionic cordova prepare #{params[:platform]} #{args.join(' ')} -- #{ios_args} -- -- #{android_args}" # TODO only attach set args - makes a nicer command
|
80
90
|
end
|
81
91
|
|
82
92
|
if params[:platform].to_s == 'ios' && !params[:build_number].to_s.empty?
|
@@ -90,19 +100,22 @@ module Fastlane
|
|
90
100
|
)
|
91
101
|
end
|
92
102
|
|
93
|
-
sh "ionic cordova compile #{params[:platform]} #{args.join(' ')} #{ios_args} -- #{android_args}"
|
103
|
+
sh "ionic cordova compile #{params[:platform]} #{args.join(' ')} -- #{ios_args} -- -- #{android_args}" # TODO only attach set args - makes a nicer command
|
94
104
|
end
|
95
105
|
|
106
|
+
# export build paths (run #3)
|
96
107
|
def self.set_build_paths(is_release)
|
97
108
|
app_name = self.get_app_name()
|
98
109
|
build_type = is_release ? 'release' : 'debug'
|
99
110
|
|
100
111
|
ENV['CORDOVA_ANDROID_RELEASE_BUILD_PATH'] = "./platforms/android/build/outputs/apk/android-#{build_type}.apk"
|
101
112
|
ENV['CORDOVA_IOS_RELEASE_BUILD_PATH'] = "./platforms/ios/build/device/#{app_name}.ipa"
|
113
|
+
|
114
|
+
# TODO https://github.com/bamlab/fastlane-plugin-cordova/issues/7
|
102
115
|
end
|
103
116
|
|
104
117
|
def self.run(params)
|
105
|
-
self.
|
118
|
+
self.check_and_add_platform(params[:platform])
|
106
119
|
self.build(params)
|
107
120
|
self.set_build_paths(params[:release])
|
108
121
|
end
|
@@ -235,7 +248,7 @@ module Fastlane
|
|
235
248
|
end
|
236
249
|
|
237
250
|
def self.authors
|
238
|
-
['
|
251
|
+
['Jan Piotrowski']
|
239
252
|
end
|
240
253
|
|
241
254
|
def self.is_supported?(platform)
|
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.2
|
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-10-
|
11
|
+
date: 2017-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -106,7 +106,7 @@ files:
|
|
106
106
|
- lib/fastlane/plugin/ionic/actions/ionic_action.rb
|
107
107
|
- lib/fastlane/plugin/ionic/helper/ionic_helper.rb
|
108
108
|
- lib/fastlane/plugin/ionic/version.rb
|
109
|
-
homepage: https://github.com/
|
109
|
+
homepage: https://github.com/ionic-zone/fastlane-plugin-ionic
|
110
110
|
licenses:
|
111
111
|
- MIT
|
112
112
|
metadata: {}
|