fastlane-plugin-updateplistfromstrings 1.0.1 → 1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf9a2194a3924d4fcf247d0a1dec842e5ab203e5
|
4
|
+
data.tar.gz: c706124245e0e3c81c4d3aedae8a6d4305640272
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d86d2c7c0087a4b1180d808b5a41ca429d94f8f7cd396e09ea82a0a195c945f541ea4aa2896161f21320a93eb5bb301a2c92c01aa208b6d5a1bf9faa1f3f6966
|
7
|
+
data.tar.gz: a47fdf1080c76c10627b56a35b5adac303bf55bde2c3dd511f9eaf90d509f262d6603fb0e2414b9a3d0471c8c1e3099332b69c11daa1c9ae45a57de2e7f953c9
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# updateplistfromstrings plugin
|
2
2
|
|
3
|
-
[](https://rubygems.org/gems/fastlane-plugin-updateplistfromstrings)
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-updateplistfromstrings) [](https://circleci.com/gh/jschmid/fastlane-plugin-updateplistfromstrings)
|
4
4
|
|
5
5
|
## Getting Started
|
6
6
|
|
@@ -17,10 +17,10 @@ module Fastlane
|
|
17
17
|
# Preserve the non-managed lines:
|
18
18
|
non_managed_lines = []
|
19
19
|
|
20
|
-
if File.
|
20
|
+
if File.exist?(target_file)
|
21
21
|
open(target_file, encoding: 'bom|utf-8') do |f|
|
22
22
|
f.each_line do |line|
|
23
|
-
non_managed_lines << line.strip
|
23
|
+
non_managed_lines << line.strip unless /#{managed_marker}/.match?(line)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -28,42 +28,41 @@ module Fastlane
|
|
28
28
|
# Build the managed lines, and set Info.plist key/values.
|
29
29
|
managed_lines = []
|
30
30
|
managed_target_keys = []
|
31
|
-
open(input_file,
|
31
|
+
open(input_file, encoding: 'bom|utf-8') do |f|
|
32
32
|
f.each_line do |line|
|
33
33
|
key_map.each do |target_key, source_key|
|
34
34
|
regex = /^"#{source_key}"\s*=\s*"(?<value>.*)"\s*;\s*$/
|
35
35
|
matches = line.match(regex)
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
36
|
+
next unless matches
|
37
|
+
next if omit_if_empty_value and matches['value'].empty?
|
38
|
+
|
39
|
+
quoted_source_key = %("#{source_key}")
|
40
|
+
target_line = line.sub(quoted_source_key, target_key).strip
|
41
|
+
if use_key_for_empty_value and matches['value'].empty?
|
42
|
+
value = source_key
|
43
|
+
target_line.sub!(/"";$/, quoted_source_key + ";")
|
44
|
+
else
|
45
|
+
value = matches['value']
|
46
|
+
end
|
47
|
+
target_line += " /* #{managed_marker} */"
|
48
|
+
managed_lines << target_line
|
49
|
+
managed_target_keys << target_key
|
50
|
+
|
51
|
+
if set_in_plist
|
52
|
+
UI.message "Setting in Info.plist: #{target_key} = #{value}"
|
53
|
+
Fastlane::Actions::SetInfoPlistValueAction.run(path: plist_path, key: target_key, value: value)
|
55
54
|
end
|
56
55
|
end
|
57
56
|
end
|
58
57
|
end
|
59
58
|
|
60
59
|
# Remove any non-managed lines that are now managed.
|
61
|
-
non_managed_lines = non_managed_lines.reject
|
62
|
-
managed_target_keys.find { |key| line.match(/^#{key}\s*=\s*".*"\s*;.*$/)}
|
63
|
-
|
60
|
+
non_managed_lines = non_managed_lines.reject do |line|
|
61
|
+
managed_target_keys.find { |key| line.match(/^#{key}\s*=\s*".*"\s*;.*$/) }
|
62
|
+
end
|
64
63
|
|
65
64
|
IO.write(target_file_tmp, (non_managed_lines + managed_lines).join("\n") + "\n")
|
66
|
-
FileUtils.mv(target_file_tmp, target_file, :
|
65
|
+
FileUtils.mv(target_file_tmp, target_file, force: true)
|
67
66
|
|
68
67
|
UI.message "#{managed_lines.length} managed translation values set in #{target_file}"
|
69
68
|
end
|
@@ -108,7 +107,7 @@ module Fastlane
|
|
108
107
|
FastlaneCore::ConfigItem.new(key: :plist_path,
|
109
108
|
description: "Path to Info.plist file",
|
110
109
|
default_value: "")
|
111
|
-
|
110
|
+
]
|
112
111
|
end
|
113
112
|
|
114
113
|
def self.output
|
@@ -124,9 +123,8 @@ module Fastlane
|
|
124
123
|
end
|
125
124
|
|
126
125
|
def self.is_supported?(platform)
|
127
|
-
|
126
|
+
platform == :ios
|
128
127
|
end
|
129
|
-
|
130
128
|
end
|
131
129
|
end
|
132
130
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-updateplistfromstrings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Schmid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -122,20 +122,6 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 2.66.2
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: fastlane-plugin-poeditor_export
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :runtime
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
125
|
description:
|
140
126
|
email: jonas.schmid@gmail.com
|
141
127
|
executables: []
|