Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support build static library copy public header files #225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/cocoapods-packager/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def build_static_library
else
build_static_library_for_mac(output)
end

copy_headers_for_static_library

end

def build_static_framework
Expand Down Expand Up @@ -149,6 +152,7 @@ def build_static_library_for_ios(output)
end

`lipo -create -output #{output} #{libs.join(' ')}`

end

def build_static_library_for_mac(output)
Expand Down Expand Up @@ -192,9 +196,18 @@ def compile
defines
end

def copy_headers
def copy_headers_for_static_library
platform_path = Pathname.new(@platform.name.to_s)
headers_source_root = "#{@public_headers_root}/#{@spec.name}"

Dir.glob("#{@public_headers_root}/**/*.h").
each { |h| `ditto #{h} #{platform_path}/#{h.sub(headers_source_root, '')}` }

end

def copy_headers
headers_source_root = "#{@public_headers_root}/#{@spec.name}"

Dir.glob("#{headers_source_root}/**/*.h").
each { |h| `ditto #{h} #{@fwk.headers_path}/#{h.sub(headers_source_root, '')}` }

Expand Down