小编Lee*_*nau的帖子

为什么我的cocoapods post_install挂钩不更新我的预处理器宏?

我已经四处转转了几天,现在试图找出为什么我的post_install挂钩没有产生我期待的输出.这是我的Podfile:

source 'https://github.com/CocoaPods/Specs.git'

target "SCCommon" do
  platform :ios, "6.0"
  pod 'AFNetworking', '~> 1.2.1'
  pod 'Mantle', '~> 1.3'
  pod 'PubNub', '3.5.5'
end

target "SCCommon-TestHarness" do
  platform :ios, "6.0"
# inhibit_all_warnings!
  pod 'SCCommon', :path => '../SCCommon.podspec'
end

target "SCCommon-UnitTests" do
  platform :ios, "6.0"
# inhibit_all_warnings!
  pod 'OCMock', '2.2.3'
  pod 'SCCommon', :path => '../SCCommon.podspec'
end

post_install do |installer_representation|
  installer_representation.project.targets.each do |target|
    if target.name == 'Pods-SCCommon-UnitTests'
      puts "Setting preprocessor macro for #{target.name}..."
      target.build_configurations.each do |config|
        puts "#{config} configuration..."
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)','SC_DEBUG_SCCOMMON=1','FOOBAR']
        puts config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
        puts …
Run Code Online (Sandbox Code Playgroud)

ruby macros preprocessor cocoapods xcode-project

7
推荐指数
1
解决办法
4336
查看次数

标签 统计

cocoapods ×1

macros ×1

preprocessor ×1

ruby ×1

xcode-project ×1