diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 58161ae05..000000000 --- a/build.gradle +++ /dev/null @@ -1,77 +0,0 @@ -import tasks.ReportGenerateTask - -plugins { - id 'java-library' - id 'org.jetbrains.kotlin.jvm' version '2.0.20' - id 'com.google.devtools.ksp' version '2.0.20-1.0.25' - id 'maven-publish' -} - -group = 'org.koitharu' -version = '1.0' - -test { - useJUnitPlatform() -} - -ksp { - arg("summaryOutputDir", "${projectDir}/.github") -} - -compileKotlin { - kotlinOptions { - freeCompilerArgs += [ - '-opt-in=kotlin.RequiresOptIn', - '-opt-in=kotlin.contracts.ExperimentalContracts', - '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi', - '-opt-in=org.koitharu.kotatsu.parsers.InternalParsersApi', - ] - } -} - -compileTestKotlin { - kotlinOptions { - freeCompilerArgs += [ - '-opt-in=kotlin.RequiresOptIn', - '-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi', - '-opt-in=org.koitharu.kotatsu.parsers.InternalParsersApi', - ] - } -} - -kotlin { - jvmToolchain(8) - explicitApi = 'warning' - sourceSets { - main.kotlin.srcDirs += 'build/generated/ksp/main/kotlin' - } -} - -afterEvaluate { - publishing { - publications { - mavenJava(MavenPublication) { - from components.java - } - } - } -} - -dependencies { - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2' - implementation 'com.squareup.okhttp3:okhttp:4.12.0' - implementation 'com.squareup.okio:okio:3.11.0' - api 'org.jsoup:jsoup:1.19.1' - implementation 'org.json:json:20240303' - implementation 'androidx.collection:collection:1.5.0' - - ksp project(':kotatsu-parsers-ksp') - - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1' - testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.1' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.1' - testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2' - testImplementation 'io.webfolder:quickjs:1.1.0' -} - -tasks.register('generateTestsReport', ReportGenerateTask) diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..a22733a7f --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,63 @@ +import tasks.ReportGenerateTask + +plugins { + `java-library` + `maven-publish` + alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.ksp) +} + +group = "org.koitharu" +version = "1.0" + +tasks.test { + useJUnitPlatform() +} + +ksp { + arg("summaryOutputDir", "${projectDir}/.github") +} + +tasks.withType().configureEach { + compilerOptions { + freeCompilerArgs.addAll( + "-opt-in=kotlin.RequiresOptIn", + "-opt-in=kotlin.contracts.ExperimentalContracts", + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + "-opt-in=org.koitharu.kotatsu.parsers.InternalParsersApi", + ) + } +} + +kotlin { + jvmToolchain(8) + explicitApiWarning() + sourceSets["main"].kotlin.srcDirs("build/generated/ksp/main/kotlin") +} + +publishing { + publications { + create("mavenJava") { + from(components["java"]) + } + } +} + +dependencies { + implementation(libs.kotlinx.coroutines.core) + implementation(libs.okhttp) + implementation(libs.okio) + implementation(libs.json) + implementation(libs.androidx.collection) + api(libs.jsoup) + + ksp(project(":kotatsu-parsers-ksp")) + + testImplementation(libs.junit.api) + testImplementation(libs.junit.engine) + testImplementation(libs.junit.params) + testImplementation(libs.kotlinx.coroutines.test) + testImplementation(libs.quickjs) +} + +tasks.register("generateTestsReport") diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index 577528ddd..000000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id 'org.jetbrains.kotlin.jvm' version '2.0.20' -} - -repositories { - mavenCentral() -} - -kotlin { - jvmToolchain(8) -} - -dependencies { - implementation gradleApi() - implementation 'org.simpleframework:simple-xml:2.7.1' - implementation 'com.soywiz.korlibs.korte:korte-jvm:4.0.10' - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1' -} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 000000000..fc4b79047 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + kotlin("jvm") version "2.0.20" +} + +repositories { + mavenCentral() +} + +kotlin { + jvmToolchain(8) +} + +dependencies { + implementation(gradleApi()) + implementation("org.simpleframework:simple-xml:2.7.1") + implementation("com.soywiz.korlibs.korte:korte-jvm:4.0.10") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1") +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..02db3bf8a --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,29 @@ +[versions] +kotlin = "2.0.20" +ksp = "2.0.20-1.0.25" +coroutines = "1.10.2" +junit = "5.10.1" +okhttp = "4.12.0" +okio = "3.11.0" +json = "20240303" +androidx-collection = "1.5.0" +jsoup = "1.19.1" +quickjs = "1.1.0" + +[plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } + +[libraries] +ksp-symbol-processing-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" } +kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" } +kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" } +junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit" } +junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" } +junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" } +okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } +okio = { module = "com.squareup.okio:okio", version.ref = "okio" } +json = { module = "org.json:json", version.ref = "json" } +androidx-collection = { module = "androidx.collection:collection", version.ref = "androidx-collection" } +jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" } +quickjs = { module = "io.webfolder:quickjs", version.ref = "quickjs" } diff --git a/kotatsu-parsers-ksp/build.gradle b/kotatsu-parsers-ksp/build.gradle deleted file mode 100644 index ce8c88860..000000000 --- a/kotatsu-parsers-ksp/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id 'org.jetbrains.kotlin.jvm' -} - -kotlin { - jvmToolchain(8) -} - -dependencies { - implementation 'com.google.devtools.ksp:symbol-processing-api:2.0.20-1.0.25' -} diff --git a/kotatsu-parsers-ksp/build.gradle.kts b/kotatsu-parsers-ksp/build.gradle.kts new file mode 100644 index 000000000..c05261875 --- /dev/null +++ b/kotatsu-parsers-ksp/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + alias(libs.plugins.kotlin.jvm) +} + +kotlin { + jvmToolchain(8) +} + +dependencies { + implementation(libs.ksp.symbol.processing.api) +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index f5398e52a..000000000 --- a/settings.gradle +++ /dev/null @@ -1,18 +0,0 @@ -pluginManagement { - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -dependencyResolutionManagement { - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -rootProject.name = 'kotatsu-parsers' -include 'kotatsu-parsers-ksp' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 000000000..834fbf540 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +rootProject.name = "kotatsu-parsers" +include("kotatsu-parsers-ksp")