2016-07-29 48 views
1

我有我自己的靜態庫,它有兩個版本 - lite & pro。
這是私人回購。
我已經爲每個版本添加了單獨的專用Podspec。
Libs是與頭文件(不是開源)編譯的靜態.a文件。如何通過CocoaPods添加lite和pro版本的庫?

添加到項目是這樣的:

# common cocoapods stuff here 

abstract_target 'CommonPods' do 

    # some other pods here 

    target 'App' do 
    pod 'BaseSDK' 
    end 

    target 'AppPro' do 
    pod 'ProSDK' 
    end 
end 

但不知何故,在項目兩個目標都與Podfile使用最新版本的鏈接 - 「ProSDK」,如果開關LIB版本的目標或設定基部11b爲Pro的目標 - 這兩個目標都將與'BaseSDK'鏈接。
cocoapods中有lite/pro版本的lib嗎?或者有什麼想法嗎?

回答

0

項目有2個目標和自己的.xcconfig文件,裏面有#include CocoaPods .xcconfig文件。但mistate是#包括雙方的CocoaPods .xcconfig文件基地,像這樣&臨Podfile目標:

#include "Pods/Target Support Files/Pods-CommonPods-App/Pods-CommonPods-App.debug.xcconfig" 
#include "Pods/Target Support Files/Pods-CommonPods-AppPro/Pods-CommonPods-AppPro.debug.xcconfig" 

和「其他LD標誌」已經通過最後已改寫。

因此,我添加了新的.xcconfig文件,以便爲目標分隔.xcconfig文件,其中包括Pods-CommonPods-App/Pods-CommonPods-App.debug.xcconfig和其他Pods-CommonPods-App/Pods- CommonPods-AppPro.debug.xcconfig(當然版本相同)。