mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-03-17 03:00:19 +00:00
Pretty print the json files
This commit is contained in:
parent
a215294c68
commit
1b3c898415
@ -1,3 +1,5 @@
|
||||
import groovy.json.JsonOutput
|
||||
|
||||
plugins {
|
||||
java
|
||||
application
|
||||
@ -155,7 +157,8 @@ val compileJsonSchemas by tasks.registering(JavaCompile::class) {
|
||||
source = sourceSets.main.get().java
|
||||
include("org/asamk/signal/json/**/*.java")
|
||||
|
||||
// Exclude files with @JsonUnwrapped and files that reference them
|
||||
// Exclude files with @JsonUnwrapped and files that reference them as that breaks
|
||||
// the annotation generator
|
||||
exclude("org/asamk/signal/json/JsonSyncDataMessage.java")
|
||||
exclude("org/asamk/signal/json/JsonSyncStoryMessage.java")
|
||||
exclude("org/asamk/signal/json/JsonSyncMessage.java")
|
||||
@ -174,12 +177,18 @@ val compileJsonSchemas by tasks.registering(JavaCompile::class) {
|
||||
)
|
||||
|
||||
doLast {
|
||||
// Copy manual schemas for classes with @JsonUnwrapped
|
||||
copy {
|
||||
from("src/main/resources/META-INF/schemas")
|
||||
into(destinationDirectory.get().dir("META-INF/schemas"))
|
||||
include("*.schema.json")
|
||||
}
|
||||
|
||||
fileTree(destinationDirectory.get().dir("META-INF/schemas").asFile) {
|
||||
include("*.schema.json")
|
||||
}.forEach { schemaFile ->
|
||||
val prettyJson = JsonOutput.prettyPrint(schemaFile.readText())
|
||||
schemaFile.writeText("$prettyJson\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user