嗨,我的项目文件夹结构如下:
+ Podfile
+ Apps/
|
+ Apps.xcodeproj
|
+ Target1/
|
+ Target2/
+ AppLib/
|
+ AppLib.podspec
|
+ AppLib.xcodeproj
|
+ TargetLib1/
|
+ TargetLib2/
我的依赖结构是这样的
Apps
-- 依赖 --> AppLib
AppLib
-- 依赖 --> RestKit
和 MagicalRecord
这是我如何配置我的播客文件
workspace 'MyApp'
xcodeproj 'Apps/Apps'
xcodeproj 'AppLib/AppLib'
def import_pods
pod 'AppLib', :path => './AppLib'
end
target 'Target1' do
platform :ios, '7.0'
import_pods
xcodeproj 'Apps/Apps'
end
target 'Target1' do
platform :ios, '7.0'
import_pods
xcodeproj 'Apps/Apps'
end
这是
AppLib.podspec
:Pod::Spec.new do |s|
s.name = "AppLib"
s.version = "0.0.1"
s.summary = "Common library."
s.platform = :ios, "7.0"
s.source_files = "Lib/Public/**/*.{h,m}"
s.ios.deployment_target = '7.0'
s.resources = "Lib/Nibs/**/*.xib"
s.requires_arc = true
s.dependency 'RestKit', '~> 0.23'
s.dependency 'MagicalRecord'
end
在根文件夹(文件夹包含 Podfile)
pod install
运行没有问题但是当我导入 RestKit
#import "RestKit.h"
或 #import <RestKit/RestKit.h>
在我的 AppLibs 项目中,xcode 说找不到该文件。我的 podfile 和 podspec 是否正确?
为什么 xcode 声称未找到 RestKit.h?
如果我想单独构建 AppLibs,如何拉取所有依赖项?
(
pod install
不适用于 .podspec 文件)我需要在 AppLib
中创建另一个 podfile文件夹?
最佳答案
好吧,我的目标是
我结束的是
'LIBRARY_SEARCH_PATH'、'USER_HEADERS_SEARCH_PATH'。为了不让
CocoaPods 破坏了我的 lib 文件夹结构(如果您将 lib 作为 dev pod 附加,它会这样做)。
从那里使用 'podspec' 命令
指的是lib的所有依赖项。
就是这样,希望对你有帮助。
关于xcode - 如何为此项目结构配置 cocoapod podspec 和 podfile?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24176598/