From 15f226fc73b35a991a9255745ca978abc544f77f Mon Sep 17 00:00:00 2001 From: Koitharu Date: Mon, 26 Jun 2023 13:27:31 +0300 Subject: [PATCH] Update gradle config --- .github/workflows/test-parsers.yml | 2 +- .idea/kotlinc.xml | 2 +- build.gradle | 12 ++++++------ buildSrc/build.gradle | 8 ++++---- buildSrc/src/main/kotlin/tasks/ReportGenerateTask.kt | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- kotatsu-parsers-ksp/build.gradle | 6 +++--- .../koitharu/kotatsu/parsers/ksp/ParserProcessor.kt | 1 + settings.gradle | 9 +++------ .../koitharu/kotatsu/parsers/MangaLoaderContext.kt | 3 ++- 10 files changed, 23 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test-parsers.yml b/.github/workflows/test-parsers.yml index 8ac54760..0bfc0021 100644 --- a/.github/workflows/test-parsers.yml +++ b/.github/workflows/test-parsers.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '11' distribution: 'temurin' cache: 'gradle' - run: ./gradlew :test --tests "org.koitharu.kotatsu.parsers.MangaParserTest" || true diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index fbd3b0a1..9a55c2de 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -3,4 +3,4 @@ - + \ No newline at end of file diff --git a/build.gradle b/build.gradle index ecebca93..447722d7 100644 --- a/build.gradle +++ b/build.gradle @@ -2,8 +2,8 @@ import tasks.ReportGenerateTask plugins { id 'java-library' - id 'org.jetbrains.kotlin.jvm' - id 'com.google.devtools.ksp' + id 'org.jetbrains.kotlin.jvm' version '1.8.21' + id 'com.google.devtools.ksp' version '1.8.22-1.0.11' id 'maven-publish' } @@ -16,7 +16,6 @@ test { compileKotlin { kotlinOptions { - jvmTarget = '1.8' freeCompilerArgs += [ '-opt-in=kotlin.RequiresOptIn', '-opt-in=kotlin.contracts.ExperimentalContracts', @@ -28,7 +27,6 @@ compileKotlin { compileTestKotlin { kotlinOptions { - jvmTarget = '1.8' freeCompilerArgs += [ '-opt-in=kotlin.RequiresOptIn', '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi', @@ -38,6 +36,7 @@ compileTestKotlin { } kotlin { + jvmToolchain(11) sourceSets { main.kotlin.srcDirs += 'build/generated/ksp/main/kotlin' } @@ -70,5 +69,6 @@ dependencies { testImplementation 'io.webfolder:quickjs:1.1.0' } -//noinspection ConfigurationAvoidance -task generateTestsReport(type: ReportGenerateTask) +tasks.register('generateTestsReport', ReportGenerateTask) { + dependsOn test +} diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index fe719039..c01928d5 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,5 +1,5 @@ plugins { - id('org.jetbrains.kotlin.jvm') version '1.6.21' + id 'org.jetbrains.kotlin.jvm' version '1.8.21' } repositories { mavenCentral() @@ -8,6 +8,6 @@ repositories { dependencies { implementation gradleApi() implementation 'org.simpleframework:simple-xml:2.7.1' - implementation 'com.soywiz.korlibs.korte:korte-jvm:3.0.0-Beta5' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3' -} \ No newline at end of file + implementation 'com.soywiz.korlibs.korte:korte-jvm:4.0.6' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1' +} diff --git a/buildSrc/src/main/kotlin/tasks/ReportGenerateTask.kt b/buildSrc/src/main/kotlin/tasks/ReportGenerateTask.kt index 72b1587a..078fefe1 100644 --- a/buildSrc/src/main/kotlin/tasks/ReportGenerateTask.kt +++ b/buildSrc/src/main/kotlin/tasks/ReportGenerateTask.kt @@ -1,6 +1,6 @@ package tasks -import com.soywiz.korte.Template +import korlibs.template.Template import kotlinx.coroutines.runBlocking import org.gradle.api.DefaultTask import org.gradle.api.tasks.TaskAction diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e5897..fae08049 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/kotatsu-parsers-ksp/build.gradle b/kotatsu-parsers-ksp/build.gradle index e6317098..2ac8590a 100644 --- a/kotatsu-parsers-ksp/build.gradle +++ b/kotatsu-parsers-ksp/build.gradle @@ -1,7 +1,7 @@ plugins { - id 'org.jetbrains.kotlin.jvm' + id 'org.jetbrains.kotlin.jvm' version '1.8.21' } dependencies { - implementation 'com.google.devtools.ksp:symbol-processing-api:1.6.21-1.0.5' -} \ No newline at end of file + implementation 'com.google.devtools.ksp:symbol-processing-api:1.8.22-1.0.11' +} diff --git a/kotatsu-parsers-ksp/src/main/kotlin/org/koitharu/kotatsu/parsers/ksp/ParserProcessor.kt b/kotatsu-parsers-ksp/src/main/kotlin/org/koitharu/kotatsu/parsers/ksp/ParserProcessor.kt index cdce07a1..c89c4d2e 100644 --- a/kotatsu-parsers-ksp/src/main/kotlin/org/koitharu/kotatsu/parsers/ksp/ParserProcessor.kt +++ b/kotatsu-parsers-ksp/src/main/kotlin/org/koitharu/kotatsu/parsers/ksp/ParserProcessor.kt @@ -70,6 +70,7 @@ class ParserProcessor( import org.koitharu.kotatsu.parsers.model.MangaSource @Suppress("DEPRECATION") + @InternalParsersApi @Deprecated("", replaceWith = ReplaceWith("context.newParserInstance(this)")) fun MangaSource.newParser(context: MangaLoaderContext): MangaParser = when (this) { diff --git a/settings.gradle b/settings.gradle index 95cda867..0ffa7a43 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,19 +1,16 @@ pluginManagement { - plugins { - id 'com.google.devtools.ksp' version '1.8.22-1.0.11' - id 'org.jetbrains.kotlin.jvm' version '1.8.22' - } repositories { - gradlePluginPortal() google() + mavenCentral() + gradlePluginPortal() } } dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() + gradlePluginPortal() } } diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/MangaLoaderContext.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/MangaLoaderContext.kt index dc6ce96f..9af4edd8 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/MangaLoaderContext.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/MangaLoaderContext.kt @@ -12,7 +12,8 @@ abstract class MangaLoaderContext { abstract val cookieJar: CookieJar - fun newParserInstance(source: MangaSource): MangaParser = this.newParserInstance(source) + @Suppress("DEPRECATION") + fun newParserInstance(source: MangaSource): MangaParser = source.newParser(this) open fun encodeBase64(data: ByteArray): String = Base64.getEncoder().encodeToString(data)