cocoapods-mapfile 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +65 -64
  3. data/lib/cocoapods_plugin.rb +16 -16
  4. data/lib/hmap/command/hmap_gen.rb +19 -27
  5. data/lib/hmap/command/hmap_reader.rb +5 -5
  6. data/lib/hmap/command/hmap_writer.rb +5 -3
  7. data/lib/hmap/command.rb +3 -1
  8. data/lib/hmap/constants.rb +198 -0
  9. data/lib/hmap/{executable.rb → helper/executable.rb} +5 -6
  10. data/lib/hmap/hmap/hmap_bucketstr.rb +20 -0
  11. data/lib/hmap/{hmap_reader.rb → hmap/hmap_reader.rb} +4 -20
  12. data/lib/hmap/{hmap_saver.rb → hmap/hmap_saver.rb} +11 -6
  13. data/lib/hmap/{hmap_struct.rb → hmap/hmap_struct.rb} +0 -0
  14. data/lib/hmap/hmap/hmap_writer.rb +52 -0
  15. data/lib/hmap/{mapfile.rb → hmap/mapfile.rb} +1 -1
  16. data/lib/hmap/user_interface.rb +22 -0
  17. data/lib/hmap/version.rb +1 -1
  18. data/lib/hmap/xc/context.rb +23 -0
  19. data/lib/hmap/xc/header_entry.rb +55 -0
  20. data/lib/hmap/xc/header_type.rb +32 -0
  21. data/lib/hmap/xc/pbx_helper.rb +68 -0
  22. data/lib/hmap/xc/product_helper.rb +36 -0
  23. data/lib/hmap/xc/resolver.rb +129 -0
  24. data/lib/hmap/xc/target/build_setting.rb +126 -0
  25. data/lib/hmap/xc/target/target.rb +76 -0
  26. data/lib/hmap/xc/target/target_context.rb +29 -0
  27. data/lib/hmap/xc/target/target_helper.rb +114 -0
  28. data/lib/hmap/xc/target/target_vfs.rb +122 -0
  29. data/lib/hmap/xc/target/xcconfig_helper.rb +109 -0
  30. data/lib/hmap/xc/workspace/project.rb +120 -0
  31. data/lib/hmap/xc/workspace/project_helper.rb +92 -0
  32. data/lib/hmap/xc/workspace/workspace.rb +83 -0
  33. data/lib/hmap.rb +16 -14
  34. metadata +58 -20
  35. data/lib/hmap/framework/framework_vfs.rb +0 -94
  36. data/lib/hmap/helper/build_setting_constants.rb +0 -13
  37. data/lib/hmap/helper/hmap_helper.rb +0 -212
  38. data/lib/hmap/helper/pods_helper.rb +0 -98
  39. data/lib/hmap/helper/xcconfig_helper.rb +0 -105
  40. data/lib/hmap/hmap_writer.rb +0 -99
  41. data/lib/hmap/pods_specification.rb +0 -65
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'hmap/xc/target/build_setting'
4
+ require 'hmap/xc/target/target_helper'
5
+ require 'hmap/xc/target/xcconfig_helper'
6
+
7
+ module HMap
8
+ class Target
9
+ include HMap::Target::Helper
10
+
11
+ attr_reader :entrys, :target, :project
12
+
13
+ def initialize(entrys, target, project)
14
+ @entrys = entrys || []
15
+ @target = target
16
+ @project = project
17
+ end
18
+
19
+ def platforms
20
+ project.platforms
21
+ end
22
+
23
+ def write_hmapfile!
24
+ datas = headers_hash(:own_target_headers)
25
+ build_settings = BuildSettingsWriter.new(platforms, context)
26
+ build_settings.write_or_symlink(project.context.hmap_root, datas, Constants::HMAP_FILE_TYPE)
27
+ end
28
+
29
+ def save_hmap_settings!
30
+ xcconfig_paths.each do |path|
31
+ settings = Constants.instance.hmap_build_settings
32
+ XcodeprojHelper.new(path).add_build_settings_and_save(settings, use_origin: Resolver.instance.use_origin)
33
+ end
34
+ end
35
+
36
+ def remove_hmap_settings!
37
+ xcconfig_paths.each { |path| HMap::XcodeprojHelper.new(path).remove_build_settings_and_save }
38
+ end
39
+
40
+ private
41
+
42
+ def xcconfig_paths
43
+ return @xcconfig_paths if defined?(@xcconfig_paths)
44
+
45
+ @xcconfig_paths = target.build_configuration_list.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
+ File.expand_path File.join(project.project_dir, s_path, x)
52
+ end
53
+ end
54
+ end.compact
55
+ # @xcconfig_paths = TargetConfiguration.new_from_xc(target, project.project_dir).map do |c|
56
+ # c.xcconfig_path unless c.xcconfig_path.nil?
57
+ # end.compact
58
+ # @xcconfig_paths = bc.map(&:xcconfig_path).compact
59
+ # xc_type = 'XCConfigurationList'
60
+ # xcs = target.build_configuration_list.build_configurations
61
+ # @xcconfig_paths = xcs.map do |xc|
62
+ # if xc.isa == xc_type
63
+ # xc_path = xc.instance_variable_get('@simple_attributes_hash')['path'] || ''
64
+ # { xc => File.join(project.project_dir, xc_path) }
65
+ # else
66
+ # # ab_path = Pathname(project.project_dir + "hmap-#{name}.#{xc.name}.xcconfig")
67
+ # # File.new(ab_path, 'w') unless ab_path.exist?
68
+ # # xc_ref = target.project.new_file(ab_path)
69
+ # # xc.base_configuration_reference = xc_ref
70
+ # # target.project.save
71
+ # # ab_path
72
+ # end
73
+ # end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HMap
4
+ class Target
5
+ class TargetContext < Context
6
+ attr_reader :product_name
7
+ def initialize(build_root, temp_dir, hmap_root, temp_name, build_dir, product_name, full_product_name, defines_modules, build_as_framework_swift)
8
+ super(build_root, temp_dir, hmap_root, temp_name, build_dir)
9
+ @full_product_name = full_product_name
10
+ @product_name = product_name
11
+ @defines_modules = defines_modules
12
+ @build_as_framework_swift = build_as_framework_swift
13
+ end
14
+
15
+ def build_as_framework_swift?
16
+ @build_as_framework_swift
17
+ end
18
+
19
+ def defines_modules?
20
+ @defines_modules
21
+ end
22
+
23
+ def build_path(platform)
24
+ path = super(platform)
25
+ File.join(path, @full_product_name)
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,114 @@
1
+ require 'hmap/xc/target/target_context'
2
+
3
+ module HMap
4
+ class Target
5
+ module Helper
6
+ include HMap::HeaderType
7
+
8
+ define_method(:all_product_headers) do
9
+ return @all_product_headers if defined? @all_product_headers
10
+
11
+ public_headers = public_entrys.map(&:path)
12
+ private_headers = private_entrys.map(&:path)
13
+ @all_product_headers = TargetVFS.new(public_headers, private_headers, platforms, context).vfs_entrys
14
+ end
15
+
16
+ define_method(:all_non_framework_target_headers) do
17
+ return if build_as_framework?
18
+
19
+ p_h = public_entrys + private_entrys
20
+ p_h.flat_map { |entry| entry.full_module_buckets(product_name) }
21
+ end
22
+
23
+ # all_targets include header full module path
24
+ define_method(:all_target_headers) do
25
+ p_h = public_entrys + private_entrys
26
+ p_h.flat_map do |entry|
27
+ entry.full_module_buckets_extra(product_name) + entry.module_buckets(product_name)
28
+ end
29
+ end
30
+
31
+ define_method(:project_headers) do
32
+ all_target_headers + project_entrys.flat_map(&:project_buckets_extra)
33
+ end
34
+
35
+ define_method(:own_target_headers) do
36
+ headers = public_entrys + private_entrys
37
+ headers = headers.flat_map { |entry| entry.module_buckets(product_name) }
38
+ headers + project_entrys.flat_map do |entry|
39
+ entry.project_buckets + entry.full_module_buckets(product_name)
40
+ end
41
+ end
42
+ def build_root
43
+ project.build_root
44
+ end
45
+
46
+ def hmap_root
47
+ project.hmap_root
48
+ end
49
+
50
+ def target_name
51
+ target.name
52
+ end
53
+
54
+ def product_name
55
+ target.product_name
56
+ end
57
+
58
+ def full_product_name
59
+ target.product_reference.instance_variable_get('@simple_attributes_hash')['path'] || ''
60
+ end
61
+
62
+ def temp_name
63
+ "#{target_name}.build"
64
+ end
65
+
66
+ def temp_dir
67
+ project.temp_dir
68
+ end
69
+
70
+ def build_dir
71
+ return @build_dir if defined?(@build_dir)
72
+
73
+ b_d = xcconfig_paths.any? do |path|
74
+ xc = Xcodeproj::Config.new(path)
75
+ !xc.attributes[Constants::CONFIGURATION_BUILD_DIR].nil?
76
+ end
77
+ @build_dir = target_name if b_d
78
+ end
79
+
80
+ def build_as_framework?
81
+ PBXHelper.build_as_framework?(target)
82
+ end
83
+
84
+ def build_as_framework_swift?
85
+ uses_swift? && build_as_framework?
86
+ end
87
+
88
+ def uses_swift?
89
+ return @uses_swift if defined?(@uses_swift)
90
+
91
+ @uses_swift = PBXHelper.uses_swift?(target)
92
+ end
93
+
94
+ def defines_module?
95
+ return @defines_module if defined?(@defines_module)
96
+ return @defines_module = true if build_as_framework?
97
+
98
+ @defines_module = PBXHelper.defines_module?(target)
99
+ end
100
+
101
+ def context
102
+ TargetContext.new(build_root,
103
+ temp_dir,
104
+ hmap_root,
105
+ temp_name,
106
+ build_dir,
107
+ product_name,
108
+ full_product_name,
109
+ defines_module?,
110
+ build_as_framework_swift?)
111
+ end
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,122 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yaml_vfs'
4
+
5
+ module HMap
6
+ class TargetVFSEntry
7
+ attr_reader :real_path, :virtual_path
8
+
9
+ def initialize(build_dir, file)
10
+ @real_path = file
11
+ @virtual_path = File.join(build_dir, File.basename(file))
12
+ end
13
+ end
14
+
15
+ class TargetPlatformVFS
16
+ def initialize(platform, setting)
17
+ @platform = platform
18
+ @setting = setting
19
+ end
20
+
21
+ def product_name
22
+ File.basename(build_dir, '.*')
23
+ end
24
+
25
+ def build_dir
26
+ @setting.build_path(@platform)
27
+ end
28
+
29
+ def temp_dir
30
+ @setting.temp_path(@platform)
31
+ end
32
+
33
+ def defines_modules?
34
+ @setting.defines_modules?
35
+ end
36
+
37
+ def module_path
38
+ File.join(temp_dir, 'module.modulemap') if defines_modules?
39
+ end
40
+
41
+ def private_module_path
42
+ File.join(temp_dir, 'module.private.modulemap') if defines_modules?
43
+ end
44
+
45
+ def swift_header_path
46
+ File.join(build_dir, 'Headers', "#{product_name}-Swift.h") if @setting.build_as_framework_swift?
47
+ end
48
+
49
+ def public_headers_dir
50
+ File.join(build_dir, 'Headers')
51
+ end
52
+
53
+ def private_headers_dir
54
+ File.join(build_dir, 'PrivateHeaders')
55
+ end
56
+
57
+ def module_dir
58
+ File.join(build_dir, 'Modules')
59
+ end
60
+ end
61
+
62
+
63
+ # A collection of Each TargetVFSEntry
64
+ class TargetVFS
65
+ def initialize(public_headers, private_headers, platforms, setting)
66
+ @setting = setting
67
+ @platforms = platforms
68
+ @public_headers = public_headers
69
+ @private_headers = private_headers
70
+ end
71
+
72
+ def add_headers_modules(config)
73
+ r_public_paths = []
74
+ r_public_paths += @public_headers
75
+ s_h = config.swift_header_path
76
+ r_public_paths << s_h unless s_h.nil?
77
+ r_private_paths = []
78
+ r_private_paths += @private_headers
79
+ headers = []
80
+ headers += add_files(r_public_paths, config.public_headers_dir)
81
+ headers += add_files(r_private_paths, config.private_headers_dir)
82
+ modules_real_paths = []
83
+ if config.defines_modules?
84
+ modules_real_paths << config.module_path
85
+ modules_real_paths << config.private_module_path unless r_private_paths.empty?
86
+ end
87
+ headers += add_files(modules_real_paths, config.module_dir) || []
88
+ headers
89
+ end
90
+
91
+ def add_files(files, virtual_dir)
92
+ return if files.nil?
93
+
94
+ files.map { |file| TargetVFSEntry.new(virtual_dir, file) }
95
+ end
96
+
97
+ def vfs_entrys
98
+ Hash[@platforms.map do |platform|
99
+ config = TargetPlatformVFS.new(platform, @setting)
100
+ [platform.to_s, add_headers_modules(config)]
101
+ end]
102
+ end
103
+ end
104
+
105
+ class TargetVFSWriter
106
+ attr_reader :entrys
107
+
108
+ def initialize(entrys)
109
+ @entrys = entrys
110
+ end
111
+
112
+ def write!(path)
113
+ es = @entrys.map do |entry|
114
+ VFS::FileCollectorEntry.new(entry.real_path, entry.virtual_path)
115
+ end.uniq
116
+ fc = VFS::FileCollector.new(es)
117
+ pa = Pathname.new(path)
118
+ pa.dirname.mkpath unless pa.exist?
119
+ fc.write_mapping(pa)
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,109 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HMap
4
+ # A collection of xcodeproj Helper functions used throughout hmap.
5
+ class XcodeprojHelper
6
+ HMAP_XCKEY_START = 'HMAP_'
7
+ SAVE_XCKEY_START = 'SAVE_'
8
+ private_constant :HMAP_XCKEY_START, :SAVE_XCKEY_START
9
+
10
+ attr_reader :xcconfig_path
11
+
12
+ def initialize(path)
13
+ xc = Pathname(path)
14
+ @xcconfig_path = xc
15
+ @xcconfig = Xcodeproj::Config.new(xc)
16
+ end
17
+
18
+ def add_build_settings_and_save(settings, use_origin: true)
19
+ add_build_settings(settings, use_origin)
20
+ build_settings = [Constants::HEADER_SEARCH_PATHS, Constants::USER_HEADER_SEARCH_PATHS]
21
+ if use_origin
22
+ remove_build_settings(settings)
23
+ else
24
+ save_build_settings(settings)
25
+ end
26
+ save_as
27
+ end
28
+
29
+ def add_build_settings(settings, use_origin)
30
+ settings.each do |key, value|
31
+ add_build_setting(key.to_s, value, use_origin)
32
+ end
33
+ end
34
+
35
+ def add_build_setting(key, value, use_origin)
36
+ return if value.nil?
37
+
38
+ if key.start_with?(HMAP_XCKEY_START)
39
+ @xcconfig.attributes[key] = value
40
+ else
41
+ save_origin = save_build_setting(key)
42
+ e_value = value
43
+ e_value = "#{e_value} ${#{save_xckey(key)}}" if use_origin && !save_origin.nil?
44
+ @xcconfig.attributes[hmap_xckey(key)] = e_value
45
+ @xcconfig.attributes[key] = "${#{hmap_xckey(key)}}"
46
+ end
47
+ end
48
+
49
+ def save_build_settings(settings)
50
+ settings ||= []
51
+ settings.each { |key| save_build_setting(key) }
52
+ end
53
+
54
+ def save_build_setting(key)
55
+ origin = @xcconfig.attributes[key]
56
+ if origin.nil? || !origin.include?(hmap_xckey(key))
57
+ @xcconfig.attributes[save_xckey(key)] = origin unless origin.nil?
58
+ @xcconfig.attributes.delete(key)
59
+ end
60
+ @xcconfig.attributes[save_xckey(key)]
61
+ end
62
+
63
+ def remove_build_settings_and_save
64
+
65
+ hmap_ks = @xcconfig.attributes.keys.each_with_object([]) do |key, sum|
66
+ sum << key[HMAP_XCKEY_START.length..-1] if key.start_with?(HMAP_XCKEY_START)
67
+ sum << key[SAVE_XCKEY_START.length..-1] if key.start_with?(SAVE_XCKEY_START)
68
+ end.compact
69
+ remove_build_settings(hmap_ks)
70
+ save_as
71
+ end
72
+
73
+ def remove_build_settings(settings)
74
+ settings ||= []
75
+ settings.each { |setting| remove_build_setting(setting) }
76
+ end
77
+
78
+ def remove_build_setting(setting)
79
+ save_origin = @xcconfig.attributes[save_xckey(setting)]
80
+ origin = @xcconfig.attributes[setting]
81
+ if save_origin.nil? && !origin.nil? && origin.include?(hmap_xckey(setting))
82
+ @xcconfig.attributes.delete(setting)
83
+ end
84
+ @xcconfig.attributes[setting] = save_origin unless save_origin.nil?
85
+ @xcconfig.attributes.delete(hmap_xckey(setting))
86
+ @xcconfig.attributes.delete(save_xckey(setting))
87
+ end
88
+
89
+ def save_as(path = nil)
90
+ path = xcconfig_path if path.nil?
91
+ @xcconfig.save_as(path)
92
+ end
93
+
94
+ private
95
+
96
+ def build_setting?(key)
97
+ !@xcconfig.attributes[key].nil?
98
+ end
99
+
100
+
101
+ def hmap_xckey(key)
102
+ "#{HMAP_XCKEY_START}#{key}"
103
+ end
104
+
105
+ def save_xckey(key)
106
+ "#{SAVE_XCKEY_START}#{key}"
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,120 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'hmap/xc/workspace/project_helper'
4
+ require 'hmap/xc/target/target'
5
+
6
+ module HMap
7
+ HEADER_FILES_EXTENSIONS = %w[.h .hh .hpp .ipp .tpp .hxx .def .inl .inc .pch]
8
+
9
+ class Project
10
+ include HMap::Project::Helper
11
+
12
+ attr_reader :project, :workspace
13
+
14
+ def initialize(project, workspace)
15
+ @project = project
16
+ @workspace = workspace
17
+ end
18
+
19
+ def platforms
20
+ return @platforms if defined? @platforms
21
+
22
+ build_configurations = project.build_configuration_list.build_configurations
23
+ build_configurations += project.targets.flat_map do |target|
24
+ target.build_configuration_list.build_configurations
25
+ end
26
+
27
+ ps = build_configurations.flatten.each_with_object({}) do |configuration, sum|
28
+ bs = configuration.build_settings
29
+ d_t = []
30
+ d_t << :osx unless bs['MACOSX_DEPLOYMENT_TARGET'].nil?
31
+ d_t << :ios unless bs['IPHONEOS_DEPLOYMENT_TARGET'].nil?
32
+ d_t << :watchos unless bs['WATCHOS_DEPLOYMENT_TARGET'].nil?
33
+ d_t << :tvos unless bs['TVOS_DEPLOYMENT_TARGET'].nil?
34
+ sum[configuration.name] ||= []
35
+ sum[configuration.name] += d_t unless d_t.empty?
36
+ end
37
+
38
+ @platforms = ps.flat_map do |key, value|
39
+ Platform.new_from_platforms(key, value.uniq)
40
+ end
41
+ end
42
+
43
+ def targets
44
+ return @targets if defined?(@targets)
45
+
46
+ project_dir = project.project_dir
47
+
48
+ h_ts = project.targets.map do |target|
49
+ next if target.is_a?(Constants::PBXAggregateTarget)
50
+
51
+ name = target.name
52
+ headers = target.build_phases.flat_map do |phase|
53
+ next unless phase.is_a?(Constants::PBXHeadersBuildPhase)
54
+
55
+ phase.files.flat_map do |file|
56
+ ff = file.file_ref
57
+ f_path = ff.instance_variable_get('@simple_attributes_hash')['path'] || ''
58
+ g_path = PBXHelper.group_paths(ff)
59
+ header_entry(project_dir, g_path, f_path, file)
60
+ end
61
+ end.compact
62
+ Target.new(headers, target, self)
63
+ end.compact
64
+ @targets = h_ts || []
65
+ end
66
+
67
+ def write_hmapfile!
68
+ hmap_writer = BuildSettingsWriter.new(platforms, context)
69
+ types = %i[all_non_framework_target_headers project_headers all_target_headers all_product_headers]
70
+ datas = headers_hash(*types)
71
+ hmap_writer.write_or_symlink(nil, datas, %i[all_product_headers])
72
+ targets.each(&:write_hmapfile!)
73
+ end
74
+
75
+ def save_hmap_settings!
76
+ targets.each(&:save_hmap_settings!)
77
+ end
78
+
79
+ def remove_hmap_settings!
80
+ targets.each(&:remove_hmap_settings!)
81
+ end
82
+
83
+ private
84
+
85
+ def header_entry(project_dir, group, file, xc)
86
+ settings_h = xc.instance_variable_get('@simple_attributes_hash') || {}
87
+ settings = settings_h['settings'] || {}
88
+ attributes = settings['ATTRIBUTES']
89
+ full_path = File.expand_path(File.join(project_dir, group, file))
90
+ extra_headers = []
91
+ extra_headers << File.join(group, file)
92
+ extra_headers << File.join(file)
93
+ extra_headers.uniq!
94
+ types = %i[Public Private Project]
95
+ attributes = 'Project' if attributes.nil?
96
+ ts = types.select { |type| attributes.include?(type.to_s) }
97
+ ts.map { |t| HeaderEntry.new(full_path, extra_headers, t) }
98
+ end
99
+
100
+ def entrys
101
+ return @entrys if defined?(@entrys)
102
+
103
+ project_dir = project.project_dir
104
+ @entrys = project.objects_by_uuid.flat_map do |_uuid, ff|
105
+ next unless ff.is_a?(Constants::PBXFileReference)
106
+
107
+ f_path = ff.instance_variable_get('@simple_attributes_hash')['path'] || ''
108
+ next unless HEADER_FILES_EXTENSIONS.include?(File.extname(f_path))
109
+
110
+ builds = ff.referrers.select { |e| e.is_a?(Constants::PBXBuildFile) } || []
111
+ g_path = PBXHelper.group_paths(ff)
112
+ if builds.empty?
113
+ header_entry(project_dir, g_path, f_path, nil)
114
+ else
115
+ builds.flat_map { |bf| header_entry(project_dir, g_path, f_path, bf) }
116
+ end
117
+ end.compact
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,92 @@
1
+ require 'hmap/xc/header_type'
2
+ require 'hmap/xc/context'
3
+
4
+ module HMap
5
+ class Project
6
+ module Helper
7
+ include HMap::HeaderType
8
+
9
+ define_method(:all_product_headers) do
10
+ return @all_product_headers if defined? @all_product_headers
11
+
12
+ @all_product_headers = targets.each_with_object({}) do |target, sum|
13
+ next if target.all_product_headers.nil?
14
+
15
+ sum.merge!(target.all_product_headers) { |_, oldval, newval| newval + oldval }
16
+ end
17
+ end
18
+
19
+ define_method(:all_non_framework_target_headers) do
20
+ return @all_non_framework_target_headers if defined?(@all_non_framework_target_headers)
21
+
22
+ @all_non_framework_target_headers = targets.flat_map(&:all_non_framework_target_headers).compact
23
+ end
24
+
25
+ # all_targets include header full module path
26
+ define_method(:all_target_headers) do
27
+ return @all_target_headers if defined?(@all_target_headers)
28
+
29
+ @all_target_headers = workspace.all_target_headers
30
+ end
31
+
32
+ define_method(:project_headers) do
33
+ return @project_headers if defined?(@project_headers)
34
+
35
+ @project_headers = all_target_headers + project_entrys.flat_map { |entry| entry.project_buckets_extra }
36
+ end
37
+
38
+ def project_references
39
+ return @project_references if defined? @project_references
40
+
41
+ project_references = PBXHelper.project_references(project)
42
+ @project_references = project_references.map { |pr| Project.new(pr, workspace) }
43
+ end
44
+
45
+ def temp_name
46
+ "#{project_name}.build"
47
+ end
48
+
49
+ def build_dir() end
50
+
51
+ def project_name
52
+ project.root_object.name
53
+ end
54
+
55
+ def project_dir
56
+ project.project_dir
57
+ end
58
+
59
+ def temp_name
60
+ "#{project_name}.build"
61
+ end
62
+
63
+ def temp_root
64
+ File.join(workspace.obj_root, temp_name)
65
+ end
66
+
67
+ def build_root
68
+ workspace.build_root
69
+ end
70
+
71
+ def temp_dir
72
+ workspace.obj_root
73
+ end
74
+
75
+ def hmap_root
76
+ File.join(workspace.hmap_root, temp_name)
77
+ end
78
+
79
+ def build_data_dir
80
+ Constants::XCBuildData
81
+ end
82
+
83
+ def context
84
+ HMap::Context.new(build_root,
85
+ temp_dir,
86
+ File.join(hmap_root, build_data_dir),
87
+ '',
88
+ build_dir)
89
+ end
90
+ end
91
+ end
92
+ end