mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-18 17:03:57 +00:00
Compare commits
2 Commits
v3.0.3-dev
...
v3.1.0-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2328902b6b | ||
|
|
7ec6504619 |
@@ -1,3 +1,10 @@
|
|||||||
|
# [3.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.3-dev.1...v3.1.0-dev.1) (2024-11-25)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Warn when option could not be set because the option does not exist ([7ec6504](https://github.com/ReVanced/revanced-library/commit/7ec650461935faf2a8fbb667db3cf137157b70b5))
|
||||||
|
|
||||||
## [3.0.3-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.2...v3.0.3-dev.1) (2024-11-11)
|
## [3.0.3-dev.1](https://github.com/ReVanced/revanced-library/compare/v3.0.2...v3.0.3-dev.1) (2024-11-11)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version = 3.0.3-dev.1
|
version = 3.1.0-dev.1
|
||||||
#Gradle
|
#Gradle
|
||||||
org.gradle.jvmargs = -Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx2048M"
|
org.gradle.jvmargs = -Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx2048M"
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
|
|||||||
@@ -19,11 +19,16 @@ private val logger = Logger.getLogger("Options")
|
|||||||
* @param options The options to set. The key is the patch name and the value is a map of option keys to option values.
|
* @param options The options to set. The key is the patch name and the value is a map of option keys to option values.
|
||||||
*/
|
*/
|
||||||
fun Set<Patch<*>>.setOptions(options: PatchesOptions) = filter { it.name != null }.forEach { patch ->
|
fun Set<Patch<*>>.setOptions(options: PatchesOptions) = filter { it.name != null }.forEach { patch ->
|
||||||
val patchOptions = options[patch.name] ?: return@forEach
|
options[patch.name]?.forEach setOption@{ (optionKey, optionValue) ->
|
||||||
|
if (optionKey !in patch.options) {
|
||||||
|
return@setOption logger.warning(
|
||||||
|
"Could not set option for the \"${patch.name}\" patch because " +
|
||||||
|
"option with key \"${optionKey}\" does not exist",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
patch.options.forEach option@{ option ->
|
|
||||||
try {
|
try {
|
||||||
patch.options[option.key] = patchOptions[option.key] ?: return@option
|
patch.options[optionKey] = optionValue
|
||||||
} catch (e: OptionException) {
|
} catch (e: OptionException) {
|
||||||
logger.warning("Could not set option value for the \"${patch.name}\" patch: ${e.message}")
|
logger.warning("Could not set option value for the \"${patch.name}\" patch: ${e.message}")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user