mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-24 19:15:50 +01:00
refactor: rename class and move to sub-package
This commit is contained in:
parent
e6029d6716
commit
a5ab78188d
@ -1,7 +1,5 @@
|
|||||||
package app.revanced.meta.readme
|
package app.revanced.meta.readme
|
||||||
|
|
||||||
import SemanticVersion
|
|
||||||
import SemanticVersionComparator
|
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
import app.revanced.patcher.extensions.PatchExtensions.compatiblePackages
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.description
|
import app.revanced.patcher.extensions.PatchExtensions.description
|
||||||
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
import app.revanced.patcher.extensions.PatchExtensions.patchName
|
||||||
@ -24,7 +22,9 @@ class Generator {
|
|||||||
val patchName = patch.patchName
|
val patchName = patch.patchName
|
||||||
val compatiblePackage = patch.compatiblePackages?.first()
|
val compatiblePackage = patch.compatiblePackages?.first()
|
||||||
val latestVersion =
|
val latestVersion =
|
||||||
compatiblePackage?.versions?.map { SemanticVersion.fromString(it) }?.maxWithOrNull(SemanticVersionComparator) ?: "all"
|
compatiblePackage?.versions?.map { SemanticVersion.fromString(it) }?.maxWithOrNull(
|
||||||
|
SemanticVersionComparator
|
||||||
|
) ?: "all"
|
||||||
|
|
||||||
patches.appendLine("| `$patchName` | ${patch.description} | `${compatiblePackage?.name}` | $latestVersion |")
|
patches.appendLine("| `$patchName` | ${patch.description} | `${compatiblePackage?.name}` | $latestVersion |")
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
package app.revanced.meta.readme
|
||||||
|
|
||||||
data class SemanticVersion(val major: Int, val minor: Int, val patch: Int) {
|
data class SemanticVersion(val major: Int, val minor: Int, val patch: Int) {
|
||||||
companion object {
|
companion object {
|
||||||
fun fromString(version: String): SemanticVersion {
|
fun fromString(version: String): SemanticVersion {
|
Loading…
Reference in New Issue
Block a user