.xcconfig 文件是调试和发布的配置文件,其文件中有规范。在幕后,在 Xcode 中,它如何在编译的生命周期中工作,是我的查询。何时使用 .xcconfig 文件。我在创建框架时从未使用过,我需要使用它们吗?
我没有找到太多关于最佳实践的信息,所以我会从我的角度来回答。.xcconfig
文件允许您:
.xcconfig
文件即可在不同项目中重用相同的配置xcodebuild -target <your_target_name> -xcconfig <your_configuration_file>.xcconfig
在 Xcode 项目中,您可以.xcconfig
为项目和目标级别的每个配置(调试、发布)设置s。
Xcode 按以下顺序使用从 .xcodeproj 和分配的 .xccofig 文件组合的设置:
每个下一级的设置将覆盖上一级的设置。
您可以根据需要构建.xccconfig
文件层次结构,这为您提供了很大的灵活性。此类层次结构之一可能如下所示:
- Warnings.xcconfig - keep warnings separate
|- Base.xcconfig - settings common for debug and release; inherits Warnings.scconfig
|- Debug.xcconfig - debug only settings; inherits Base.xcconfig
|- Release.xcconfig - release only settings; inherits Base.xcconfig
- Target1.xcconfig - target specific settings, like Info.plist or product name
- Target2_Debug.xcconfig - target settings for debug
- Target2_Release.xcconfig - target settings for release
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句