Use a map

This commit is contained in:
Syer10 2021-07-23 19:52:36 -04:00
parent 4452c89dbb
commit afd659813d

View File

@ -25,22 +25,13 @@ object InspectorMain {
val (pkgName, sources) = installAPK(tmpDir) { val (pkgName, sources) = installAPK(tmpDir) {
it it
} }
ExtensionJson( pkgName to sources.map { source -> SourceJson(source) }
pkgName,
sources.map { source -> SourceJson(source) }
)
} else null } else null
} }.toMap()
File(outputPath).writeText(Json.encodeToString(extensions)) File(outputPath).writeText(Json.encodeToString(extensions))
} }
@Serializable
data class ExtensionJson(
val pkgName: String,
val sources: List<SourceJson>
)
@Serializable @Serializable
data class SourceJson( data class SourceJson(
val name: String, val name: String,