fastlane-plugin-xcconfig 0.1.0 → 1.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d22b1f245b9d9429f5de62ab8cb24182cd6ee412c7a34398dfbf1f20e0f71432
4
- data.tar.gz: ab7758973b9deebdbfc776d3b34336ee4c7e0d36bfe69791fb20cc652bbfcc10
3
+ metadata.gz: 58d03002755a01a9c94e7962b7b2f1acf8aacc536b5ace59b55d6cf9de3141a6
4
+ data.tar.gz: 6b6d1c2b45cbf6967defcda7877b4320f9ec390954354c5c8457ea57dcda910a
5
5
  SHA512:
6
- metadata.gz: c849c86c67b34743577983fa31c58355639d4ccb9580802fd622c0d29750dd2c747e7fca9bc4aa093d0f840b907291bcaa16be3cd4cf9d942d6440349846f7c5
7
- data.tar.gz: 03eabb0cf7e19968ee474549b386427b0684808db0a889295ee24dc84775444755db7026c6d274e8bd5bfcb28539608ef186b21af9be32cefe8063c92d943b6b
6
+ metadata.gz: 7e367b932e6d92ccfd97393d898f2748e3f0b3faa3fb0491cfb0fea65ec1aabbeee4599d03c95f3272142b0d802d544f07b9381b16a94823484ac744bfbae9b8
7
+ data.tar.gz: cd7a29d07757efbaa4c5e36dfd27f12fe71794ab0b8409fe1afaff60f570a408db8270c2c5627cc8cfd6d11160ec6ad04f4a3353b18621c94da9a3951b5293d8
@@ -35,10 +35,12 @@ module Fastlane
35
35
  FastlaneCore::ConfigItem.new(key: :name,
36
36
  env_name: "XCCP_GET_VALUE_PARAM_NAME",
37
37
  description: "Name of key in xcconfig file",
38
+ type: String,
38
39
  optional: false),
39
40
  FastlaneCore::ConfigItem.new(key: :path,
40
41
  env_name: "XCCP_GET_VALUE_PARAM_PATH",
41
42
  description: "Path to plist file you want to update",
43
+ type: String,
42
44
  optional: false,
43
45
  verify_block: proc do |value|
44
46
  UI.user_error!("Couldn't find xcconfig file at path '#{value}'") unless File.exist?(File.expand_path(value))
@@ -9,14 +9,23 @@ module Fastlane
9
9
 
10
10
  tmp_file = path + '.updated'
11
11
 
12
+ name = params[:name]
13
+
14
+ # Revert fastlane's auto conversion of strings into booleans
15
+ # https://github.com/fastlane/fastlane/pull/11923
16
+ value = if [true, false].include?(params[:value])
17
+ params[:value] ? 'YES' : 'NO'
18
+ else
19
+ params[:value].strip
20
+ end
12
21
  begin
13
22
  updated = false
14
23
 
15
24
  File.open(tmp_file, 'w') do |file|
16
25
  File.open(path).each do |line|
17
- name, = Helper::XcconfigHelper.parse_xcconfig_name_value_line(line)
18
- if name == params[:name]
19
- file.write(name + ' = ' + params[:value] + "\n")
26
+ xcname, = Helper::XcconfigHelper.parse_xcconfig_name_value_line(line)
27
+ if xcname == name
28
+ file.write(name + ' = ' + value + "\n")
20
29
  updated = true
21
30
  else
22
31
  file.write(line)
@@ -24,7 +33,7 @@ module Fastlane
24
33
  end
25
34
  end
26
35
 
27
- Fastlane::UI.user_error!("Couldn't find '#{params[:name]}' in #{params[:path]}.") unless updated
36
+ Fastlane::UI.user_error!("Couldn't find '#{name}' in #{path}.") unless updated
28
37
 
29
38
  FileUtils.cp(tmp_file, path)
30
39
  ensure
@@ -53,14 +62,18 @@ module Fastlane
53
62
  FastlaneCore::ConfigItem.new(key: :name,
54
63
  env_name: "XCCP_SET_VALUE_PARAM_NAME",
55
64
  description: "Name of key in xcconfig file",
65
+ type: String,
56
66
  optional: false),
57
67
  FastlaneCore::ConfigItem.new(key: :value,
58
68
  env_name: "XCCP_SET_VALUE_PARAM_VALUE",
59
69
  description: "Value to set",
70
+ skip_type_validation: true, # skipping type validation as fastlane converts YES/NO/true/false strings into booleans
71
+ type: String,
60
72
  optional: false),
61
73
  FastlaneCore::ConfigItem.new(key: :path,
62
74
  env_name: "XCCP_SET_VALUE_PARAM_PATH",
63
- description: "Path to plist file you want to update",
75
+ description: "Path to xcconfig file you want to update",
76
+ type: String,
64
77
  optional: false,
65
78
  verify_block: proc do |value|
66
79
  UI.user_error!("Couldn't find xcconfig file at path '#{value}'") unless File.exist?(File.expand_path(value))
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Xcconfig
3
- VERSION = "0.1.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-xcconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergii Ovcharenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-24 00:00:00.000000000 Z
11
+ date: 2018-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry