fastlane-plugin-rearchive 1.0.0 → 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
  SHA256:
3
- metadata.gz: aaaa414623759395560b9da0d24a575fd59678d3327b12ed85d68dbe73bd2fa3
4
- data.tar.gz: c50be7ac069ee08357a829cf507583a2477022e8af405ff1b38f43d6a7c0ffc2
3
+ metadata.gz: 44be78fb0a8c6a4b9b242982bfdee6565f0364b7270e315a5e8ba1b169b381e5
4
+ data.tar.gz: d3a74cb2dd63087745701fd24c30f70cbd803dfe148f717b681cf4da84f871b0
5
5
  SHA512:
6
- metadata.gz: 996314def095d3347e27e4649435b80fff572e69ca34e227a34394dc031d96e3d2ea052b5be11d161280f2ac5216765e3ea38d3ecbe2f8f0532b7d4e2718168d
7
- data.tar.gz: 695e6151afae12e91c696caab88a33ca8ca7ccf8ecc2c94744cb17b42bd9f56c0691def6fb80daccb92f1a63aa51a9d74717ce0682c668c9cc9c38a1f40e0cb1
6
+ metadata.gz: 1fa3dd5bc15991fb1962119702e3f37041b2bad51880eca6c82ec2a2f09a76c644194419de0e840289fda08af825589a4f9cf38cf771708b0d640e22abd06667
7
+ data.tar.gz: 5bc6cbe61d686e94929da013a27d69945f725fa301ab6c27e68010d6b5a7a0cf9f8566366e27281d0a11c47be7f36ca22ad8e25715b733f8dd705792f4968d84
@@ -32,9 +32,11 @@ module Fastlane
32
32
  archive.delete(archive.app_path(path))
33
33
  end
34
34
  end
35
- plist_buddy.exec("Delete #{icon_files_key}")
36
- rescue RuntimeError => _e
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,37 @@ 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 |i|
58
- relative_path = archive.app_path((i[:target]).to_s)
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 #{i[:source].shellescape} #{local_path.shellescape}", exception: true)
62
+ FastlaneCore::UI.message("Copy icon from #{icon[:source].shellescape} to #{local_path.shellescape}")
63
+ system("cp #{icon[:source].shellescape} #{local_path.shellescape}", exception: true)
61
64
  archive.replace(relative_path)
62
- end
63
- icons.map { |i| i[:name] }.uniq.each_with_index do |key, index|
64
- plist_buddy.exec("Add #{icons_plist_key}:#{index} string #{key}")
65
+ end.map do |icon|
66
+ icon[:name]
67
+ end.uniq.each do |key|
68
+ plist_buddy.exec("Add #{icons_plist_key}: string #{key}")
65
69
  end
66
70
  end
67
71
  Dir.mktmpdir do |dir|
68
72
  Dir.chdir(dir) do
73
+ FastlaneCore::UI.message("Current Directory: #{dir}")
74
+ FastlaneCore::UI.message("Iconset: #{iconset_path}")
69
75
  IO.popen(%W[
70
- #{IO.popen("xcode-select -p", &:read).chomp}/usr/bin/actool
71
- --output-format=human-readable-text
76
+ /usr/bin/actool
77
+ --output-format human-readable-text
72
78
  --notices
73
79
  --warnings
74
- --output-partial-info-plist=assetcatalog_generated_info.plist
75
- --app-icon=#{File.basename(iconset_path, ".appiconset")}
80
+ --output-partial-info-plist assetcatalog_generated_info.plist
81
+ --app-icon #{File.basename(iconset_path, ".appiconset")}
76
82
  --compress-pngs
77
- --enable-on-demand-resources=YES
78
- --sticker-pack-identifier-prefix=#{plist_buddy.exec("Print CFBundleIdentifier")}.sticker-pack.
79
- --development-region=English
80
- --target-device=iphone
81
- --target-device=ipad
82
- --minimum-deployment-target=#{plist_buddy.exec("Print MinimumOSVersion")}
83
- --platform=iphoneos
84
- --product-type=com.apple.product-type.application
83
+ --enable-on-demand-resources YES
84
+ --sticker-pack-identifier-prefix #{plist_buddy.exec("Print CFBundleIdentifier")}.sticker-pack.
85
+ --target-device iphone
86
+ --target-device ipad
87
+ --minimum-deployment-target #{plist_buddy.exec("Print MinimumOSVersion")}
88
+ --platform iphoneos
89
+ --product-type com.apple.product-type.application
85
90
  --compile
86
91
  .
87
92
  #{File.dirname(iconset_path)}
@@ -40,7 +40,7 @@ module Fastlane
40
40
  optional: false,
41
41
  type: String),
42
42
 
43
- FastlaneCore::ConfigItem.new(key: :replace_files,
43
+ FastlaneCore::ConfigItem.new(key: :files,
44
44
  description: "Files that should be replaced",
45
45
  optional: false,
46
46
  type: Hash)
@@ -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").strip
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).chomp
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
- raise "value is not an array: #{result_lines}" unless result_lines.first == "Array {"
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
- array_values = result_lines.drop(1).take(result_lines.size - 2)
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
- return array_values.map { |line| line[4..line.size] }
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
- raise "value is not an dict: #{result_lines}" unless result_lines.first == "Dict {"
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
- keys = result_lines
44
- .map { |l| l.match(/^\s{4}([^\s}]+)/) }
45
- .select { |l| l }
46
- .map { |l| l[1] }
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
- return keys
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Rearchive
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-rearchive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - naoigcat
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-05-04 00:00:00.000000000 Z
10
+ date: 2025-03-05 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -150,7 +149,6 @@ dependencies:
150
149
  - - ">="
151
150
  - !ruby/object:Gem::Version
152
151
  version: '0'
153
- description:
154
152
  email: 17925623+naoigcat@users.noreply.github.com
155
153
  executables: []
156
154
  extensions: []
@@ -172,7 +170,6 @@ homepage: https://github.com/naoigcat/fastlane-plugin-rearchive
172
170
  licenses:
173
171
  - MIT
174
172
  metadata: {}
175
- post_install_message:
176
173
  rdoc_options: []
177
174
  require_paths:
178
175
  - lib
@@ -187,8 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
184
  - !ruby/object:Gem::Version
188
185
  version: '0'
189
186
  requirements: []
190
- rubygems_version: 3.4.9
191
- signing_key:
187
+ rubygems_version: 3.6.3
192
188
  specification_version: 4
193
189
  summary: Modify files inside ipa/xcarchive for publishing multiple configurations
194
190
  without rearchiving.