运行pod更新更改Pods构建设置

ric*_*ich 8 ios cocoapods

我跑的时候

pod upate
Run Code Online (Sandbox Code Playgroud)

对于我的Podfile,Pods项目的某些Build Settings for Architectures部分已更改:

  1. 支持的平台更改为OS X(来自iOS)
  2. 构建活动架构仅更改为是(从否)
  3. 基础SDK从最新的iOS更改为No SDK(最新的OS X)

我不知道为什么会改变它.这可能是我在我的podspec文件中为我的依赖项所拥有(或没有)的东西吗?以下是我的podspec文件之一的示例:

Pod::Spec.new do |spec|
  spec.name                  = 'pi-ios-sdk'
  spec.version               = '1.2.0'
  spec.license               = { :type => 'Copyright', :text => 'Copyright 2014 <...>. All rights reserved.' }
  spec.homepage              = 'http://<...>.com/'
  spec.authors               = '<...> Grid Mobile Frameworks Team'
  spec.summary               = '<...> Identity authentication GRID projects.'
  spec.description           = 'The <...> Identity Client iOS SDK framework (Pi-ios-client) assists in accessing the services provided by the <...> Identity API.'
  spec.ios.deployment_target = '7.1'
  spec.requires_arc          = true
  spec.source                = { :git => 'ssh://git@devops-tools.<...>.com/mp/pi-ios-sdk.git', :tag => 'tag/1.2.0' }
  spec.source_files          = 'framework/src/xcode/Pi-ios-client/*.{h,m}'
  spec.header_dir            = 'Pi-ios-client'
  spec.exclude_files         = 'framework/src/xcode/Pi-ios-client/PGMPiTokenRefreshOperationTests.m'
  spec.ios.frameworks        = 'Foundation', 'UIKit'
end
Run Code Online (Sandbox Code Playgroud)

我的Podfile:

platform :ios, "7.1"

target "CourseListClient" do
  pod 'core-ios-sdk', '1.2.0'
  pod 'pi-ios-sdk', '1.2.0'
  pod 'classroom-ios-library', '0.1.0-SNAPSHOT'
end

target "CourseListClientTests" do
  pod 'core-ios-sdk', '1.2.0'
  pod 'pi-ios-sdk', '1.2.0'
  pod 'classroom-ios-library', '0.1.0-SNAPSHOT'
end
Run Code Online (Sandbox Code Playgroud)

我在想 - 对测试目标有相同的依赖关系可能是不必要的,但我还需要改变什么呢?谢谢.

alt*_*gir 5

在Podfile的末尾添加:

post_install do |installer_representation|
    projectSDK = nil

    puts"Updating all of the POD targets to not default to ONLY_ACTIVE_ARCH for debug"
    installer_representation.project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
            if projectSDK.nil?
                projectSDK = config.build_settings['SDKROOT']
            end
        end
    end
    puts "Updating ONLY_ACTIVE_ARCH for the project, as well. While the project settings aren't supposed to matter, I've not found that to be the case."
    puts "Also setting the base SDK of the project to match that of the targets (doesn't matter which one); otherwise it defaults to No SDK (Latest OS X)"
    installer_representation.project.build_configurations.each do |config|
        config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        config.build_settings['SDKROOT'] = projectSDK
    end
end
Run Code Online (Sandbox Code Playgroud)

source:支持的平台,基本SDK,构建仅在pod更新后还原的活动体系结构设置

如果您使用的是最新的gem(gem install cocoapods --pre),请将上面的2".project"替换为".pods_project"

问候