com.grab.grazel.util.GrazelJson.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grazel-gradle-plugin Show documentation
Show all versions of grazel-gradle-plugin Show documentation
A Gradle plugin to automate Bazel migration for Android projects
The newest version!
package com.grab.grazel.util
import kotlinx.serialization.json.decodeFromStream
import org.gradle.api.file.RegularFile
import java.io.File
import kotlinx.serialization.json.Json as KotlinJson
// Inject?
internal val Json = KotlinJson {
explicitNulls = false
ignoreUnknownKeys = true
}
internal inline fun fromJson(file: RegularFile): T = fromJson(file.asFile)
internal inline fun fromJson(json: File): T = json
.inputStream()
.buffered()
.use { stream -> Json.decodeFromStream(stream) }
© 2015 - 2024 Weber Informatics LLC | Privacy Policy