cocoapods-mapfile 0.2.7.0 → 0.2.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e976ef653409840f3071bf38d444adde2bf7fd3c3c3b4b5cf3306749e481e204
4
- data.tar.gz: 76a41c0215836e6865cb3b8f4de6ac455a4698c1d86e3cc864dc52288c1a1581
3
+ metadata.gz: aaaa78e71fbc30aa040f8a0ad7d14ad0af6691a406e40a1002119c8b39a06f7c
4
+ data.tar.gz: 790ac93ec756eb422472df923f99d4d706638b69141ccd43e84a515cac42cdad
5
5
  SHA512:
6
- metadata.gz: f778fbad37bf41df0f26bd337c54babc8af7adb887cc64947aa90a00b3cb998c9fcae367c2ae3b3ab852e2213e08c15d0afe1c07dcccbd6d6808b1a2b4fe7979
7
- data.tar.gz: 49a92092bdd8ea77ca0c22a8d251bf168b36eb17f0b10f1b6609e7d7cf914f124c3d25016f8b392dd4b1e4370821fe1c9a9f2ecb0eb0abe476d1056ad0114d8a
6
+ metadata.gz: 4bca57920f0d2ef6bc29aa611c221c1e1b1f86e95abf4ac2225fa160dd44a51456a3ba4044202dde4088994d663bb30c2ed02f640947e8e825cc7e7264de63d7
7
+ data.tar.gz: eb3623e1250bbf2d1ae177aaf819735cd410fb43eba476727350fc0ed6d662bd8e6bc03b51e38b4377f45c665d953622fc6bf04aff9d091b92274bbf1ebe309d
@@ -40,7 +40,7 @@ module HMap
40
40
 
41
41
  def run
42
42
  UserInterface.puts "\n[hmapfile-from-json] start"
43
- if File.exist?(@json_path) && File.exist?(@output_path)
43
+ if File.exist?(@json_path)
44
44
  require 'json'
45
45
  json_file = File.read(@json_path)
46
46
  json = JSON.parse(json_file)
@@ -1,5 +1,5 @@
1
1
  module HMap
2
2
  # The version of the hmapfile command line tool.
3
3
  #
4
- VERSION = '0.2.7.0'.freeze unless defined? HMap::VERSION
4
+ VERSION = '0.2.7.1'.freeze unless defined? HMap::VERSION
5
5
  end
@@ -9,11 +9,13 @@ module HMap
9
9
  include HMap::Target::Helper
10
10
 
11
11
  attr_reader :entrys, :target, :project
12
+ attr_accessor :xcconfig_paths
12
13
 
13
14
  def initialize(entrys, target, project)
14
15
  @entrys = entrys || []
15
16
  @target = target
16
17
  @project = project
18
+ @xcconfig_paths = []
17
19
  end
18
20
 
19
21
  def platforms
@@ -27,53 +29,63 @@ module HMap
27
29
  end
28
30
 
29
31
  def save_hmap_settings!
30
- xcconfig_paths.each do |path|
32
+ build_setting_paths.each do |path|
31
33
  settings = Constants.instance.hmap_build_settings
32
34
  XcodeprojHelper.new(path).add_build_settings_and_save(settings, use_origin: Resolver.instance.use_origin)
33
35
  end
34
36
  end
35
37
 
36
38
  def remove_hmap_settings!
37
- xcconfig_paths.each { |path| HMap::XcodeprojHelper.new(path).remove_build_settings_and_save }
39
+ build_setting_paths.each { |path| HMap::XcodeprojHelper.new(path).remove_build_settings_and_save }
38
40
  end
39
41
 
40
42
  private
41
43
 
42
- def xcconfig_paths
43
- return @xcconfig_paths if defined?(@xcconfig_paths)
44
+ def build_setting_paths
45
+ return @build_setting_paths if defined?(@build_setting_paths)
44
46
 
45
- @xcconfig_paths = target.build_configurations.flat_map do |configuration|
46
- if configuration.is_a?(Constants::XCBuildConfiguration)
47
- bcr = configuration.base_configuration_reference
48
- unless bcr.nil?
49
- s_path = PBXHelper.group_paths(bcr)
50
- x = bcr.instance_variable_get('@simple_attributes_hash')['path'] || ''
51
- path = File.expand_path(File.join(project.project_dir, s_path, x))
52
- xc = XCConfig.new(path)
53
- inc = xc.includes_paths
54
- path if inc.empty? || project.workspace.xcconfig_paths.none? { |pa| inc.include?(pa) }
55
- end
56
- end
47
+ @build_setting_paths = xcconfig_paths.map do |path|
48
+ xc = XCConfig.new(path)
49
+ inc = xc.includes_paths
50
+ path if inc.empty? || project.workspace.xcconfig_paths.none? { |pa| inc.include?(pa) }
57
51
  end.compact
58
-
59
- # @xcconfig_paths = target.build_configuration_list.build_configurations.flat_map do |configuration|
60
- # if configuration.is_a?(Constants::XCBuildConfiguration)
61
- # bcr = configuration.base_configuration_reference
62
- # # if bcr.nil?
63
- # # ab_path = Pathname(project.project_dir + "hmap-#{target_name}.#{configuration.name}.xcconfig")
64
- # # File.new(ab_path, 'w') unless ab_path.exist?
65
- # # xc_ref = target.project.new_file(ab_path)
66
- # # configuration.base_configuration_reference = xc_ref
67
- # # target.project.save
68
- # # ab_path
69
- # # else
70
- # unless bcr.nil?
71
- # s_path = PBXHelper.group_paths(bcr)
72
- # x = bcr.instance_variable_get('@simple_attributes_hash')['path'] || ''
73
- # File.expand_path File.join(project.project_dir, s_path, x)
74
- # end
75
- # end
76
- # end.compact
77
52
  end
