Update gradle, kotlin and enum extensions

pull/227/head
Koitharu 3 years ago
parent 6058221fec
commit 08eb9552d6
Signed by: Koitharu
GPG Key ID: 676DEE768C17A9D7

@ -2,8 +2,8 @@ import tasks.ReportGenerateTask
plugins { plugins {
id 'java-library' id 'java-library'
id 'org.jetbrains.kotlin.jvm' version '1.8.22' id 'org.jetbrains.kotlin.jvm' version '1.9.0'
id 'com.google.devtools.ksp' version '1.8.22-1.0.11' id 'com.google.devtools.ksp' version '1.9.0-1.0.13'
id 'maven-publish' id 'maven-publish'
} }
@ -53,7 +53,7 @@ afterEvaluate {
} }
dependencies { dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
implementation 'com.squareup.okhttp3:okhttp:4.11.0' implementation 'com.squareup.okhttp3:okhttp:4.11.0'
implementation 'com.squareup.okio:okio:3.3.0' implementation 'com.squareup.okio:okio:3.3.0'
api 'org.jsoup:jsoup:1.16.1' api 'org.jsoup:jsoup:1.16.1'

@ -8,6 +8,6 @@ repositories {
dependencies { dependencies {
implementation gradleApi() implementation gradleApi()
implementation 'org.simpleframework:simple-xml:2.7.1' implementation 'org.simpleframework:simple-xml:2.7.1'
implementation 'com.soywiz.korlibs.korte:korte-jvm:4.0.6' implementation 'com.soywiz.korlibs.korte:korte-jvm:4.0.9'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
} }

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

@ -3,5 +3,5 @@ plugins {
} }
dependencies { dependencies {
implementation 'com.google.devtools.ksp:symbol-processing-api:1.8.22-1.0.11' implementation 'com.google.devtools.ksp:symbol-processing-api:1.9.0-1.0.13'
} }

@ -50,7 +50,7 @@ abstract class MangaParser @InternalParsersApi constructor(
protected open val defaultSortOrder: SortOrder protected open val defaultSortOrder: SortOrder
get() { get() {
val supported = sortOrders val supported = sortOrders
return SortOrder.values().first { it in supported } return SortOrder.entries.first { it in supported }
} }
@JvmField @JvmField

@ -40,7 +40,6 @@ inline fun <T, reified R> Array<T>.mapToArray(transform: (T) -> R): Array<R> = A
} }
fun <K, V> List<Pair<K, V>>.toMutableMap(): MutableMap<K, V> = toMap(ArrayMap(size)) fun <K, V> List<Pair<K, V>>.toMutableMap(): MutableMap<K, V> = toMap(ArrayMap(size))
fun <T : Enum<T>> Array<T>.names() = mapToArray { it.name }
fun <T> MutableList<T>.move(sourceIndex: Int, targetIndex: Int) { fun <T> MutableList<T>.move(sourceIndex: Int, targetIndex: Int) {
if (sourceIndex <= targetIndex) { if (sourceIndex <= targetIndex) {

@ -0,0 +1,13 @@
@file:JvmName("EnumUtils")
package org.koitharu.kotatsu.parsers.util
import kotlin.enums.EnumEntries
fun <E : Enum<E>> EnumEntries<E>.names() = Array(size) { i ->
get(i).name
}
fun <E : Enum<E>> EnumEntries<E>.find(name: String): E? {
return find { x -> x.name == name }
}

@ -11,7 +11,7 @@ class AuthCheckExtension : BeforeAllCallback {
private val loaderContext: MangaLoaderContext = MangaLoaderContextMock private val loaderContext: MangaLoaderContext = MangaLoaderContextMock
override fun beforeAll(context: ExtensionContext) { override fun beforeAll(context: ExtensionContext) {
for (source in MangaSource.values()) { for (source in MangaSource.entries) {
if (source == MangaSource.LOCAL || source == MangaSource.DUMMY) { if (source == MangaSource.LOCAL || source == MangaSource.DUMMY) {
continue continue
} }

Loading…
Cancel
Save