XcodeGen/Sources/XcodeGenKit/SettingsPresetFile.swift
2019-06-26 16:49:10 +10:00

32 lines
1.0 KiB
Swift

import Foundation
import ProjectSpec
import XcodeProj
public enum SettingsPresetFile {
case config(ConfigType)
case platform(Platform)
case product(PBXProductType)
case productPlatform(PBXProductType, Platform)
case base
var path: String {
switch self {
case let .config(config): return "Configs/\(config.rawValue)"
case let .platform(platform): return "Platforms/\(platform.rawValue)"
case let .product(product): return "Products/\(product.name)"
case let .productPlatform(product, platform): return "Product_Platform/\(product.name)_\(platform.rawValue)"
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 let .productPlatform(product, platform): return "\(platform) \(product)"
case .base: return "base"
}
}
}