cocoapods 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cocoapods.rb +1 -1
- data/lib/cocoapods/installer.rb +22 -9
- data/lib/cocoapods/specification.rb +2 -2
- metadata +2 -2
data/lib/cocoapods.rb
CHANGED
data/lib/cocoapods/installer.rb
CHANGED
@@ -29,8 +29,9 @@ module Pod
|
|
29
29
|
def xcconfig
|
30
30
|
@xcconfig ||= Xcodeproj::Config.new({
|
31
31
|
# In a workspace this is where the static library headers should be found.
|
32
|
-
'
|
33
|
-
'
|
32
|
+
'PODS_ROOT' => '"$(SRCROOT)/Pods"',
|
33
|
+
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers"',
|
34
|
+
'ALWAYS_SEARCH_USER_PATHS' => 'YES', # needed to make EmbedReader build
|
34
35
|
# This makes categories from static libraries work, which many libraries
|
35
36
|
# require, so we add these by default.
|
36
37
|
'OTHER_LDFLAGS' => '-ObjC -all_load',
|
@@ -76,30 +77,41 @@ module Pod
|
|
76
77
|
"#{@definition.lib_name}-prefix.pch"
|
77
78
|
end
|
78
79
|
|
80
|
+
def headers_symlink_path_name
|
81
|
+
"#{config.project_pods_root}/Headers"
|
82
|
+
end
|
83
|
+
|
79
84
|
# TODO move xcconfig related code into the xcconfig method, like copy_resources_script and generate_bridge_support.
|
80
85
|
def install!
|
81
86
|
# First add the target to the project
|
82
87
|
@target = @project.targets.new_static_library(@definition.lib_name)
|
83
88
|
|
84
|
-
|
89
|
+
# Clean old header symlinks
|
90
|
+
FileUtils.rm_r(headers_symlink_path_name, :secure => true) if File.exists?(headers_symlink_path_name)
|
91
|
+
|
92
|
+
header_search_paths = []
|
85
93
|
build_specifications.each do |spec|
|
86
94
|
xcconfig.merge!(spec.xcconfig)
|
87
95
|
# Only add implementation files to the compile phase
|
88
96
|
spec.implementation_files.each do |file|
|
89
97
|
@target.add_source_file(file, nil, spec.compiler_flags)
|
90
98
|
end
|
91
|
-
#
|
92
|
-
# directory in the pod's header directory.
|
99
|
+
# Symlink header files to Pods/Headers
|
93
100
|
spec.copy_header_mappings.each do |header_dir, files|
|
94
|
-
|
101
|
+
target_dir = "#{headers_symlink_path_name}/#{header_dir}"
|
102
|
+
FileUtils.mkdir_p(target_dir)
|
103
|
+
target_dir_real_path = Pathname.new(target_dir).realpath
|
95
104
|
files.each do |file|
|
96
|
-
|
105
|
+
source = Pathname.new("#{config.project_pods_root}/#{file}").realpath.relative_path_from(target_dir_real_path)
|
106
|
+
Dir.chdir(target_dir) do
|
107
|
+
FileUtils.ln_sf(source, File.basename(file))
|
108
|
+
end
|
97
109
|
end
|
98
110
|
end
|
99
111
|
# Collect all header search paths
|
100
|
-
|
112
|
+
header_search_paths.concat(spec.header_search_paths)
|
101
113
|
end
|
102
|
-
xcconfig.merge!('
|
114
|
+
xcconfig.merge!('HEADER_SEARCH_PATHS' => header_search_paths.sort.uniq.join(" "))
|
103
115
|
|
104
116
|
# Now that we have added all the source files and copy header phases,
|
105
117
|
# move the compile build phase to the end, so that headers are copied
|
@@ -120,6 +132,7 @@ module Pod
|
|
120
132
|
config.baseConfiguration = xcconfig_file
|
121
133
|
config.buildSettings['OTHER_LDFLAGS'] = ''
|
122
134
|
config.buildSettings['GCC_PREFIX_HEADER'] = prefix_header_filename
|
135
|
+
config.buildSettings['PODS_ROOT'] = '$(SRCROOT)'
|
123
136
|
end
|
124
137
|
end
|
125
138
|
|
@@ -294,9 +294,9 @@ module Pod
|
|
294
294
|
# includes the pod's header dir root and any other directories that might
|
295
295
|
# have been added by overriding the copy_header_mapping/copy_header_mappings
|
296
296
|
# methods.
|
297
|
-
def
|
297
|
+
def header_search_paths
|
298
298
|
dirs = [header_dir] + copy_header_mappings.keys
|
299
|
-
dirs.map { |dir| %{"$(
|
299
|
+
dirs.map { |dir| %{"$(PODS_ROOT)/Headers/#{dir}"} }
|
300
300
|
end
|
301
301
|
|
302
302
|
def to_s
|