Permalink
Browse files

Adopt latest podspec changes (compatibility to CocoaPods 0.17.x).

  • Loading branch information...
1 parent 7109505 commit be85343bcdb87a00d40f70710333b0dc80b03d46 @plu plu committed Apr 3, 2013
Showing with 16 additions and 9 deletions.
  1. +16 −9 SSToolkit.podspec
View
@@ -14,24 +14,31 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.preserve_paths = 'SSToolkit.xcodeproj', 'Resources'
+ s.prefix_header_contents = '#ifdef __OBJC__', '#import "SSToolkitDefines.h"', '#endif'
def s.post_install(target)
- puts "\nGenerating SSToolkit resources bundle\n".yellow if config.verbose?
- Dir.chdir File.join(config.project_pods_root, 'SSToolkit') do
+ if Version.new(Pod::VERSION) >= Version.new('0.16.999')
+ sandbox_root = target.sandbox_dir
+ else
+ sandbox_root = config.project_pods_root
+ end
+
+ Dir.chdir File.join(sandbox_root, 'SSToolkit') do
command = "xcodebuild -project SSToolkit.xcodeproj -target SSToolkitResources CONFIGURATION_BUILD_DIR=../Resources"
- command << " 2>&1 > /dev/null" unless config.verbose?
+ command << " 2>&1 > /dev/null"
unless system(command)
raise ::Pod::Informative, "Failed to generate SSToolkit resources bundle"
end
- File.open(File.join(config.project_pods_root, target.target_definition.copy_resources_script_name), 'a') do |file|
- file.puts "install_resource 'Resources/SSToolkitResources.bundle'"
+ if Version.new(Pod::VERSION) >= Version.new('0.16.999')
+ script_path = target.copy_resources_script_path
+ else
+ script_path = File.join(config.project_pods_root, target.target_definition.copy_resources_script_name)
end
- end
- prefix_header = config.project_pods_root + target.prefix_header_filename
- prefix_header.open('a') do |file|
- file.puts(%{#ifdef __OBJC__\n#import "SSToolkitDefines.h"\n#endif})
+ File.open(script_path, 'a') do |file|
+ file.puts "install_resource 'Resources/SSToolkitResources.bundle'"
+ end
end
end
end

0 comments on commit be85343

Please sign in to comment.