xcodeproj 1.20.0 → 1.21.0

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: 156c030adda9cf98bf0f8b3616a1959e95f9bc1fa07227895c719aafd4d13734
4
- data.tar.gz: 45a532a148d764028d5a58c0859ca1c5b13838cc68497b44611e79d6a65a6ccf
3
+ metadata.gz: 7bab98461310ae1a7572bae0b8dd9025cdf12ee53a64c7d457e8d4982d71982d
4
+ data.tar.gz: 59d1ddc2130ee7f88eb646a1c98dbf14e45da612448a12425df004d416f93961
5
5
  SHA512:
6
- metadata.gz: b7a4da4a5adb9eaa2b129758b0f432b4b6317ef8036df36275edd02d43ff80c9d0d126b012992633acab0721c91c7b7da601dcf76175e459fb07e59a772e7393
7
- data.tar.gz: fd8d1a9c5f246264266a02b8d68a507ebf74e2b82881b4a52da754f77c5450ce322e6def0484f289c04690b449fcf09a8e3f46ce74c8e525cabe6796e868a2b1
6
+ metadata.gz: 4e2431ba9cbf960b7e1ef53ff3dae65565b51fbba1cbb0c6a096d29251ca49c751403575c46fdae6252e176b8ada16ac5aa659d6b015f142eb338e21718a7a38
7
+ data.tar.gz: dfe1895012ba35e32dd44b15b4b2cb5e8ab2957eb7919f39a514c7675b8a261a4f4688006ace24e6eae0dcfc07be70392cf047f0cb66bd8f1036bc3fe817f366
@@ -1,5 +1,5 @@
1
1
  module Xcodeproj
2
2
  # The version of the xcodeproj gem.
3
3
  #
4
- VERSION = '1.20.0'.freeze unless defined? Xcodeproj::VERSION
4
+ VERSION = '1.21.0'.freeze unless defined? Xcodeproj::VERSION
5
5
  end
@@ -39,6 +39,10 @@ module Xcodeproj
39
39
  #
40
40
  attribute :platform_filter, String
41
41
 
42
+ # @return [Array<String>] the platform filters for this build file.
43
+ #
44
+ attribute :platform_filters, Array
45
+
42
46
  #---------------------------------------------------------------------#
43
47
 
44
48
  public
@@ -145,6 +145,27 @@ module Xcodeproj
145
145
  def ascii_plist_annotation
146
146
  " #{display_name} "
147
147
  end
148
+
149
+ # Sorts the build files of the phase according to the display
150
+ # name or the path.
151
+ #
152
+ # @param [Hash] _options
153
+ # Not used.
154
+ #
155
+ # @return [void]
156
+ #
157
+ def sort(_options = nil)
158
+ files.sort! do |x, y|
159
+ result = File.basename(x.display_name.downcase, '.*') <=> File.basename(y.display_name.downcase, '.*')
160
+ if result.zero?
161
+ result = File.extname(x.display_name.downcase) <=> File.extname(y.display_name.downcase)
162
+ if result.zero? && x.file_ref.respond_to?(:full_path) && y.file_ref.respond_to?(:full_path)
163
+ result = x.file_ref.full_path.to_s.downcase <=> y.file_ref.full_path.to_s.downcase
164
+ end
165
+ end
166
+ result
167
+ end
168
+ end
148
169
  end
149
170
 
150
171
  #-----------------------------------------------------------------------#
@@ -440,10 +440,12 @@ module Xcodeproj
440
440
 
441
441
  result = File.basename(x.display_name.downcase, '.*') <=> File.basename(y.display_name.downcase, '.*')
442
442
  if result.zero?
443
- File.extname(x.display_name.downcase) <=> File.extname(y.display_name.downcase)
444
- else
445
- result
443
+ result = File.extname(x.display_name.downcase) <=> File.extname(y.display_name.downcase)
444
+ if result.zero?
445
+ result = x.path.downcase <=> y.path.downcase
446
+ end
446
447
  end
448
+ result
447
449
  end
448
450
  end
449
451
  end
@@ -552,6 +552,49 @@ module Xcodeproj
552
552
  end
553
553
  end
554
554
 
555
+ # Adds on demand resources to the resources build phase of the target.
556
+ #
557
+ # @param {String => [Array<PBXFileReference>]} on_demand_resource_tag_files
558
+ # the files references of the on demand resources to add to the target keyed by the tag.
559
+ #
560
+ # @return [void]
561
+ #
562
+ def add_on_demand_resources(on_demand_resource_tag_files)
563
+ on_demand_resource_tag_files.each do |tag, file_refs|
564
+ file_refs.each do |file_ref|
565
+ if resources_build_phase.include?(file_ref)
566
+ existing_build_file = resources_build_phase.build_file(file_ref)
567
+ existing_build_file.settings ||= {}
568
+ existing_build_file.settings['ASSET_TAGS'] ||= []
569
+ existing_build_file.settings['ASSET_TAGS'] << tag
570
+ existing_build_file.settings['ASSET_TAGS'].uniq!
571
+ next
572
+ end
573
+ build_file = resources_build_phase.add_file_reference(file_ref, true)
574
+ build_file.settings = (build_file.settings ||= {}).merge('ASSET_TAGS' => [tag])
575
+ end
576
+ end
577
+ end
578
+
579
+ # Remove on demand resources from the resources build phase of the target.
580
+ #
581
+ # @param {String => [Array<PBXFileReference>]} on_demand_resource_tag_files
582
+ # the files references of the on demand resources to add to the target keyed by the tag.
583
+ #
584
+ # @return [void]
585
+ #
586
+ def remove_on_demand_resources(on_demand_resource_tag_files)
587
+ on_demand_resource_tag_files.each do |tag, file_refs|
588
+ file_refs.each do |file_ref|
589
+ build_file = resources_build_phase.build_file(file_ref)
590
+ next if build_file.nil?
591
+ asset_tags = build_file.settings['ASSET_TAGS']
592
+ asset_tags.delete(tag)
593
+ resources_build_phase.remove_file_reference(file_ref) if asset_tags.empty?
594
+ end
595
+ end
596
+ end
597
+
555
598
  # Finds or creates the headers build phase of the target.
556
599
  #
557
600
  # @note A target should have only one headers build phase.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodeproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.20.0
4
+ version: 1.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-05 00:00:00.000000000 Z
11
+ date: 2021-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: atomos