rename Plist.attributes to properties

This commit is contained in:
Yonas Kolb
2018-10-30 21:47:16 +11:00
parent 26106a04b3
commit eef1dc473e
5 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ public class InfoPlistGenerator {
return dictionary
}()
public func generateAttributes(target: Target) -> [String: Any] {
public func generateProperties(target: Target) -> [String: Any] {
var targetInfoPlist = defaultInfoPlist
switch target.type {
case .uiTestBundle,
+11 -11
View File
@@ -30,22 +30,22 @@ public class ProjectWriter {
for target in project.targets {
// write Info.plist
if let plist = target.info {
let path = project.basePath + plist.path
let attributes = infoPlistGenerator.generateAttributes(target: target).merged(plist.attributes)
let data = try PropertyListSerialization.data(fromPropertyList: attributes, format: .xml, options: 0)
try? path.delete()
try path.parent().mkpath()
try path.write(data)
let properties = infoPlistGenerator.generateProperties(target: target).merged(plist.properties)
try writePlist(properties, path: plist.path)
}
// write entitlements
if let plist = target.entitlements {
let path = project.basePath + plist.path
let data = try PropertyListSerialization.data(fromPropertyList: plist.attributes, format: .xml, options: 0)
try? path.delete()
try path.parent().mkpath()
try path.write(data)
try writePlist(plist.properties, path: plist.path)
}
}
}
private func writePlist(_ plist: [String: Any], path: String) throws {
let path = project.basePath + path
let data = try PropertyListSerialization.data(fromPropertyList: plist, format: .xml, options: 0)
try? path.delete()
try path.parent().mkpath()
try path.write(data)
}
}