-
Notifications
You must be signed in to change notification settings - Fork 454
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
Method: Xcodeproj::Project::Object::AbstractTarget#add_system_library can't add '.tbd' lib #379
Comments
What is the |
I don't know what the purpose of those |
There is no You can hava a try with Xcode 7 : ) Actully |
hi, @yasashi , Have you found the solution for adding .tbd file? |
@tennysondy require 'xcodeproj'
# extend
module Xcodeproj
class Project
module Object
class AbstractTarget < AbstractObject
def add_system_library_tbd(names)
Array(names).each do |name|
path = "usr/lib/lib#{name}.tbd"
files = project.frameworks_group.files
unless reference = files.find { |ref| ref.path == path }
reference = project.frameworks_group.new_file(path, :sdk_root)
end
frameworks_build_phase.add_file_reference(reference, true)
reference
end
end
end
end
end
end
# get Xcode version
xcode_version_path = "/Applications/Xcode.app/Contents/version.plist"
xcode_version = 0
if File.exists?(xcode_version_path)
find = 0
open(xcode_version_path,"r") do |file|
file.each_line do |line|
if find == 1
xcode_version = line.delete("<string>").delete("</string>")
puts "Xcode version:#{xcode_version}"
while(xcode_version.length > 4)
xcode_version = xcode_version.chop
end
break
end
if line.include?"CFBundleShortVersionString"
find = 1
end
end
end
else
puts "Please install Xcode under the directory '/Applications/' "
exit
end
# select method
if xcode_version.to_i >= 7
target.add_system_library_tbd("z")
else
target.add_system_library("z")
end |
@tennysondy 晕,都特么中国人,你说什么英文。。。 |
@yasashi 非常感谢,我也是发了之后才发现你是中国人,哈哈~~~ |
@yasashi 本来想直接找你聊的,发现github上不能直接联系 |
哎呦!好屌 |
Hi:
I'm trying:
target.add_system_libraries("z")
the "libz.dylib" has been added,but not the "libz.tbd"
I looked for "/lib/xcodeproj/project/object/native_target.rb",it's:
path = "usr/lib/lib#{name}.dylib"
Is there any way to add "libz.tbd"?
The text was updated successfully, but these errors were encountered: