Commit Graph

817 Commits

Author SHA1 Message Date
Him188
ff9c493e4b Support kotlinx-serialization builtin serializers 2020-11-13 14:32:16 +08:00
Karlatemp
3b27a26b0a
Fix SemVersion.Requirement 2020-11-12 22:25:44 +08:00
Him188
af09c59874 Update docs 2020-11-12 12:43:34 +08:00
Karlatemp
0b23d3a46f
Merge remote-tracking branch 'origin/master' 2020-11-12 12:41:51 +08:00
Karlatemp
7dd4a9669b
Fix console stopping, fix #221
- Make StopCommand async
- Close terminal reader only
2020-11-12 12:38:49 +08:00
Him188
52eaf56e5a Check Requirement.rule on init 2020-11-12 10:06:51 +08:00
Him188
1657fbd5ac Review SemVersion: Update docs 2020-11-12 10:06:33 +08:00
Him188
3e36fa42fe Update JvmPluginDescription.loadFromResource for all JDKs 2020-11-12 09:58:47 +08:00
Him188
1d6dccb793 Pretty buildscript 2020-11-12 09:42:18 +08:00
Him188
6fe21b9286 Don't allow AbstractJvmPlugin service 2020-11-10 14:00:40 +08:00
Him188
e3aceec0b4 Use super.description for JCompositeCommand.description 2020-11-10 08:57:25 +08:00
Him188
f51003ad58 Add test raw command 2020-11-10 08:55:54 +08:00
Him188
ba7822cf88 Merge remote-tracking branch 'origin/master' 2020-11-10 08:25:28 +08:00
Karlatemp
ce678a75b7
Make SemVersion.Requirement data class 2020-11-09 23:19:42 +08:00
Him188
85600d35b0 Fix build 2020-11-09 15:46:05 +08:00
Him188
fd438c2e4c Support loading plugin description from resources 2020-11-09 15:36:44 +08:00
Him188
0fb7d49898 Make PluginDependency serializable 2020-11-09 15:31:41 +08:00
Him188
64e535d282 Move JvmPluginDescription.invoke to top-level 2020-11-09 14:37:10 +08:00
Karlatemp
d54f4cd0d9
console.debug logger 2020-11-09 13:33:05 +08:00
Karlatemp
8b6e2a1d9c
Update AbstractCommandValueParameter.render style 2020-11-09 13:16:44 +08:00
Him188
1a5355db89 CommandConfig, support custom commandPrefix, close #131 2020-11-09 09:53:47 +08:00
Him188
8946e6e34e
Merge pull request #212 from mamoe/logger
Logger Controller
2020-11-08 12:20:43 +08:00
Him188
e1c1e28713 Update dependencies 2020-11-08 11:10:46 +08:00
Karlatemp
3a5fa11554
Move LogPriority into AbstractLoggerController 2020-11-08 10:49:57 +08:00
Karlatemp
cce3749661
KDoc; Adjust the order of property 2020-11-08 10:32:18 +08:00
Karlatemp
d345157349
@ConsoleExperimentalApi 2020-11-08 10:22:08 +08:00
Him188
e5a7df46de Code cleanup 2020-11-08 09:52:29 +08:00
Him188
65a65ffb03 Fix cast in findBackingFieldValue 2020-11-08 09:38:19 +08:00
Karlatemp
81aa60fe5d
Review AnsiMessageBuilder
- Rename isAnsiSupport to isAnsiSupported
- Rename AnsiMessageBuilder.builder to delegate
- Rename factory function
- Move buildAnsiMessage to top-level
- Move CommandSender.sendAnsiMessage to top-level
- Add String.dropAnsi(): String
2020-11-07 11:23:26 +08:00
Karlatemp
36d1480298
Typo 2020-11-06 13:51:38 +08:00
Karlatemp
01418845f3
Ansi support 2020-11-06 13:41:46 +08:00
Karlatemp
a6ce62f1c3
Resolve duplicate save 2020-11-05 23:26:54 +08:00
Karlatemp
7f35409b50
Typo 2020-10-30 18:25:55 +08:00
Karlatemp
ada3c8f375
AbstractLoggerController 2020-10-30 18:14:09 +08:00
Karlatemp
f1113bbcce
Merge remote-tracking branch 'origin/master' into logger 2020-10-30 17:41:03 +08:00
Him188
c8f6575c44 Update build constants and README 2020-10-30 15:01:20 +08:00
Him188
43eef23b67 Fix StringConstant 2020-10-30 13:02:07 +08:00
Him188
1ae6b1f13c Improve command descriptions 2020-10-30 11:39:36 +08:00
Him188
b6794a8826 Fix string constant arguments 2020-10-30 11:35:50 +08:00
Him188
71c744c429 Fix command reflection 2020-10-30 11:35:26 +08:00
Him188
80e869e8c9 Fix subCommandNames 2020-10-30 11:23:55 +08:00
Him188
f7c8534b4e Fix HelpCommand 2020-10-30 10:54:40 +08:00
Him188
03467a6f45 Simplify source root structure 2020-10-30 10:28:18 +08:00
Him188
cdefb2dbed Cleanup code 2020-10-30 10:01:38 +08:00
Him188
77e38dd964 Check instanceReceiver before call 2020-10-30 09:48:32 +08:00
Him188
3b14d70cc5 Fix command receiverParameter, #215 2020-10-30 09:48:12 +08:00
Karlatemp
6d15c3b301
delete dropConfig 2020-10-28 18:11:00 +08:00
Karlatemp
73463554b8
delete LoggerControllerProvider 2020-10-28 18:09:03 +08:00
Him188
bace377d1e Fix semantic version and plugin id regexes 2020-10-28 15:38:25 +08:00
Him188
34eb8eb9cb 1.0-RC 2020-10-28 14:02:03 +08:00
Him188
b9f70b1c66 Rename CommandReceiverParameter.PARAMETER_NAME to CommandReceiverParameter.NAME 2020-10-28 13:57:28 +08:00
Him188
0078ebd68f Allow "1" for BooleanValueArgumentParser 2020-10-28 13:48:20 +08:00
Him188
2c5f9ebcf4 Update copyright 2020-10-28 13:35:15 +08:00
Him188
f10632e754 Separate command descriptor files 2020-10-28 13:30:44 +08:00
Him188
72b75fd287 Add @ConsoleExperimentalApi for experimental Value APIs 2020-10-28 13:27:16 +08:00
Him188
cfdce8dd8c
Update TestCommand.kt 2020-10-27 21:58:57 +08:00
Him188
d2dffef44c 1.0-RC Code review 2020-10-27 20:39:38 +08:00
Karlatemp
7e480c2de2
Update ExportManager rule 2020-10-27 12:49:05 +08:00
Karlatemp
9b042a439c
Merge remote-tracking branch 'origin/master' into dependencies 2020-10-27 12:37:11 +08:00
Karlatemp
abb55ac619
Allow FrontEnd to implement LoggerController 2020-10-26 23:30:35 +08:00
Karlatemp
544e11747c
Redesign LoggerController 2020-10-26 23:20:10 +08:00
Karlatemp
7d36bc6f7d
Merge remote-tracking branch 'origin/master' into logger 2020-10-26 22:59:30 +08:00
Karlatemp
0a76a4b71a
Review LoggerController
- Delete LoggerControllerPlatformBase
- Rename LoggerControllerForFrontend to LoggerControllerImpl
2020-10-26 12:35:29 +08:00
Him188
7c3485ef9b Rename extension impls 2020-10-26 08:28:25 +08:00
Him188
3f0d123421 Check receiver type in init 2020-10-26 08:14:32 +08:00
Him188
3933c3e8fb CommandDeclarationException 2020-10-26 08:13:59 +08:00
Him188
77e344b4aa Support receivers in resolving command 2020-10-26 08:08:49 +08:00
Karlatemp
b60ce7d856
Merge remote-tracking branch 'origin/master' into logger 2020-10-25 23:48:16 +08:00
Karlatemp
2957e42625
Fix SemVersion testing 2020-10-25 23:30:27 +08:00
Karlatemp
9f88293691
Review LoggerController
- Delete logger cache
- Move MiraiConsoleLogger to internal package
2020-10-25 23:16:58 +08:00
Karlatemp
cef1326432
Rename MiraiConsoleLoggerController to LoggerController 2020-10-25 23:00:59 +08:00
Him188
ce0bf8d8be Review extension 2020-10-25 21:40:41 +08:00
Him188
077e4055cc Review extensions 2020-10-25 21:10:45 +08:00
Him188
1f790158e6 Review PermissionService 2020-10-25 20:59:56 +08:00
Him188
291035f978 Review command:
Add `CommandReflector.validate` to check declaration clashes;
Rename CommandSignatureVariant to CommandSignature;
Add docs;
Cleanup code;
2020-10-25 14:49:08 +08:00
Him188
d1ebe44f3e Review CommandArgumentContext and command 2020-10-25 14:27:27 +08:00
Him188
5c16e685b3 Mark ValueDescription with SerialInfo 2020-10-25 13:29:06 +08:00
Him188
717c908ccf Support multiple ResolveContext kinds in single declaration 2020-10-25 13:16:27 +08:00
Him188
0007a97d66 Review SemVersion:
Add SemVersion.equals;
Amend hashCode;
Add docs.
2020-10-25 13:00:55 +08:00
Him188
df8b819d37 Test yaml on save, close #203, close #191 2020-10-24 21:37:33 +08:00
Him188
321aa74a66 Mark PluginPermissionIdRequestType as experimental 2020-10-24 21:26:57 +08:00
Him188
3ed018c4f8 Review plugin 2020-10-24 21:24:52 +08:00
Him188
f80c4b3fd1 Merge branch 'master' into command
# Conflicts:
#	backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/permission/PermissionId.kt
2020-10-24 21:22:46 +08:00
Him188
648f2bf75f Review permission 2020-10-24 21:20:16 +08:00
Him188
b9580ffcbd Review command 2020-10-24 21:19:50 +08:00
Karlatemp
1d88a9d942
Fix MiraiConsoleLoggerUnused.isEnabled 2020-10-24 19:58:29 +08:00
Karlatemp
e9de080a96
Update KDoc for MiraiConsoleLoggerController 2020-10-24 19:54:40 +08:00
Karlatemp
d477b79e65
KDoc for MiraiConsoleLoggerController 2020-10-24 19:51:00 +08:00
Karlatemp
96017ae862
MiraiConsoleLoggerController 2020-10-24 19:34:16 +08:00
Him188
d10f2b4bea Support vararg in command 2020-10-24 13:14:25 +08:00
Him188
87b56ade12 Fix CommandValueArgumentParser<T>.parse 2020-10-24 12:12:53 +08:00
Him188
a486ceb602 Resolution with optional defaults 2020-10-24 12:00:56 +08:00
Him188
b3880093bf Fix StringConstant params 2020-10-24 11:41:32 +08:00
Him188
151a5d5735 Fix optional resolving 2020-10-24 11:35:10 +08:00
Him188
4aa996a417 Rework command reflection:
- Remove AbstractReflectionCommand
- Introduce CommandReflector
- Misc improvements
2020-10-23 21:32:04 +08:00
Karlatemp
4564531f8b
Fix atomic value updating 2020-10-23 18:03:41 +08:00
Him188
084e2c5c55 Fix command call 2020-10-23 13:40:16 +08:00
Him188
9adc4cde55 Do checkPluginDescription in SimpleJvmPluginDescription.init 2020-10-23 13:00:08 +08:00
Him188
fc5fc18913 Make JvmPluginDescription.Companion.invoke inline 2020-10-23 12:57:39 +08:00
Him188
3ce1e4f029 Fix docs 2020-10-23 12:57:25 +08:00
Him188
0ae03d141e Remove ResolveContext misuse 2020-10-23 12:55:44 +08:00
Him188
075a2bd519 Add ResolveContext to JvmPluginDescriptionBuilder.id 2020-10-23 12:54:36 +08:00
Him188
e303eae15a Add String variant of dependsOn.versionRequirement; Add ResolveContext.VERSION_REQUIREMENT 2020-10-23 12:49:00 +08:00
Him188
643ac52bc7 Update docs 2020-10-23 12:40:50 +08:00
Him188
33141258f2 Use Lazy.PUBLICATION for SemVersion.toString 2020-10-23 12:40:37 +08:00
Him188
4c30e3d9d7 Add docs 2020-10-22 13:40:22 +08:00
Karlatemp
cdfa5df189
Use plugin id not name 2020-10-22 00:33:04 +08:00
Karlatemp
d0b71b200f
block whitespace in permission id
- blocked all whitespace
- Update IntelliJ IDEA plugin message
- Bump IntelliJ IDEA testing project version
- Add tests for permission id
2020-10-21 00:02:55 +08:00
Him188
fa43f2689c Merge branch 'master' into command
# Conflicts:
#	tools/gradle-plugin/src/main/kotlin/net/mamoe/mirai/console/gradle/VersionConstants.kt
2020-10-20 14:11:51 +08:00
Him188
3d4f31759f Support conversion with CommandArgumentContext 2020-10-20 14:07:08 +08:00
Him188
3e2a5c382e Introduce default type variants 2020-10-20 13:54:05 +08:00
Him188
58af1b3354 Introduce InstanceExtensionPoint 2020-10-20 13:47:43 +08:00
Him188
2084f8154f Fix compilation 2020-10-20 13:27:13 +08:00
Him188
a9c80e11b8 Merge remote-tracking branch 'origin/command' into command
# Conflicts:
#	backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/command/executeCommandInternal.kt
2020-10-18 12:27:09 +08:00
Him188
df461290c0 Command resolving 2020-10-18 12:26:54 +08:00
Karlatemp
d4c147a8a9
IllegalCommandArgumentException 2020-10-17 11:47:40 +08:00
Karlatemp
6bb0241eef
Fix Plugin.permissionId 2020-10-16 18:20:30 +08:00
Karlatemp
e31174a2b7
Keep permissionName intact 2020-10-16 18:13:56 +08:00
Karlatemp
7cb6ee1e18
Keep permissionName intact 2020-10-16 18:09:34 +08:00
Karlatemp
521f928926
fix #206 2020-10-15 18:16:15 +08:00
Him188
82de404149 Add doc for TypeVariant 2020-10-15 13:04:30 +08:00
Karlatemp
64c44295d3
Resolve conflicts 2020-10-10 11:59:22 +08:00
Karlatemp
bf40b6036b
Merge remote-tracking branch 'origin/master' into dependencies
# Conflicts:
#	backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/BuiltInJvmPluginLoaderImpl.kt
#	backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/JvmPluginClassLoader.kt
2020-10-10 11:42:24 +08:00
Karlatemp
5cdd32ab4c
Limit JvmPluginClassLoader resource loading region
Fix #205
2020-10-10 11:36:23 +08:00
Him188
bde3d995be Merge remote-tracking branch 'origin/master' 2020-10-09 21:44:09 +08:00
Him188
b2d06aba14 Remove all @JvmDefault since -Xjvm-default=all mode 2020-10-09 21:43:42 +08:00
Him188
b52ba9dc2c Fix typo 2020-10-09 21:43:13 +08:00
Him188
ccc9128023 CommandParameter optionality and UserDefinedType 2020-10-09 12:52:47 +08:00
Him188
86c3b18bca CommandValueArgumentParser 2020-10-09 12:35:16 +08:00
Him188
1e9b498ba9 Docs and API improvements 2020-10-09 10:47:49 +08:00
Him188
4ddee69531 Use RawCommandArgument for CommandValueArgument 2020-10-09 10:13:07 +08:00
Him188
d6adb3c9ea Command descriptors 2020-10-08 10:20:53 +08:00
Karlatemp
ab5f9f5cee
Transfer allocatePermissionIdForPlugin to member function 2020-10-07 13:25:14 +08:00
Him188
c413e9f79d Rename command.description to command.descriptor for future use 2020-10-01 16:38:37 +08:00
Karlatemp
5ef8cec447
Fix Terminal version rendering. 2020-09-26 23:51:00 +08:00
Karlatemp
5d962ea6d7
typo 2020-09-24 18:15:46 +08:00
Him188
12a035fce8 Merge branch 'master' into command 2020-09-24 15:53:43 +08:00
Karlatemp
2520e4bb35
delete SemVersionRangeRequirementBuilder 2020-09-21 18:09:01 +08:00
Him188
a434e6f569 Merge remote-tracking branch 'origin/master' 2020-09-21 13:22:55 +08:00
Him188
2a6d98ba16 Add shadowJarMd5 for shadowed files 2020-09-21 13:22:37 +08:00
Karlatemp
dc0ba1d8ff
Fix SemVersionRangeRequirementBuilder 2020-09-21 12:47:53 +08:00
Karlatemp
209bc97b32
Update KDoc 2020-09-21 12:42:05 +08:00
Karlatemp
00781c215a
Update Math interval 2020-09-21 12:31:12 +08:00
Karlatemp
1c909ae752
Better Requirement Rule 2020-09-21 12:15:01 +08:00
Karlatemp
62527f0ed0
Extract SemVersion.major, minor, patch 2020-09-20 22:48:54 +08:00
Him188
a19f3c7406 Fix doc 2020-09-20 22:02:51 +08:00
Him188
2104cc2192 Merge branch 'master' into command
# Conflicts:
#	backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/description/CommandArgumentContext.kt
2020-09-20 21:57:10 +08:00
Him188
7a8944b1d6 Add note for reserved primary constructor 2020-09-20 21:38:43 +08:00
Him188
ff68342110 Declare ValueName as stable 2020-09-20 21:38:31 +08:00
Him188
13a0444244 Fix deprecation message on PluginData implementations 2020-09-20 21:35:31 +08:00
Him188
91c5f5f134 Use JSON to store data if YAML failed 2020-09-20 21:32:38 +08:00
Him188
71a02e7630 Import yamlkt using 'implementation', improve buildscript 2020-09-20 21:32:05 +08:00
Him188
e10a17ccd4 Add PlainTextArgumentParser 2020-09-20 19:33:21 +08:00
Him188
453ad8f9e2 Add ImageArgumentParser, fix #183 2020-09-20 19:32:00 +08:00
Him188
704674698f Add ResolveContext 2020-09-20 19:05:45 +08:00
Him188
57c30e4689 Fix build, Fix code style 2020-09-20 19:03:50 +08:00
Him188
9514a5c3e8 Make SemVersion.Requirement not fun 2020-09-20 18:59:59 +08:00
Him188
2035e136f3 Rename SemVersion.RangeRequirement to SemVersion.Requirement 2020-09-20 18:59:37 +08:00
Him188
47750c5060 Add ResolveContext for PluginDependency 2020-09-20 18:58:26 +08:00
Him188
09de9e7cd7 Make SimpleJvmPluginDescription internal 2020-09-20 18:57:10 +08:00
Him188
e26e98d030 Rename SemVersion.Companion.parse to SemVersion.Companion.invoke 2020-09-20 18:54:51 +08:00
Karlatemp
eb7cd3811d
Deploy SemVersion 2020-09-20 18:02:35 +08:00
Him188
6912982949 Fix docs 2020-09-20 14:31:27 +08:00
Him188
cea545d46b Merge remote-tracking branch 'origin/master' 2020-09-20 14:29:32 +08:00
Him188
30a10f56d0 Update docs 2020-09-20 14:25:54 +08:00
Karlatemp
40402dadf2
Merge branch 'master' of https://github.com/mamoe/mirai-console 2020-09-20 14:11:28 +08:00
Karlatemp
44598aa1fa
Convert receiver to parameter 2020-09-20 14:10:08 +08:00
Him188
9acaa7882d Merge remote-tracking branch 'origin/master' 2020-09-20 14:10:03 +08:00
Him188
9c2a0abda5 Move implementations to SemVersionInternal 2020-09-20 14:09:48 +08:00
Karlatemp
46ec2460b3
Merge remote-tracking branch 'origin/master' 2020-09-20 13:56:52 +08:00
Him188
7a533d4667 Use lazy for SemVersion.toString 2020-09-20 13:56:12 +08:00
Karlatemp
798425e6e8
Rename SemVersion.RangeRequirement.check to test 2020-09-20 13:55:44 +08:00
Him188
ef4d259f60 Document improvements 2020-09-20 13:55:00 +08:00
Karlatemp
58d799581b
Add CommandExecuteResult.IllegalArgument 2020-09-20 09:40:51 +08:00
Karlatemp
b77a856ebe
Merge remote-tracking branch 'origin/master' into command 2020-09-20 09:24:24 +08:00
Him188
100bc10404 Fix shadow 2020-09-20 00:28:57 +08:00
Him188
ec03f8322d Update docs 2020-09-19 23:29:28 +08:00
Karlatemp
5f6873e347
Change SubCommandDescriptor calling from callSuspend to callSuspendBy
- Support optional argument now.
2020-09-19 15:56:57 +08:00
Him188
48f5c947b6 Add experimental API notes 2020-09-19 13:49:01 +08:00
Him188
ceb689066e Introduce RestrictedScope for further resolution for IDE plugin 2020-09-19 13:48:23 +08:00
Him188
3fa7c9e128 Support ILLEGAL_COMMAND_NAME, ILLEGAL_PERMISSION_NAME, ILLEGAL_PERMISSION_ID, ILLEGAL_PERMISSION_NAMESPACE 2020-09-19 00:22:38 +08:00
Him188
78ebdf038d Extract AbstractCommand 2020-09-19 00:02:36 +08:00
Him188
4c0daefd67 Replace with static import 2020-09-18 23:50:57 +08:00
Him188
b0e082000c Introduce ResolveContext for permission and command 2020-09-18 23:50:02 +08:00
Him188
16598ee8ec Fix docs 2020-09-18 23:33:08 +08:00
Him188
ca40a292cf Add serializersModule 2020-09-18 23:30:40 +08:00
Him188
f40dd189f2 Fix commands 2020-09-18 23:26:16 +08:00
Him188
5a34d58975 Check command names on init 2020-09-18 23:15:29 +08:00
Him188
8b5c6dfa27 Fix returnType and add JvmBlockingBridge for ConsoleCommandSender.sendMessage 2020-09-18 23:03:21 +08:00
Him188
7762ea2f65 Separate Command.names into Command.primaryName and Command.secondaryNames such that primaryName is compulsory while secondaryNames are optional. 2020-09-18 22:55:19 +08:00
Him188
899c6266dd Improve docs 2020-09-18 21:21:06 +08:00
Him188
8654172872 Remove redundant @JvmDefault 2020-09-18 21:10:38 +08:00
Him188
f2d8b1620e API stabilization for PluginData:
Add warnings for PluginConfig
2020-09-18 21:10:11 +08:00
Him188
da68027b7c API stabilization for PluginData:
Enforce explicit saveName on init
2020-09-18 20:53:08 +08:00
Him188
2fe2d2a681 API stabilization for PluginData:
Move members valueNodes, ValueNode, track from PluginData to AbstractPluginData;
Move findBackingFieldValue, findBackingFieldValueNode from PluginData.kt to AbstractPluginData.kt;
Mark unstable APIs with `@ConsoleExperimentalApi`
2020-09-18 20:35:36 +08:00
Him188
53890bcb5d API stabilization: move provideDelegate from PluginData to AbstractPluginData 2020-09-18 20:19:39 +08:00
Him188
179c89b48f Fix Pair and Triple values 2020-09-18 20:06:03 +08:00
Him188
cd86878307 Merge remote-tracking branch 'origin/master' 2020-09-18 20:01:10 +08:00
Him188
7244cb76c4 Introduce inspection NOT_CONSTRUCTABLE_TYPE for PluginData.value 2020-09-18 15:36:03 +08:00
Karlatemp
8fe2506e75
Terminal (#179)
* Rename ConsolePure to ConsoleTerminal

* Fix the way to close console with Ctrl+C

* Fix windows pipeline error. Fix EndOfFileException

* Add ConsoleExperimentalApi

* Collect imports

* Review

- Change old CLI main deprecation level to ERROR
- Update documents
- Update tasks from pure to terminal

* Fix error in closing console.

* Fix terminal closing and Ctrl+C closing.

* Add console shut-downing status

* Don't invokeOnCompletion when console shut-downing

* Fix Input interrupt

* Ensure active unless console is shut downing

* Change MiraiConsole.isShutDowning to `!job.isActive`

* Code Review

- Update Message on MiraiConsolePureLoader.kt
- Change MiraiConsole.isShutDowning to MiraiConsole.isActive
- Change MiraiConsole.shutdown to ConsoleInternalApi

* run catching

* Fix console input

* Update shutdown

* Fix module

* Revert 5199395

* Typo
2020-09-18 12:43:57 +08:00