1
mirror of https://github.com/revanced/revanced-patcher synced 2025-09-10 05:30:49 +02:00

Compare commits

..

2 Commits

Author SHA1 Message Date
semantic-release-bot
079de45238 chore(release): 18.0.0-dev.3 [skip ci]
# [18.0.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0-dev.2...v18.0.0-dev.3) (2023-10-22)

### Features

* Make `PatchOption#values` nullable ([56ce9ec](56ce9ec2f9))
2023-10-22 14:09:28 +00:00
oSumAtrIX
56ce9ec2f9 feat: Make PatchOption#values nullable
There is no difference semantically, but this change allows passing null as a parameter which is simpler than having to use `emptySet()`.
2023-10-22 16:07:01 +02:00
4 changed files with 20 additions and 13 deletions

View File

@@ -1,3 +1,10 @@
# [18.0.0-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0-dev.2...v18.0.0-dev.3) (2023-10-22)
### Features
* Make `PatchOption#values` nullable ([56ce9ec](https://github.com/ReVanced/revanced-patcher/commit/56ce9ec2f98ff351c3d42df71b49e5c88f07e665))
# [18.0.0-dev.2](https://github.com/ReVanced/revanced-patcher/compare/v18.0.0-dev.1...v18.0.0-dev.2) (2023-10-22)

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 18.0.0-dev.2
version = 18.0.0-dev.3

View File

@@ -19,7 +19,7 @@ import kotlin.reflect.KProperty
open class PatchOption<T>(
val key: String,
val default: T?,
val values: Set<T>,
val values: Set<T>?,
val title: String?,
val description: String?,
val required: Boolean,
@@ -105,7 +105,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.stringPatchOption(
key: String,
default: String? = null,
values: Set<String> = emptySet(),
values: Set<String>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -130,7 +130,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.intPatchOption(
key: String,
default: Int? = null,
values: Set<Int> = emptySet(),
values: Set<Int>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -155,7 +155,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.booleanPatchOption(
key: String,
default: Boolean? = null,
values: Set<Boolean> = emptySet(),
values: Set<Boolean>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -180,7 +180,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.floatPatchOption(
key: String,
default: Float? = null,
values: Set<Float> = emptySet(),
values: Set<Float>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -205,7 +205,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.longPatchOption(
key: String,
default: Long? = null,
values: Set<Long> = emptySet(),
values: Set<Long>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -230,7 +230,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.stringArrayPatchOption(
key: String,
default: Array<String>? = null,
values: Set<Array<String>> = emptySet(),
values: Set<Array<String>>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -255,7 +255,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.intArrayPatchOption(
key: String,
default: Array<Int>? = null,
values: Set<Array<Int>> = emptySet(),
values: Set<Array<Int>>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -280,7 +280,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.booleanArrayPatchOption(
key: String,
default: Array<Boolean>? = null,
values: Set<Array<Boolean>> = emptySet(),
values: Set<Array<Boolean>>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -305,7 +305,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.floatArrayPatchOption(
key: String,
default: Array<Float>? = null,
values: Set<Array<Float>> = emptySet(),
values: Set<Array<Float>>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,
@@ -330,7 +330,7 @@ open class PatchOption<T>(
fun <P : Patch<*>> P.longArrayPatchOption(
key: String,
default: Array<Long>? = null,
values: Set<Array<Long>> = emptySet(),
values: Set<Array<Long>>? = null,
title: String? = null,
description: String? = null,
required: Boolean = false,

View File

@@ -62,7 +62,7 @@ internal class PatchOptionsTest {
@Test
fun `should allow setting value from values`() =
with(OptionsTestPatch.options["choices"] as PatchOption<String>) {
value = values.last()
value = values!!.last()
assertTrue(value == "valid")
}