Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/copyright/simbot.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 60 additions & 35 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@
import changelog.GenerateChangelogTask
import changelog.GenerateSubChangelogTask
import love.forte.plugin.suspendtrans.gradle.SuspendTransformPluginExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.dsl.abi.AbiValidationExtension
import org.jetbrains.kotlin.gradle.dsl.abi.AbiValidationMultiplatformExtension
import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation

plugins {
idea
id("org.jetbrains.dokka")
// id("simbot.dokka-multi-module")
id("com.github.gmazzo.buildconfig") version "5.6.7" apply false
kotlin("multiplatform") apply false
kotlin("jvm") apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.detekt)
id("simbot.nexus-publish")
id("love.forte.plugin.suspend-transform") apply false
// alias(libs.plugins.suspendTransform) apply false

// https://www.jetbrains.com/help/qodana/code-coverage.html
// https://github.com/Kotlin/kotlinx-kover
alias(libs.plugins.kotlinxKover)

alias(libs.plugins.kotlinxBinaryCompatibilityValidator)


}

setupGroup(P.Simbot)
Expand Down Expand Up @@ -87,6 +87,8 @@ subprojects {
if (plugins.hasPlugin(libs.plugins.suspendTransform.get().pluginId)) {
configureSuspendTransform()
}

configKotlinAbiValidation()
}
}

Expand Down Expand Up @@ -147,36 +149,59 @@ fun Project.applyKover(rp: Project) {
}
//endregion

apiValidation {
ignoredPackages.add("*.internal.*")

ignoredProjects.addAll(
listOf(
"interface-uml-processor",
"simbot-test",
"tests",
"spring-boot-starter-test",
"simbot-processor-class-builder-test"
)
)

// 实验性和内部API可能无法保证二进制兼容
nonPublicMarkers.addAll(
listOf(
"love.forte.simbot.annotations.ExperimentalSimbotAPI",
"love.forte.simbot.annotations.InternalSimbotAPI",
"love.forte.simbot.resource.ExperimentalIOResourceAPI",
"love.forte.simbot.extension.continuous.session.ExperimentalContinuousSessionAPI"
),
)

ignoredClasses.add("love.forte.simbot.suspendrunner.SuspendMarker")
ignoredClasses.add("love.forte.simbot.suspendrunner.SuspendMarker.Container")
ignoredClasses.add("love.forte.simbot.suspendrunner.SuspendMarker\$Container")

apiDumpDirectory = "api"
@OptIn(ExperimentalAbiValidation::class)
fun Project.configKotlinAbiValidation() {
when {
plugins.hasPlugin("org.jetbrains.kotlin.jvm") -> {
extensions.configure<KotlinJvmProjectExtension>("kotlin") {
extensions.configure<AbiValidationExtension>("abiValidation") {
enabled.convention(true)
configAbiValidation()
}
}
}

plugins.hasPlugin("org.jetbrains.kotlin.multiplatform") -> {
extensions.configure<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension> {
extensions.configure<AbiValidationMultiplatformExtension>("abiValidation") {
enabled.convention(true)
configAbiValidation()
}
}
}
}
}

// apiValidation {
// ignoredPackages.add("*.internal.*")
//
// ignoredProjects.addAll(
// listOf(
// "interface-uml-processor",
// "simbot-test",
// "tests",
// "spring-boot-starter-test",
// "simbot-processor-class-builder-test"
// )
// )
//
// // 实验性和内部API可能无法保证二进制兼容
// nonPublicMarkers.addAll(
// listOf(
// "love.forte.simbot.annotations.ExperimentalSimbotAPI",
// "love.forte.simbot.annotations.InternalSimbotAPI",
// "love.forte.simbot.resource.ExperimentalIOResourceAPI",
// "love.forte.simbot.extension.continuous.session.ExperimentalContinuousSessionAPI"
// ),
// )
//
// ignoredClasses.add("love.forte.simbot.suspendrunner.SuspendMarker")
// ignoredClasses.add("love.forte.simbot.suspendrunner.SuspendMarker.Container")
// ignoredClasses.add("love.forte.simbot.suspendrunner.SuspendMarker\$Container")
//
// apiDumpDirectory = "api"
// }

idea {
module {
isDownloadSources = true
Expand Down
37 changes: 37 additions & 0 deletions buildSrc/src/main/kotlin/AbiValidationConfigs.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2025. ForteScarlet.
*
* Project https://github.com/simple-robot/simpler-robot
* Email ForteScarlet@163.com
*
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Lesser GNU General Public License for more details.
*
* You should have received a copy of the Lesser GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

import org.jetbrains.kotlin.gradle.dsl.abi.AbiValidationVariantSpec
import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation

@ExperimentalAbiValidation
fun AbiValidationVariantSpec.configAbiValidation() {
filters.excluded.byNames.add("**.internal.**")

filters.excluded.annotatedWith.addAll(
"love.forte.simbot.annotations.ExperimentalSimbotAPI",
"love.forte.simbot.annotations.InternalSimbotAPI",
"love.forte.simbot.resource.ExperimentalIOResourceAPI",
"love.forte.simbot.extension.continuous.session.ExperimentalContinuousSessionAPI"
)
}
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[versions]
kotlin = "2.1.20"
#dokka = "1.9.20"
kotlin = "2.2.20"
dokka = "2.0.0"
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "1.7.3"
kotlinx-io = "0.7.0"
spring-boot-v2 = "2.7.18"
spring-boot-v3 = "3.2.1"
ktor = "2.3.12"
ktor = "2.3.13"
slf4j = "2.0.17"
# https://kotlinlang.org/docs/ksp-quickstart.html
# https://github.com/google/ksp
ksp = "2.1.20-1.0.32"
ksp = "2.2.20-2.0.2"
# https://square.github.io/kotlinpoet/
# TODO to codeGentle
kotlinPoet = "2.1.0"
# https://github.com/Kotlin/kotlinx-benchmark
#kotlinxBenchmark = "0.4.11"
reactor = "3.7.9"
# simbots
#suspendTransform = "2.1.0-0.10.1"
suspendTransform = "2.1.20-0.12.0"
suspendTransform = "2.2.20-0.13.1"
gradleCommon = "0.6.0"
# tests
mockk = "1.14.5"
Expand Down
30 changes: 30 additions & 0 deletions internal-processors/interface-uml-processor/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*
* Copyright (c) 2025. ForteScarlet.
*
* Project https://github.com/simple-robot/simpler-robot
* Email ForteScarlet@163.com
*
* This file is part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Lesser GNU General Public License for more details.
*
* You should have received a copy of the Lesser GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation

/*
* Copyright (c) 2024. ForteScarlet.
Comment on lines +1 to 27
Copy link

Copilot AI Sep 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright header is duplicated. Remove the first copyright block (lines 1-22) since the second one (lines 26+) provides the original license text.

Copilot uses AI. Check for mistakes.
*
Expand Down Expand Up @@ -30,6 +55,11 @@ plugins {
configJavaCompileWithModule()

kotlin {
@OptIn(ExperimentalAbiValidation::class)
abiValidation {
enabled = false
}

jvmToolchain(11)
compilerOptions {
javaParameters = true
Expand Down
Loading
Loading