Skip to content

Commit

Permalink
Fixed Contents.json formatting
Browse files Browse the repository at this point in the history
Closes #225
  • Loading branch information
subdan committed Feb 9, 2024
1 parent a4ce5c1 commit a5525e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Sources/XcodeExport/Model/XcodeExportExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ extension XcodeAssetContents {

func makeFileContents(to directory: URL) throws -> FileContents {
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]

let data = try encoder.encode(self)
let fileURL = URL(string: "Contents.json")!
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeExport/XcodeColorExporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ final public class XcodeColorExporter: XcodeExporterBase {

private func makeXcodeAssetFileContents(contents: XcodeAssetContents, directory: URL) throws -> FileContents {
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
let data = try encoder.encode(contents)
let fileURL = URL(string: "Contents.json")!
return FileContents(
Expand Down
24 changes: 12 additions & 12 deletions Tests/XcodeExportTests/XcodeIconsExporterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -667,17 +667,17 @@ final class XcodeIconsExporterTests: XCTestCase {
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic24TabBarHome.pdf"
"filename" : "ic24TabBarHome.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template",
"preserves-vector-representation" : true
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
"""
Expand Down Expand Up @@ -711,17 +711,17 @@ final class XcodeIconsExporterTests: XCTestCase {
{
"images" : [
{
"idiom" : "universal",
"filename" : "ic24TabBarHome.pdf"
"filename" : "ic24TabBarHome.pdf",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template",
"preserves-vector-representation" : true
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
"""
Expand Down

0 comments on commit a5525e3

Please sign in to comment.