ability to override target name

This commit is contained in:
Yonas Kolb 2017-09-14 21:04:33 +02:00
parent d5204199f3
commit 061bddd18b
4 changed files with 5 additions and 3 deletions

View File

@ -11,4 +11,6 @@ targets:
type: application
platform: iOS
IncludedTarget:
name: IncludedTargetNew
platform: tvOS
sources: Target

View File

@ -159,7 +159,7 @@ extension TargetScheme: JSONObjectConvertible {
extension Target: NamedJSONDictionaryConvertible {
public init(name: String, jsonDictionary: JSONDictionary) throws {
self.name = name
self.name = jsonDictionary.json(atKeyPath: "name") ?? name
let typeString: String = try jsonDictionary.json(atKeyPath: "type")
if let type = PBXProductType(string: typeString) {
self.type = type

View File

@ -41,7 +41,7 @@ func specLoadingTests() {
"new": Settings(dictionary: ["MY_SETTING": "VALUE"]),
]
try expect(spec.targets) == [
Target(name: "IncludedTarget", type: .application, platform: .tvOS),
Target(name: "IncludedTargetNew", type: .application, platform: .tvOS, sources: ["Target"]),
Target(name: "NewTarget", type: .application, platform: .iOS),
]
}

View File

@ -25,7 +25,7 @@ Required properties are marked 🔵 and optional properties with ⚪️.
## Project
- 🔵 **name**: `String` - Name of the generated project
- ⚪️ **include**: `[String]` - The paths to other specs. They will be merged in order and then the current spec will be merged on top
- ⚪️ **include**: `[String]` - The paths to other specs. They will be merged in order and then the current spec will be merged on top. Target names can be changed by adding a `name` property
- ⚪️ **options**: [Options](#options) - Various options to override default behaviour
- ⚪️ **attributes**: `map` - The PBXProject attributes. This is for advanced use. Defaults to ``{"LastUpgradeCheck": "0830"}``
- ⚪️ **configs**: [Configs](#configs) - Project build configurations. Defaults to `Debug` and `Release` configs