mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Speed up SettingsBuilder (#1221)
* Speed up SettingsBuilder It's unnecessary to build up a whole grouped dictionary only to check if all platforms are identical and then immediately discard the dictionary. Instead we can check if all targets match the first platform, which avoids creating a new dictionary but also allows bailing early as soon as a non-matching platform is found. Generating a large project (36MB json spec) on an M1 Max machine leads to a ~6% total speedup: 28.48s vs 30.07s. * Add changelog entry
This commit is contained in:
@@ -11,12 +11,10 @@ extension Project {
|
||||
var buildSettings: BuildSettings = [:]
|
||||
|
||||
// set project SDKROOT is a single platform
|
||||
if targets.count > 0 {
|
||||
let platforms = Dictionary(grouping: targets) { $0.platform }
|
||||
if platforms.count == 1 {
|
||||
let platform = platforms.first!.key
|
||||
buildSettings["SDKROOT"] = platform.sdkRoot
|
||||
}
|
||||
if let firstPlatform = targets.first?.platform,
|
||||
targets.allSatisfy({ $0.platform == firstPlatform })
|
||||
{
|
||||
buildSettings["SDKROOT"] = firstPlatform.sdkRoot
|
||||
}
|
||||
|
||||
if let type = config.type, options.settingPresets.applyProject {
|
||||
@@ -31,7 +29,7 @@ extension Project {
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent setting presets from overrwriting settings in project xcconfig files
|
||||
// Prevent setting presets from overwriting settings in project xcconfig files
|
||||
if let configPath = configFiles[config.name] {
|
||||
buildSettings = removeConfigFileSettings(from: buildSettings, configPath: configPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user