Skip to content

Commit

Permalink
Merge pull request #40 from yonaskolb/info_plist
Browse files Browse the repository at this point in the history
Automatically find Info.plist
  • Loading branch information
yonaskolb authored Aug 27, 2017
2 parents ee43422 + 59d289f commit 4d802cf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/XcodeGenKit/PBXProjGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4d802cf

Please sign in to comment.