mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
log missing SettingPreset files
This commit is contained in:
@@ -63,9 +63,23 @@ extension SettingsPresetFile {
|
||||
if let group = buildSettingFiles[path] {
|
||||
return group
|
||||
}
|
||||
let settingsPath = Path(#file).parent().parent().parent() + "SettingPresets/\(path).yml"
|
||||
guard settingsPath.exists,
|
||||
let buildSettings = try? BuildSettings(path: settingsPath) else { return nil }
|
||||
let relativePath = "SettingPresets/\(path).yml"
|
||||
let settingsPath = Path(#file).parent().parent().parent() + relativePath
|
||||
|
||||
guard settingsPath.exists else {
|
||||
switch self {
|
||||
case .base, .config, .platform:
|
||||
print("No \"\(name)\" settings found at \(settingsPath)")
|
||||
case .product:
|
||||
break
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
guard let buildSettings = try? BuildSettings(path: settingsPath) else {
|
||||
print("Error parsing \"\(name)\" settings")
|
||||
return nil
|
||||
}
|
||||
buildSettingFiles[path] = buildSettings
|
||||
return buildSettings
|
||||
}
|
||||
|
||||
@@ -24,4 +24,13 @@ public enum SettingsPresetFile {
|
||||
case .base: return "base"
|
||||
}
|
||||
}
|
||||
|
||||
var name: String {
|
||||
switch self {
|
||||
case let .config(config): return "\(config.rawValue) config"
|
||||
case let .platform(platform): return platform.rawValue
|
||||
case let .product(product): return product.name
|
||||
case .base: return "base"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user