Skip to content

Commit a2c232f

Browse files
feat: 增加 CustomOneBotApi 类型,支持动态构建任意自定义API实例 (#249)
* feat(api): implement BasicOneBotApi and CustomOneBotApi with builder support * feat(api): update .gitignore and add copyright management configuration close #219 * feat(api): add default empty block parameter to CustomOneBotApiBuilder * feat(api): refactor CustomOneBotApi and CustomOneBotApiBuilder for improved readability --------- Co-authored-by: ForteScarlet <[email protected]>
1 parent d941160 commit a2c232f

File tree

20 files changed

+1467
-511
lines changed

20 files changed

+1467
-511
lines changed

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ build/
55
!**/src/test/**/build/
66

77
### IntelliJ IDEA ###
8-
.idea
9-
.idea/modules.xml
10-
.idea/jarRepositories.xml
11-
.idea/compiler.xml
12-
.idea/libraries/
8+
.idea/**
9+
!.idea/scopes/
10+
!.idea/scopes/*
11+
!.idea/copyright/
12+
!.idea/copyright/*
13+
!.idea/.gitignore
14+
1315
*.iws
1416
*.iml
1517
*.ipr

.idea/copyright/profiles_settings.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/simbot4_component_onebot.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scopes/copyrightScope.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
/*
2-
* Copyright (c) 2024. ForteScarlet.
2+
* Copyright (c) 2024-2025. ForteScarlet.
33
*
4-
* This file is part of simbot-component-onebot.
4+
* Project https://github.com/simple-robot/simbot-component-onebot
5+
56
*
6-
* simbot-component-onebot is free software: you can redistribute it and/or modify it under the terms
7-
* of the GNU Lesser General Public License as published by the Free Software Foundation,
8-
* either version 3 of the License, or (at your option) any later version.
7+
* This project and this file are part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
98
*
10-
* simbot-component-onebot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12-
* See the GNU Lesser General Public License for more details.
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Lesser General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* Lesser GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the Lesser GNU General Public License
20+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1321
*
14-
* You should have received a copy of the GNU Lesser General Public License along with simbot-component-onebot.
15-
* If not, see <https://www.gnu.org/licenses/>.
1622
*/
1723

1824
import io.gitlab.arturbosch.detekt.Detekt
@@ -139,7 +145,10 @@ apiValidation {
139145
"love.forte.simbot.component.onebot.common.annotations.SourceEventConstructor",
140146

141147
// CustomEventResolver
142-
"love.forte.simbot.component.onebot.v11.core.event.ExperimentalCustomEventResolverApi"
148+
"love.forte.simbot.component.onebot.v11.core.event.ExperimentalCustomEventResolverApi",
149+
150+
// CustomOneBotApi
151+
"love.forte.simbot.component.onebot.v11.core.api.ExperimentalCustomOneBotApi"
143152
),
144153
)
145154

buildSrc/src/main/kotlin/P.kt

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
/*
2-
* Copyright (c) 2023-2025. ForteScarlet.
2+
* Copyright (c) 2023-2025. ForteScarlet.
33
*
4-
* This file is part of simbot-component-onebot.
4+
* Project https://github.com/simple-robot/simbot-component-onebot
5+
56
*
6-
* simbot-component-onebot is free software: you can redistribute it and/or modify it under the terms
7-
* of the GNU Lesser General Public License as published by the Free Software Foundation,
8-
* either version 3 of the License, or (at your option) any later version.
7+
* This project and this file are part of the Simple Robot Library (Alias: simple-robot, simbot, etc.).
98
*
10-
* simbot-component-onebot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12-
* See the GNU Lesser General Public License for more details.
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Lesser General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* Lesser GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the Lesser GNU General Public License
20+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1321
*
14-
* You should have received a copy of the GNU Lesser General Public License along with simbot-component-onebot.
15-
* If not, see <https://www.gnu.org/licenses/>.
1622
*/
1723

18-
import P.ComponentOneBot.developers
19-
import P.ComponentOneBot.licenses
20-
import P.ComponentOneBot.scm
2124
import love.forte.gradle.common.core.project.ProjectDetail
2225
import love.forte.gradle.common.core.property.systemProp
2326

@@ -41,7 +44,7 @@ object P {
4144
override val homepage: String get() = HOMEPAGE
4245

4346
const val VERSION = "1.8.2"
44-
const val NEXT_VERSION = "1.8.3"
47+
const val NEXT_VERSION = "1.9.0-Beta1"
4548

4649
override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT"
4750
override val version = if (isSnapshot()) snapshotVersion else VERSION

0 commit comments

Comments
 (0)