Files
XcodeGen/Sources/XcodeGenKit/SettingsPresetFile.swift
Giovanni Amati 97d36fd1d2 Support for multiple deployment targets with xcode 14 (#1336)
* platformFilters on Dependecies

* platformFilters on sources

* fixed current unit tests

* renamed enum to SupportedPlatforms

* supportedPlatforms field for target

* errors

* renamed errors

* inferPlatformFiltersByPath flag

* changed priority to generate filter

* fixed parsing

* fixed init

* unit test supportedPlatforms

* unit tests for errors

* fixing build settings and unit tests

* added new settingsPresets

* new check errors and unit tests

* case insensitive match

* fixed skipping cross platform target

* json decode

* unit tests inferPlatformFiltersByPath and platformFilters for sources

* mocked files

* fixing unit tests

* first test on dependecies

* unit tests completed

* fixed unit tests

* changelog

* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* fixed doc

* fixed unti tests style

* fixed regex

* fixed doc

* addressing comments

* Added TestProject, moved unit tests resources in another folder

* Raising error if platform is an array

* unit test on new error

* fixed error enum

* Integrated in TestProject

* committed TestProject

* unit test error

* fixing spm deps in test project

* pushed testProject

* pushed testProject

* pushed testProject fix

* comment on isResolved property

* renameing supportedPlatforms to supportedDestinations

* renameing supportedPlatforms to supportedDestinations

* renameing test app

* checked out old file

* fixing test app

* working on auto baseSDK

* fixed deploymentTarget

* renamed errors

* fixed presets

* remamed index to priority

* small comments

* removed isResolved in target and fixed error check

* added unit tests

* fixed doc

* fixed doc

* fixed doc

* fixed doc

* fixed test app

* add visionOS and more error check and testing

* fixed supported destinations priority and tests

* fixed doc

* solved conflicts

* fixed conflicts

* renamed everything

---------

Co-authored-by: Giovanni Amati <giovanni.amati@sky.uk>
2023-10-31 20:55:38 +11:00

35 lines
1.3 KiB
Swift

import Foundation
import ProjectSpec
import XcodeProj
public enum SettingsPresetFile {
case config(ConfigType)
case platform(Platform)
case supportedDestination(SupportedDestination)
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 .supportedDestination(supportedDestination): return "SupportedDestinations/\(supportedDestination.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 .supportedDestination(supportedDestination): return supportedDestination.rawValue
case let .product(product): return product.name
case let .productPlatform(product, platform): return "\(platform) \(product)"
case .base: return "base"
}
}
}