com.bugsnag.android.gradle.AndroidManifestInfo.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bugsnag-android-gradle-plugin Show documentation
Show all versions of bugsnag-android-gradle-plugin Show documentation
Gradle plugin to automatically upload ProGuard mapping files to Bugsnag.
package com.bugsnag.android.gradle
import com.squareup.moshi.JsonClass
import com.squareup.moshi.Moshi
import okio.buffer
import okio.sink
import okio.source
import java.io.File
@JsonClass(generateAdapter = true)
data class AndroidManifestInfo(
val apiKey: String,
val versionCode: String,
val buildUUID: String,
val versionName: String,
val applicationId: String
) {
internal fun write(file: File) {
file.sink().buffer().use {
ADAPTER.toJson(it, this)
}
}
internal companion object {
private val ADAPTER = Moshi.Builder().build().adapter(AndroidManifestInfo::class.java)
fun read(file: File): AndroidManifestInfo {
return file.source().buffer().use {
ADAPTER.fromJson(it) ?: error("Failed to parse manifest info.")
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy