fastlane-plugin-rearchive 1.0.0 → 1.0.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 +4 -4
- data/lib/fastlane/plugin/rearchive/actions/iconset_action.rb +22 -20
- data/lib/fastlane/plugin/rearchive/actions/replace_file_action.rb +1 -1
- data/lib/fastlane/plugin/rearchive/helper/archives/xc_archive.rb +1 -1
- data/lib/fastlane/plugin/rearchive/helper/plist_buddy.rb +25 -10
- data/lib/fastlane/plugin/rearchive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07b36f4705fba17177e7fcfe57534453d40939f36f1ca13e9450b3ad64a8bede
|
4
|
+
data.tar.gz: 331f2ddaec7d48f6da97b352acbf98d499754e6635c01d62c90ab81c14802da0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 040d78db5848930903337beae05e89604ba90c964c26b0d5e12560ccd45fb4b66af6f3b196b4659f8096956c259535a0dc75bfeb7c92fa9f02c13226ae385ecd
|
7
|
+
data.tar.gz: b76b6f0d6a86895cc23470ab6f5b848711d81bf24f1616bca7adb31f0b10336aad610283fbef94b9133a11bac8f0bac487078643cd587e6e26acd698d6fdf5d6
|
@@ -32,9 +32,11 @@ module Fastlane
|
|
32
32
|
archive.delete(archive.app_path(path))
|
33
33
|
end
|
34
34
|
end
|
35
|
-
|
36
|
-
|
35
|
+
rescue RuntimeError => e
|
36
|
+
FastlaneCore::UI.message(e)
|
37
37
|
next
|
38
|
+
end.each do |(icon_files_key, _)|
|
39
|
+
plist_buddy.exec("Delete #{icon_files_key}")
|
38
40
|
end
|
39
41
|
JSON.parse(File.read(iconset_manifest_path))["images"].select do |image|
|
40
42
|
image["filename"]
|
@@ -54,34 +56,34 @@ module Fastlane
|
|
54
56
|
idiom_suffix = idiom == "iphone" ? "" : "~#{idiom}"
|
55
57
|
icons_plist_key = ":CFBundleIcons#{idiom_suffix}:CFBundlePrimaryIcon:CFBundleIconFiles"
|
56
58
|
plist_buddy.exec("Add #{icons_plist_key} array")
|
57
|
-
icons.each do |
|
58
|
-
relative_path = archive.app_path((
|
59
|
+
icons.each do |icon|
|
60
|
+
relative_path = archive.app_path((icon[:target]).to_s)
|
59
61
|
local_path = archive.local_path(relative_path)
|
60
|
-
system("cp #{
|
62
|
+
system("cp #{icon[:source].shellescape} #{local_path.shellescape}", exception: true)
|
61
63
|
archive.replace(relative_path)
|
62
|
-
end
|
63
|
-
|
64
|
-
|
64
|
+
end.map do |icon|
|
65
|
+
icon[:name]
|
66
|
+
end.uniq.each do |key|
|
67
|
+
plist_buddy.exec("Add #{icons_plist_key}: string #{key}")
|
65
68
|
end
|
66
69
|
end
|
67
70
|
Dir.mktmpdir do |dir|
|
68
71
|
Dir.chdir(dir) do
|
69
72
|
IO.popen(%W[
|
70
|
-
|
71
|
-
--output-format
|
73
|
+
/usr/bin/actool
|
74
|
+
--output-format human-readable-text
|
72
75
|
--notices
|
73
76
|
--warnings
|
74
|
-
--output-partial-info-plist
|
75
|
-
--app-icon
|
77
|
+
--output-partial-info-plist assetcatalog_generated_info.plist
|
78
|
+
--app-icon #{File.basename(iconset_path, ".appiconset")}
|
76
79
|
--compress-pngs
|
77
|
-
--enable-on-demand-resources
|
78
|
-
--sticker-pack-identifier-prefix
|
79
|
-
--
|
80
|
-
--target-device
|
81
|
-
--target
|
82
|
-
--
|
83
|
-
--
|
84
|
-
--product-type=com.apple.product-type.application
|
80
|
+
--enable-on-demand-resources YES
|
81
|
+
--sticker-pack-identifier-prefix #{plist_buddy.exec("Print CFBundleIdentifier")}.sticker-pack.
|
82
|
+
--target-device iphone
|
83
|
+
--target-device ipad
|
84
|
+
--minimum-deployment-target #{plist_buddy.exec("Print MinimumOSVersion")}
|
85
|
+
--platform iphoneos
|
86
|
+
--product-type com.apple.product-type.application
|
85
87
|
--compile
|
86
88
|
.
|
87
89
|
#{File.dirname(iconset_path)}
|
@@ -41,7 +41,7 @@ module Fastlane
|
|
41
41
|
|
42
42
|
def self.extract_app_path(archive_path)
|
43
43
|
plist_buddy = PlistBuddy.new("#{archive_path}/Info.plist")
|
44
|
-
plist_buddy.exec("Print :ApplicationProperties:ApplicationPath")
|
44
|
+
plist_buddy.exec("Print :ApplicationProperties:ApplicationPath")
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -9,7 +9,7 @@ module Fastlane
|
|
9
9
|
|
10
10
|
def exec(command)
|
11
11
|
FastlaneCore::UI.verbose("/usr/libexec/PlistBuddy -c \"#{command}\" \"#{@plist_path}\"")
|
12
|
-
result = IO.popen("/usr/libexec/PlistBuddy -c \"#{command}\" \"#{@plist_path}\"", &:read).
|
12
|
+
result = IO.popen("/usr/libexec/PlistBuddy -c \"#{command}\" \"#{@plist_path}\"", &:read).gsub(/\A\s*"?|"?\s*\z/m, "")
|
13
13
|
|
14
14
|
if $?.exitstatus.nonzero?
|
15
15
|
FastlaneCore::UI.important("PlistBuddy command failed: #{result}")
|
@@ -26,11 +26,20 @@ module Fastlane
|
|
26
26
|
|
27
27
|
result_lines = result.lines.map(&:chop)
|
28
28
|
|
29
|
-
|
29
|
+
case RUBY_PLATFORM
|
30
|
+
when "x86_64-linux", "aarch64-linux-gnu"
|
31
|
+
raise "value is not an array (#{RUBY_PLATFORM}): #{result_lines}" unless result_lines.first == "("
|
30
32
|
|
31
|
-
|
33
|
+
result_lines.drop(1).take(result_lines.size - 2).map do |line|
|
34
|
+
line[1..line.size].sub(/,$/, "")
|
35
|
+
end
|
36
|
+
else
|
37
|
+
raise "value is not an array (#{RUBY_PLATFORM}): #{result_lines}" unless result_lines.first == "Array {"
|
32
38
|
|
33
|
-
|
39
|
+
result_lines.drop(1).take(result_lines.size - 2).map do |line|
|
40
|
+
line[4..line.size]
|
41
|
+
end
|
42
|
+
end
|
34
43
|
end
|
35
44
|
|
36
45
|
def parse_dict_keys(entry)
|
@@ -38,14 +47,20 @@ module Fastlane
|
|
38
47
|
|
39
48
|
result_lines = entry.lines.map(&:chop)
|
40
49
|
|
41
|
-
|
50
|
+
case RUBY_PLATFORM
|
51
|
+
when "x86_64-linux", "aarch64-linux-gnu"
|
52
|
+
raise "value is not an dict (#{RUBY_PLATFORM}): #{result_lines}" unless result_lines.first == "{"
|
42
53
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
54
|
+
result_lines.map do |line|
|
55
|
+
line.match(/(?<=^\t)[^\s}]+/)
|
56
|
+
end
|
57
|
+
else
|
58
|
+
raise "value is not an dict (#{RUBY_PLATFORM}): #{result_lines}" unless result_lines.first == "Dict {"
|
47
59
|
|
48
|
-
|
60
|
+
result_lines.map do |line|
|
61
|
+
line.match(/(?<=^\s{4})[^\s}]+/)
|
62
|
+
end
|
63
|
+
end.compact.map(&:to_s)
|
49
64
|
end
|
50
65
|
end
|
51
66
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-rearchive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- naoigcat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|