mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
e35f7df14d
* upgrade scheme and project versions * parse test plans * remove xctestplan from resources * generate test plan references in schemes * add test plan to fixture * non-mutable way of creating [XCScheme.TestPlanReference] * update fixture version * Add documentation * Add default test plan option # Conflicts: # Sources/ProjectSpec/Scheme.swift # Tests/Fixtures/paths_test/included_paths_test.yml # Tests/ProjectSpecTests/SpecLoadingTests.swift * Add test plan validation # Conflicts: # Tests/ProjectSpecTests/ProjectSpecTests.swift * Check for multiple default test plans * set first plan as default default plan * small tweaks * fix test plan path properties * add test plants to target scheme * docs * fix fixture test plan path * update changelog * added ability to disable test plan path validation Co-authored-by: Ota Mares <ota@rebuy.com>
55 lines
1.2 KiB
Swift
55 lines
1.2 KiB
Swift
import Foundation
|
|
import ProjectSpec
|
|
|
|
extension Project {
|
|
|
|
public var xcodeVersion: String {
|
|
XCodeVersion.parse(options.xcodeVersion ?? "12.0")
|
|
}
|
|
|
|
var schemeVersion: String {
|
|
"1.7"
|
|
}
|
|
|
|
var compatibilityVersion: String {
|
|
"Xcode 11.0"
|
|
}
|
|
|
|
var objectVersion: UInt {
|
|
51
|
|
}
|
|
}
|
|
|
|
public struct XCodeVersion {
|
|
|
|
public static func parse(_ version: String) -> String {
|
|
if version.contains(".") {
|
|
let parts = version.split(separator: ".").map(String.init)
|
|
var string = ""
|
|
let major = parts[0]
|
|
if major.count == 1 {
|
|
string = "0\(major)"
|
|
} else {
|
|
string = major
|
|
}
|
|
|
|
let minor = parts[1]
|
|
string += minor
|
|
|
|
if parts.count > 2 {
|
|
let patch = parts[2]
|
|
string += patch
|
|
} else {
|
|
string += "0"
|
|
}
|
|
return string
|
|
} else if version.count == 2 {
|
|
return "\(version)00"
|
|
} else if version.count == 1 {
|
|
return "0\(version)00"
|
|
} else {
|
|
return version
|
|
}
|
|
}
|
|
}
|