cocoapods 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Pod
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.8'
3
3
 
4
4
  class Informative < StandardError
5
5
  end
@@ -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
- 'USER_HEADER_SEARCH_PATHS' => '"$(BUILT_PRODUCTS_DIR)/Pods"',
33
- 'ALWAYS_SEARCH_USER_PATHS' => 'YES',
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
- user_header_search_paths = []
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
- # Add header files to a `copy header build phase` for each destination
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
- copy_phase = @target.copy_files_build_phases.new_pod_dir(spec.name, header_dir)
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
- @target.add_source_file(file, copy_phase)
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
- user_header_search_paths.concat(spec.user_header_search_paths)
112
+ header_search_paths.concat(spec.header_search_paths)
101
113
  end
102
- xcconfig.merge!('USER_HEADER_SEARCH_PATHS' => user_header_search_paths.sort.uniq.join(" "))
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 user_header_search_paths
297
+ def header_search_paths
298
298
  dirs = [header_dir] + copy_header_mappings.keys
299
- dirs.map { |dir| %{"$(BUILT_PRODUCTS_DIR)/Pods/#{dir}"} }
299
+ dirs.map { |dir| %{"$(PODS_ROOT)/Headers/#{dir}"} }
300
300
  end
301
301
 
302
302
  def to_s
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 7
9
- version: 0.3.7
8
+ - 8
9
+ version: 0.3.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Eloy Duran