fastlane-plugin-settings_bundle 1.2.1 → 1.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
- SHA1:
3
- metadata.gz: f891e5430642d33047c7d6969cf1817478fa3f70
4
- data.tar.gz: b796c2a301b53edfd81df28cd20c079fa2da5636
2
+ SHA256:
3
+ metadata.gz: 894d54cea6624d141891ed6cfe3d75262bbf3a98ab320c394fa90fb800452eec
4
+ data.tar.gz: b51715a677193a4845c373b37560988592d1f3ae34c8752867ebc0e7d3b23499
5
5
  SHA512:
6
- metadata.gz: 659115b4d87db5d6d8422cb3c11c2e846815a8c90f64ab6c383ed7eb21842c47a6bf99da1b4d334cf7c8b8afe01e0ac03bf1e4153642e60502641a993c01d04e
7
- data.tar.gz: 590a1626c9b96c1a97e22a4c0cc23948a7e5a332a478125ffee72f5c51fd7902fda1879e6d22081fafe2e141ab2d5ddac926268530a40e582b03d1541694da7e
6
+ metadata.gz: 326ade281fc1d28150282a573801a00f121c534f49c5353a0a0f6b40e2592fc6c3e86bc5fd36e7a1b698f4b3600b56a77072fe610d0634d93b3f5cd0f13af43c
7
+ data.tar.gz: 0d9e18830364d9d9ff5698b951b27dd0b7300050e8f1c2410f6491ba2ab0d4bf8177c8d00d42346589e1e075ccfc268ef0a53556c7f200b6c66a49f6cbc2b224
data/README.md CHANGED
@@ -122,6 +122,40 @@ update_settings_bundle(
122
122
  )
123
123
  ```
124
124
 
125
+ ### Use with commit_version_bump
126
+
127
+ As of version 1.3.0 (which requires Fastlane 2.64.0), it is no longer necessary
128
+ to pass a `settings` parameter to the built-in `commit_version_bump` action
129
+ when using `update_settings_bundle`.
130
+
131
+ ```ruby
132
+ increment_build_number
133
+ update_settings_bundle key: "CurrentAppVersion",
134
+ value: ":version (:build)"
135
+ commit_version_bump
136
+ ```
137
+
138
+ ```ruby
139
+ increment_build_number
140
+ update_settings_bundle key: "CurrentAppVersion",
141
+ value: ":version (:build)",
142
+ file: "About.plist"
143
+ commit_version_bump
144
+ ```
145
+
146
+ ```ruby
147
+ increment_build_number
148
+ update_settings_bundle key: "CurrentAppVersion",
149
+ value: ":version (:build)" # in Root.plist
150
+ update_settings_bundle key: "CurrentFrameworkVersion",
151
+ value: ":version (:build)",
152
+ file: "Framework.plist",
153
+ target: "MyFramework"
154
+ commit_version_bump
155
+ ```
156
+
157
+ Also see the [example apps](./examples) and [example Fastfile](./fastlane/Fastfile) in the repo.
158
+
125
159
  ## Examples
126
160
 
127
161
  [SettingsBundleExample]: ./examples/SettingsBundleExample
@@ -125,6 +125,8 @@ module Fastlane
125
125
 
126
126
  # Save (raises)
127
127
  Plist::Emit.save_plist settings_plist, plist_path
128
+
129
+ Actions.add_modified_files [plist_path]
128
130
  end
129
131
 
130
132
  def xcodeproj_path_from_params(params)
@@ -156,28 +158,21 @@ module Fastlane
156
158
  end
157
159
 
158
160
  def expanded_build_setting(target, setting_name, configuration)
159
- setting_values = target.resolved_build_setting setting_name
160
- return if setting_values.nil?
161
- setting_value = setting_values[configuration]
161
+ setting_value = target.resolved_build_setting(setting_name)[configuration]
162
162
  return if setting_value.nil?
163
- expand_macros target, setting_value, configuration
164
- end
165
-
166
- def expand_macros(target, setting_value, configuration)
167
- # TODO: Properly balance these delimiters. Currently it will also match
168
- # $(SETTING} and ${SETTING). See the pending spec.
169
- matches = /\$[{(]([^})]+)[})]/.match(setting_value)
170
- return setting_value if matches.nil?
171
163
 
172
- macro_name = matches[1]
173
- return setting_value if macro_name.nil?
164
+ search_position = 0
165
+ while (matches = /\$\(([^(){}]*)\)|\$\{([^(){}]*)\}/.match(setting_value, search_position))
166
+ macro_name = matches[1] || matches[2]
167
+ search_position = setting_value.index(macro_name) - 2
174
168
 
175
- expanded_macro = macro_name == "SRCROOT" ? "." : expanded_build_setting(target, macro_name, configuration)
176
- return setting_value if expanded_macro.nil?
169
+ expanded_macro = macro_name == "SRCROOT" ? "." : expanded_build_setting(target, macro_name, configuration)
170
+ search_position += macro_name.length + 3 and next if expanded_macro.nil?
177
171
 
178
- setting_value.gsub!(/\$[{(]#{macro_name}[})]/, expanded_macro)
179
-
180
- expand_macros target, setting_value, configuration
172
+ setting_value.gsub!(/\$\(#{macro_name}\)|\$\{#{macro_name}\}/, expanded_macro)
173
+ search_position += expanded_macro.length
174
+ end
175
+ setting_value
181
176
  end
182
177
  end
183
178
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SettingsBundle
3
- VERSION = "1.2.1"
3
+ VERSION = "1.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-settings_bundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Dee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-20 00:00:00.000000000 Z
11
+ date: 2017-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plist
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.4.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: pry
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +67,7 @@ dependencies:
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: bundler
70
+ name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
@@ -81,7 +95,21 @@ dependencies:
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
- name: rake
98
+ name: rspec_junit_formatter
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-simplecov
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
115
  - - ">="
@@ -96,6 +124,20 @@ dependencies:
96
124
  version: '0'
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.49.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.49.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
99
141
  requirement: !ruby/object:Gem::Requirement
100
142
  requirements:
101
143
  - - ">="
@@ -114,14 +156,14 @@ dependencies:
114
156
  requirements:
115
157
  - - ">="
116
158
  - !ruby/object:Gem::Version
117
- version: 2.39.0
159
+ version: 2.64.0
118
160
  type: :development
119
161
  prerelease: false
120
162
  version_requirements: !ruby/object:Gem::Requirement
121
163
  requirements:
122
164
  - - ">="
123
165
  - !ruby/object:Gem::Version
124
- version: 2.39.0
166
+ version: 2.64.0
125
167
  description:
126
168
  email: jgvdthree@gmail.com
127
169
  executables: []
@@ -154,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
196
  version: '0'
155
197
  requirements: []
156
198
  rubyforge_project:
157
- rubygems_version: 2.6.12
199
+ rubygems_version: 2.7.1
158
200
  signing_key:
159
201
  specification_version: 4
160
202
  summary: Fastlane plugin to update static settings in an iOS settings bundle