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 #230

Merged
merged 1 commit into from
Jan 24, 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
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
Loading