Skip to content

Commit f974784

Browse files
Merge pull request #146 from FelixHerrmann/feature/json5-configuration
[Feature] JSON5 Configuration
2 parents cabbd84 + 163cc52 commit f974784

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

Plugins/SwiftPackageListPlugin/SwiftPackageListPlugin.Configuration.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ extension SwiftPackageListPlugin.Configuration {
6969
}
7070

7171
let decoder = JSONDecoder()
72+
decoder.allowsJSON5 = true
7273
do {
7374
self = try decoder.decode(SwiftPackageListPlugin.Configuration.self, from: data)
7475
} catch {

README.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,33 @@ The easiest way to add this tool to your project is using the provided build-too
6464
For Xcode projects simply add it under the `Run Build Tool Plug-ins` section in the Target's Build Phases tab after you have added this package to the project's Package Dependencies; for Swift packages configure it in the `Package.swift` manifest, as described [here](https://github.com/apple/swift-package-manager/blob/main/Documentation/Plugins.md#using-a-package-plugin).
6565

6666
By default this will use the JSON output with `--requires-license` but you can create a `swift-package-list-config.json` in your project's root to configure that behavior, both project and target specific (target configs have precedence over the project one). Everything in the configuration is optional and has the following format:
67-
```json
67+
```json5
68+
// SwiftPackageList configuration file
69+
// Check out https://github.com/FelixHerrmann/swift-package-list#build-tool-plugin for all possible configuration options.
70+
6871
{
69-
"projectPath" : "Project.xcworkspace",
70-
"project" : {
71-
"outputType" : "plist",
72-
"requiresLicense" : false
72+
projectPath: "Project.xcworkspace",
73+
project: {
74+
outputType: "plist",
75+
requiresLicense: false,
7376
},
74-
"targets" : {
75-
"Target 1" : {
76-
"outputType" : "settings-bundle",
77-
"requiresLicense" : true
77+
targets: {
78+
"Target 1": {
79+
outputType: "settings-bundle",
80+
requiresLicense: true,
7881
},
79-
"Target 2" : {
80-
"outputType" : "json",
81-
"requiresLicense" : true,
82-
"ignorePackages" : [
82+
"Target 2": {
83+
outputType: "json",
84+
requiresLicense: true,
85+
ignorePackages: [
8386
"swift-package-list",
8487
"swift-argument-parser",
8588
],
86-
"customPackagesFilePaths" : [
89+
customPackagesFilePaths: [
8790
"custom-packages.json",
88-
]
89-
}
90-
}
91+
],
92+
},
93+
},
9194
}
9295
```
9396

0 commit comments

Comments
 (0)