53
+
54
+ # def xcconfig_paths
55
+ # return @xcconfig_paths if defined?(@xcconfig_paths)
56
+
57
+ # @xcconfig_paths = target.build_configurations.flat_map do |configuration|
58
+ # if configuration.is_a?(Constants::XCBuildConfiguration)
59
+ # bcr = configuration.base_configuration_reference
60
+ # unless bcr.nil?
61
+ # s_path = PBXHelper.group_paths(bcr)
62
+ # x = bcr.instance_variable_get('@simple_attributes_hash')['path'] || ''
63
+ # path = File.expand_path(File.join(project.project_dir, s_path, x))
64
+ # xc = XCConfig.new(path)
65
+ # inc = xc.includes_paths
66
+ # path if inc.empty? || project.workspace.xcconfig_paths.none? { |pa| inc.include?(pa) }
67
+ # end
68
+ # end
69
+ # end.compact
70
+
71
+ # @xcconfig_paths = target.build_configuration_list.build_configurations.flat_map do |configuration|
72
+ # if configuration.is_a?(Constants::XCBuildConfiguration)
73
+ # bcr = configuration.base_configuration_reference
74
+ # # if bcr.nil?
75
+ # # ab_path = Pathname(project.project_dir + "hmap-#{target_name}.#{configuration.name}.xcconfig")
76
+ # # File.new(ab_path, 'w') unless ab_path.exist?
77
+ # # xc_ref = target.project.new_file(ab_path)
78
+ # # configuration.base_configuration_reference = xc_ref
79
+ # # target.project.save
80
+ # # ab_path
81
+ # # else
82
+ # unless bcr.nil?
83
+ # s_path = PBXHelper.group_paths(bcr)
84
+ # x = bcr.instance_variable_get('@simple_attributes_hash')['path'] || ''
85
+ # File.expand_path File.join(project.project_dir, s_path, x)
86
+ # end
87
+ # end
88
+ # end.compact
89
+ # end
78
90
  end
79
91
  end
@@ -94,7 +94,7 @@ module HMap
94
94
  def build_dir
95
95
  return @build_dir if defined?(@build_dir)
96
96
 
97
- b_d = xcconfig_paths.none? { |path| XCConfig.new(path).attributes[Constants::CONFIGURATION_BUILD_DIR].nil? }
97
+ b_d = build_setting_paths.none? { |path| XCConfig.new(path).attributes[Constants::CONFIGURATION_BUILD_DIR].nil? }
98
98
  @build_dir = target_name if b_d
99
99
  end
100
100
 
@@ -10,6 +10,10 @@ module HMap
10
10
  @real_path = file
11
11
  @virtual_path = File.join(build_dir, File.basename(file))
12
12
  end
13
+
14
+ def eql?(other)
15
+ other.real_path == real_path && other.virtual_path == virtual_path
16
+ end
13
17
  end
14
18
 
15
19
  class TargetPlatformVFS
@@ -9,11 +9,20 @@ module HMap
9
9
  define_method(:all_product_headers) do
10
10
  return @all_product_headers if defined? @all_product_headers
11
11
 
12
- @all_product_headers = targets.each_with_object({}) do |target, sum|
12
+ hs = targets.each_with_object({}) do |target, sum|
13
13
  next if target.all_product_headers.nil?
14
14
 
15
15
  sum.merge!(target.all_product_headers) { |_, oldval, newval| newval + oldval }
16
16
  end
17
+
18
+ if targets.any?(&:app_target?)
19
+ workspace.projects.each do |pr|
20
+ next if pr == self
21
+
22
+ hs.merge!(pr.all_product_headers) { |_, v1, v2| v1 + v2 }
23
+ end
24
+ end
25
+ @all_product_headers = hs
17
26
  end
18
27
 
19
28
  define_method(:all_non_framework_target_headers) do
@@ -37,13 +46,13 @@ module HMap
37
46
  hs = targets.inject({}) do |sum, entry|
38
47
  sum.merge!(entry.project_headers) { |_, v1, _| v1 }
39
48
  end
40
- # if targets.any?(&:app_target?)
41
- # workspace.projects.each do |pr|
42
- # next if pr == self
49
+ if targets.any?(&:app_target?)
50
+ workspace.projects.each do |pr|
51
+ next if pr == self
43
52
 
44
- # hs.merge!(pr.project_headers) { |_, v1, _| v1 }
45
- # end
46
- # end
53
+ hs.merge!(pr.project_headers) { |_, v1, _| v1 }
54
+ end
55
+ end
47
56
  @project_headers = project_entrys.inject(hs) do |sum, entry|
48
57
  sum.merge!(entry.project_buckets_extra) { |_, v1, _| v1 }
49
58
  end
@@ -96,7 +96,9 @@ module HMap
96
96
 
97
97
  s_path = PBXHelper.group_paths(bcr)
98
98
  x = bcr.instance_variable_get('@simple_attributes_hash')['path'] || ''
99
- File.expand_path(File.join(project.project_dir, s_path, x))
99
+ path = File.expand_path(File.join(project.project_dir, s_path, x))
100
+ target.xcconfig_paths << path
101
+ path
100
102
  end.compact
101
103
  end
102
104
  end.uniq
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-mapfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7.0
4
+ version: 0.2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cat1237
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-07 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler