Merge pull request #40 from yonaskolb/info_plist

Automatically find Info.plist
This commit is contained in:
Yonas Kolb
2017-08-27 12:29:55 +02:00
committed by GitHub
@@ -168,9 +168,21 @@ public class PBXProjGenerator {
sourceFilePaths += sourceGroups.filePaths
}
// find all Info.plist
let infoPlists: [Path] = sourcePaths.reduce([]) {
$0 + ((try? $1.recursiveChildren()) ?? []).filter { $0.lastComponent == "Info.plist" }
}
let configs: [XCBuildConfiguration] = spec.configs.map { config in
var buildSettings = spec.getTargetBuildSettings(target: target, config: config)
// automatically set INFOPLIST_FILE path
if buildSettings["INFOPLIST_FILE"] == nil {
if let plistPath = infoPlists.first {
buildSettings["INFOPLIST_FILE"] = plistPath.byRemovingBase(path: basePath)
}
}
// set Carthage search paths
if !carthageFrameworks.isEmpty {
let frameworkSearchPaths = "FRAMEWORK_SEARCH_PATHS"