-
Notifications
You must be signed in to change notification settings - Fork 43
/
Target.swift
65 lines (55 loc) 路 1.63 KB
/
Target.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// Target.swift
// Surmagic
//
// Created by Muhammed Gurhan Yerlikaya on 01.12.2020.
// Copyright 漏 2021 https://github.com/gurhub/surmagic.
//
import Foundation
public class Target: Codable {
// MARK: - Enums
/// SDK type names changes per OS.
public enum SDK: String, Codable {
case iOS
case iOSSimulator
case macOS
case macOSCatalyst
case tvOS
case tvOSSimulator
case watchOS
case watchSimulator
var description: String {
switch self {
case .iOS: return "iphoneos"
case .iOSSimulator: return "iphonesimulator"
case .macOS: return "macosx"
case .macOSCatalyst: return "macOSCatalyst"
case .tvOS: return "appletvos"
case .tvOSSimulator: return "appletvsimulator"
case .watchOS: return "watchos"
case .watchSimulator: return "watchsimulator"
}
}
}
// MARK: - Types
enum CodingKeys: String, CodingKey {
case sdk = "sdk"
case workspace = "workspace"
case project = "project"
case scheme = "scheme"
}
// MARK: - Properties
let sdk: SDK
let workspace: String?
let project: String?
let scheme: String
// MARK: - Description
public var desc: String {
return (
"sdk: \(String(sdk.rawValue)) \n" +
" workspace: \(String(workspace ?? "-")) \n" +
" project: \(String(project ?? "-")) \n" +
" scheme: \(String(scheme)) \n"
)
}
}