是否可以在.framework中包含.framework以及如何? [英] Is it possible to include a .framework in a .framework and how?

查看:140
本文介绍了是否可以在.framework中包含.framework以及如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提一下这个问题包含一个框架进入另一个,是否可能?包含iOS框架进入另一个

i'd like to mention this question Include a framework into another one, is it possible? and this Include an iOS Framework into another one.

此外,我也有类似于目标问题, https://stackoverflow.com/questions/23022211/create-framework-including-plcrashreporter-linked-xcodeproj-source -code-to-the

Also there is a similar to the target question from me as well, https://stackoverflow.com/questions/23022211/create-framework-including-plcrashreporter-linked-xcodeproj-source-code-to-the.

我想实现同样的目标。不希望开发人员必须链接到两个框架,而只是链接到另一个框架。

I want to achieve the same thing. Don't want the developer to have to link to both frameworks but only mine which is merged with the other.

链接中的两个问题都没有答案。有关该主题的任何更新?

Both questions in the link have no answer. Any update on the subject?

P.S。我也有源代码,但这不是一个选项,因为它引入了几个问题。

P.S. I have the source code also but this is not an option since it introduces several problems.

我该怎么做,任何教程,博客,书籍等?

How can I do it, any tutorials, blog, book etc?

谢谢。

推荐答案

我找到了创建聚合目标的解决方案在构建阶段部分添加以下运行脚本。

I have found the solution creating an aggregate target and adding the following run script in the build phase section.

我将静态库目标名称命名为示例的StaticLibraryName。

I will name the static library target name as StaticLibraryName for the example.

xcodebuild -project "StaticLibraryName.xcodeproj" -configuration "Release" -target "StaticLibraryName" -sdk iphoneos
xcodebuild -project "StaticLibraryName.xcodeproj" -configuration "Release" -target "StaticLibraryName" -sdk iphonesimulator

mkdir -p "${SRCROOT}/Products/StaticLibraryName.framework"
mkdir -p "${SRCROOT}/Products/StaticLibraryName.framework/Versions"
mkdir -p "${SRCROOT}/Products/StaticLibraryName.framework/Versions/A"
mkdir -p "${SRCROOT}/Products/StaticLibraryName.framework/Versions/A/Resources"
mkdir -p "${SRCROOT}/Products/StaticLibraryName.framework/Versions/A/Headers"

ln -s "A" "${SRCROOT}/Products/StaticLibraryName.framework/Versions/Current"
ln -s "Versions/Current/Headers" "${SRCROOT}/Products/StaticLibraryName.framework/Headers"
ln -s "Versions/Current/Resources" "${SRCROOT}/Products/StaticLibraryName.framework/Resources"
ln -s "Versions/Current/StaticLibraryName" "${SRCROOT}/Products/StaticLibraryName.framework/StaticLibraryName"

cp -R "build/Release-iphoneos/usr/local/include/" "${SRCROOT}/Products/StaticLibraryName.framework/Versions/A/Headers/"

lipo -create "build/Release-iphoneos/libStaticLibraryName.a" "build/Release-iphonesimulator/libStaticLibraryName.a" -output "${SRCROOT}/Products/StaticLibraryName.framework/Versions/A/StaticLibraryName"

libtool -static -o "${SRCROOT}/Products/StaticLibraryName.framework/Versions/A/TheOtherFrameworkName" "${SRCROOT}/Products/StaticLibraryName.framework/Versions/A/TheOtherFrameworkName" "${SRCROOT}/Vendor/TheOtherFrameworkName.framework/Versions/A/TheOtherFrameworkName"

这篇关于是否可以在.framework中包含.framework以及如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