fastlane-plugin-settings_bundle 1.2.0 → 1.2.1

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
  SHA1:
3
- metadata.gz: 8ec2f564820b8e88b1b974a32e4d44414a65b0b8
4
- data.tar.gz: 8da1f81314e240c30050a058df47d9c9c66cbe56
3
+ metadata.gz: f891e5430642d33047c7d6969cf1817478fa3f70
4
+ data.tar.gz: b796c2a301b53edfd81df28cd20c079fa2da5636
5
5
  SHA512:
6
- metadata.gz: bab2cbe3e48fafe76e35bfce1868278a8c06910f3b26aec4d277d6b4e91b2c4e92532e0d906f07f04878c3ca577a09cef42caeef14973ae73ea1939b213145f5
7
- data.tar.gz: e0744e178aff7a0415ef31801856ec11200e0a495a9fc99827509948a41e5abe86a258588332acb02ae4c5f66c54af7f5be8243702a450eb2f9f51817c9a8dbf
6
+ metadata.gz: 659115b4d87db5d6d8422cb3c11c2e846815a8c90f64ab6c383ed7eb21842c47a6bf99da1b4d334cf7c8b8afe01e0ac03bf1e4153642e60502641a993c01d04e
7
+ data.tar.gz: 590a1626c9b96c1a97e22a4c0cc23948a7e5a332a478125ffee72f5c51fd7902fda1879e6d22081fafe2e141ab2d5ddac926268530a40e582b03d1541694da7e
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Jimmy Dee <jgvdthree@gmail.com>
3
+ Copyright (c) 2017 Jimmy Dee <jgvdthree@gmail.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016 Jimmy Dee
1
+ # Copyright (c) 2016-17 Jimmy Dee
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016 Jimmy Dee
1
+ # Copyright (c) 2016-17 Jimmy Dee
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the "Software"), to deal
@@ -58,15 +58,10 @@ module Fastlane
58
58
  raise "No application target found" if target.nil?
59
59
  end
60
60
 
61
- # find the Info.plist paths for all configurations
62
- info_plist_paths = target.resolved_build_setting "INFOPLIST_FILE"
63
-
64
- raise "INFOPLIST_FILE not found in target" if info_plist_paths.nil? or info_plist_paths.empty?
65
-
66
61
  # this can differ from one configuration to another.
67
62
  # take from Release, since only one Settings.bundle per project
68
63
  # (not per configuration)
69
- release_info_plist_path = info_plist_paths[configuration]
64
+ release_info_plist_path = expanded_build_setting target, "INFOPLIST_FILE", configuration
70
65
 
71
66
  raise "Info.plist not found for configuration #{configuration}" if release_info_plist_path.nil?
72
67
 
@@ -159,6 +154,31 @@ module Fastlane
159
154
  # one project found: great
160
155
  xcodeproj_paths.first
161
156
  end
157
+
158
+ 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]
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
+
172
+ macro_name = matches[1]
173
+ return setting_value if macro_name.nil?
174
+
175
+ expanded_macro = macro_name == "SRCROOT" ? "." : expanded_build_setting(target, macro_name, configuration)
176
+ return setting_value if expanded_macro.nil?
177
+
178
+ setting_value.gsub!(/\$[{(]#{macro_name}[})]/, expanded_macro)
179
+
180
+ expand_macros target, setting_value, configuration
181
+ end
162
182
  end
163
183
  end
164
184
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SettingsBundle
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
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.0
4
+ version: 1.2.1
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-15 00:00:00.000000000 Z
11
+ date: 2017-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plist
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 1.106.2
117
+ version: 2.39.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.106.2
124
+ version: 2.39.0
125
125
  description:
126
126
  email: jgvdthree@gmail.com
127
127
  executables: []