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 Jan 24, 2024
1 parent 5a6406d commit cea5b1f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:
jobs:
release:
name: Publish GitHub and Cocoapods release
runs-on: macos-12
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Select Xcode version
run: sudo xcode-select --switch /Applications/Xcode_14.1.app
run: sudo xcode-select --switch /Applications/Xcode_15.2.app

- name: Build
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ on:
jobs:
test:
name: Run tests on macOS
runs-on: macos-12
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Select Xcode version
run: sudo xcode-select --switch /Applications/Xcode_14.1.app
run: sudo xcode-select --switch /Applications/Xcode_15.2.app
- name: Build and test
run: swift test --enable-code-coverage --disable-automatic-resolution
shell: bash
Expand Down
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 cea5b1f

Please sign in to comment.