fastlane-plugin-rome 0.2.2 → 0.3.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
2
  SHA1:
3
- metadata.gz: 7852106ef9083b6636cf3810c6499b115c8c9b9e
4
- data.tar.gz: e4c255d1fd9658b5332dce9dac81d1df68cb3830
3
+ metadata.gz: 56ccbfc46d06cf73456af17e454a6c9056139ece
4
+ data.tar.gz: f556b1a335f6273efaa84d766824dd3afc56fcf3
5
5
  SHA512:
6
- metadata.gz: 84acb9efb1aee0a7e10ae06e47000068d6314855ef547dc315644be16967712c456e457095c436ccf3c688d332052e5c29cee4526f5b657b5cdb8f5d3827f2a0
7
- data.tar.gz: e8ff5882b2741f06f4d1ca449925ff789e5ee0a987786695864deb82ec0ced99325056085096331375481208cf849da1f514c787df8815e95f65f99d6f098165
6
+ metadata.gz: c184d703bfadd805ea22a7099282ed23d8d673ae883af10ed22cda883ab7230f918d4d3c1a69b1332c2490308b20656560fd462290874ed35325a80f44b6cecb
7
+ data.tar.gz: 5e7e77bf3646b509b28dccc718b9d9c811e0d72091087b9a1928778b9ec0affb3dac9df6129eeaaa9f08c288514f2930fea5bb941b85f121e7063dc33a20eac3
@@ -2,10 +2,9 @@ module Fastlane
2
2
  module Actions
3
3
  class RomeAction < Action
4
4
  def self.run(params)
5
- check_tools!
6
5
  validate(params)
7
6
 
8
- cmd = ["rome"]
7
+ cmd = [params[:binary_path]]
9
8
  command_name = params[:command]
10
9
 
11
10
  if command_name == "version"
@@ -31,8 +30,8 @@ module Fastlane
31
30
  Actions.sh(cmd.join(' '))
32
31
  end
33
32
 
34
- def self.meet_minimum_version(minimum_version)
35
- version = Actions.sh('rome --version') #i.e. 0.12.0.31 - Romam uno die non fuisse conditam.
33
+ def self.meet_minimum_version(binary_path, minimum_version)
34
+ version = Actions.sh("#{binary_path} --version") # i.e. 0.12.0.31 - Romam uno die non fuisse conditam.
36
35
  version_number = version.split(' - ')[0]
37
36
 
38
37
  minimum_version_parts = minimum_version.split('.')
@@ -48,9 +47,19 @@ module Fastlane
48
47
  end
49
48
 
50
49
  def self.validate(params)
51
- unless params
52
- Actions.sh("rome --help")
53
- exit
50
+ binary_path = params[:binary_path]
51
+ unless params[:binary_path].include?('rome')
52
+ UI.important("Install Rome for the plugin to work")
53
+ UI.important("")
54
+ UI.error("Or install it using CocoaPods:")
55
+ UI.error("Add `pod 'Rome'` to your Podfile, and set `binary_path` option to `Pods/Rome/rome`")
56
+ UI.error("")
57
+ UI.error("Install it using Homebrew:")
58
+ UI.command("brew install blender/homebrew-tap/rome")
59
+ UI.error("")
60
+ UI.error("If you don't have homebrew, visit http://brew.sh")
61
+
62
+ UI.user_error!("Install Rome and start your lane again!")
54
63
  end
55
64
 
56
65
  command_name = params[:command]
@@ -61,20 +70,17 @@ module Fastlane
61
70
  UI.user_error!("Missing/Present option is available only for 'list' command.")
62
71
  end
63
72
  if command_name == "list" && !(params[:printformat] == nil || params[:printformat] == "JSON" || params[:printformat] == "Text")
64
- UI.user_error!("Unsupported print format. Supported print formats are 'JSON' and 'Text'.")
73
+ UI.user_error!("Unsupported print format. Supported print formats are 'JSON' and 'Text'.")
74
+ UI.user_error!("'printformat' option requires Rome version '0.13.0.33' or later") if !meet_minimum_version(binary_path, "0.13.0.33")
65
75
  end
66
- end
67
-
68
- def self.check_tools!
69
- unless `which rome`.include?('rome')
70
- UI.important("Install Rome for the plugin to work")
71
- UI.important("")
72
- UI.error("Install it using (Homebrew):")
73
- UI.command("brew install blender/homebrew-tap/rome")
74
- UI.error("")
75
- UI.error("If you don't have homebrew, visit http://brew.sh")
76
76
 
77
- UI.user_error!("Install Rome and start your lane again!")
77
+ noignore = params[:noignore]
78
+ if noignore != nil
79
+ UI.user_error!("'noignore' option requires Rome version '0.13.1.35' or later") if !meet_minimum_version(binary_path, "0.13.1.35")
80
+ end
81
+ cacheprefix = params[:cacheprefix]
82
+ if cacheprefix != nil
83
+ UI.user_error!("'cacheprefix' option requires Rome version '0.12.0.31' or later") if !meet_minimum_version(binary_path, "0.12.0.31")
78
84
  end
79
85
  end
80
86
 
@@ -104,6 +110,12 @@ module Fastlane
104
110
 
105
111
  def self.available_options
106
112
  [
113
+ FastlaneCore::ConfigItem.new(key: :binary_path,
114
+ env_name: "FL_ROME_BINARY_PATH",
115
+ description: "Rome binary path, set to `Pods/Rome/rome` if you install Rome via CocoaPods",
116
+ optional: true,
117
+ default_value: `which rome`),
118
+
107
119
  FastlaneCore::ConfigItem.new(key: :command,
108
120
  env_name: "FL_ROME_COMMAND",
109
121
  description: "Rome command (one of: #{available_commands.join(', ')})",
@@ -128,7 +140,6 @@ module Fastlane
128
140
  optional: true,
129
141
  verify_block: proc do |value|
130
142
  UI.user_error!("Please pass a valid value for noignore. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
131
- UI.user_error!("Requires Rome version '0.13.1.35' or later") if !meet_minimum_version("0.13.1.35")
132
143
  end),
133
144
 
134
145
  FastlaneCore::ConfigItem.new(key: :platform,
@@ -169,20 +180,13 @@ module Fastlane
169
180
  env_name: "FL_ROME_CACHE_PREFIX",
170
181
  description: "Allow a prefix for top level directories to be specified for all commands. Useful to store frameworks built with different Swift versions",
171
182
  optional: true,
172
- is_string: true,
173
- verify_block: proc do |value|
174
- UI.user_error!("Requires Rome version '0.12.0.31' or later") if !meet_minimum_version("0.12.0.31")
175
- end),
183
+ is_string: true),
176
184
 
177
185
  FastlaneCore::ConfigItem.new(key: :printformat,
178
186
  env_name: "FL_ROME_PRINT_FORMAT",
179
187
  description: "Specify what format to use in the output of the list command. One of 'JSON' or 'Text'. Defaults to 'Text' if omitted",
180
188
  optional: true,
181
- is_string: true,
182
- verify_block: proc do |value|
183
- UI.user_error!("Please pass a valid print format. Use one of the following: JSON, Text") unless value == nil || value == "JSON" || value == "Text"
184
- UI.user_error!("Requires Rome version '0.13.0.33' or later") if !meet_minimum_version("0.13.0.33")
185
- end)
189
+ is_string: true)
186
190
 
187
191
  ]
188
192
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Rome
3
- VERSION = "0.2.2"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-rome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - François Benaiteau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-11 00:00:00.000000000 Z
11
+ date: 2018-05-28 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.13
129
+ rubygems_version: 2.6.14
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: An S3 cache tool for Carthage