mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-12-01 01:05:14 +03:00
format code
This commit is contained in:
parent
fae35d6d67
commit
8a7bfa12fc
@ -31,7 +31,6 @@ public struct ProjectSpec {
|
||||
public var bundleIdPrefix: String?
|
||||
|
||||
public init() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ public enum SettingsPresetFile {
|
||||
case config(ConfigType)
|
||||
case platform(Platform)
|
||||
case product(PBXProductType)
|
||||
case productPlatform(PBXProductType,Platform)
|
||||
case productPlatform(PBXProductType, Platform)
|
||||
case base
|
||||
|
||||
var path: String {
|
||||
|
@ -16,7 +16,7 @@ public struct SpecLoader {
|
||||
|
||||
public static func loadSpec(path: Path) throws -> ProjectSpec {
|
||||
let dictionary = try loadDictionary(path: path)
|
||||
let filteredDictionary = SpecLoader.filterNull(dictionary) as! [String:Any]
|
||||
let filteredDictionary = SpecLoader.filterNull(dictionary) as! [String: Any]
|
||||
return try ProjectSpec(jsonDictionary: filteredDictionary)
|
||||
}
|
||||
|
||||
@ -66,16 +66,15 @@ public struct SpecLoader {
|
||||
return merged
|
||||
}
|
||||
|
||||
private static func filterNull(_ object:Any) -> Any {
|
||||
var returnedValue : Any = object
|
||||
if let dict = object as? [String:Any] {
|
||||
var mutabledic : [String: Any] = [:]
|
||||
private static func filterNull(_ object: Any) -> Any {
|
||||
var returnedValue: Any = object
|
||||
if let dict = object as? [String: Any] {
|
||||
var mutabledic: [String: Any] = [:]
|
||||
for (key, value) in dict {
|
||||
mutabledic[key] = SpecLoader.filterNull(value)
|
||||
}
|
||||
returnedValue = mutabledic
|
||||
}
|
||||
else if let array = object as? [Any] {
|
||||
} else if let array = object as? [Any] {
|
||||
var mutableArray: [Any] = array
|
||||
for (index, value) in array.enumerated() {
|
||||
mutableArray[index] = SpecLoader.filterNull(value)
|
||||
|
@ -85,7 +85,7 @@ func projectGeneratorTests() {
|
||||
var expectedTargetDebugSettings = BuildSettings()
|
||||
expectedTargetDebugSettings += SettingsPresetFile.platform(.iOS).getBuildSettings()
|
||||
expectedTargetDebugSettings += SettingsPresetFile.product(.application).getBuildSettings()
|
||||
expectedTargetDebugSettings += SettingsPresetFile.productPlatform(.application,.iOS).getBuildSettings()
|
||||
expectedTargetDebugSettings += SettingsPresetFile.productPlatform(.application, .iOS).getBuildSettings()
|
||||
expectedTargetDebugSettings += ["SETTING 2": "value 2", "SETTING 3": "value 3", "SETTING": "value"]
|
||||
|
||||
try expect(targetDebugSettings.equals(expectedTargetDebugSettings)).beTrue()
|
||||
|
0
format_code.sh → format-code.sh
Normal file → Executable file
0
format_code.sh → format-code.sh
Normal file → Executable file
Loading…
Reference in New Issue
Block a user