Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Contents.json formatting #231

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading