refactor: move classes to correct places and fix their access

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
oSumAtrIX 2023-01-23 02:30:23 +01:00
parent 439343ab9d
commit e29be7c6d4
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -20,14 +20,14 @@ internal class JsonGenerator : PatchesFileGenerator {
it.version ?: "0.0.0",
!it.include,
it.options?.map { option ->
Option(
JsonPatch.Option(
option.key,
option.title,
option.description,
option.required,
option.let { lo ->
if (lo is PatchOption.ListOption<*>) {
lo.options.toMutableList().toTypedArray()
option.let { listOption ->
if (listOption is PatchOption.ListOption<*>) {
listOption.options.toMutableList().toTypedArray()
} else null
}
)
@ -36,7 +36,7 @@ internal class JsonGenerator : PatchesFileGenerator {
dep.java.patchName
}?.toTypedArray() ?: emptyArray(),
it.compatiblePackages?.map { pkg ->
CompatiblePackage(pkg.name, pkg.versions)
JsonPatch.CompatiblePackage(pkg.name, pkg.versions)
}?.toTypedArray() ?: emptyArray()
)
}
@ -45,7 +45,7 @@ internal class JsonGenerator : PatchesFileGenerator {
json.writeText(GsonBuilder().serializeNulls().create().toJson(patches))
}
data class JsonPatch(
private class JsonPatch(
val name: String,
val description: String,
val version: String,
@ -53,18 +53,18 @@ internal class JsonGenerator : PatchesFileGenerator {
val options: Array<Option>,
val dependencies: Array<String>,
val compatiblePackages: Array<CompatiblePackage>,
)
) {
class CompatiblePackage(
val name: String,
val versions: Array<String>,
)
data class CompatiblePackage(
val name: String,
val versions: Array<String>,
)
data class Option(
val key: String,
val title: String,
val description: String,
val required: Boolean,
val choices: Array<*>?,
)
class Option(
val key: String,
val title: String,
val description: String,
val required: Boolean,
val choices: Array<*>?,
)
}
}