Skip to content

Commit

Permalink
Merge branch 'dev' into short-video-message
Browse files Browse the repository at this point in the history
# Conflicts:
#	mirai-core-api/src/commonMain/kotlin/contact/Contact.kt
#	mirai-core-api/src/jvmBaseMain/kotlin/contact/Contact.kt
#	mirai-core-api/src/jvmBaseMain/kotlin/utils/ExternalResource.kt
  • Loading branch information
StageGuard committed Aug 16, 2023
2 parents 12a40ef + 5ef291f commit 2f93f36
Show file tree
Hide file tree
Showing 114 changed files with 3,029 additions and 3,874 deletions.
79 changes: 5 additions & 74 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,80 +97,11 @@ jobs:

# Upload

- name: Upload mirai-core-utils
uses: actions/upload-artifact@v3
with:
name: mirai-core-utils
path: mirai-core-utils/build/libs

- name: Upload mirai-core-api
uses: actions/upload-artifact@v3
with:
name: mirai-core-api
path: mirai-core-api/build/libs

- name: Upload mirai-core
uses: actions/upload-artifact@v3
with:
name: mirai-core
path: mirai-core/build/libs

- name: Upload mirai-core-all
uses: actions/upload-artifact@v3
with:
name: mirai-core-all
path: mirai-core-all/build/libs

- name: Upload mirai-console
uses: actions/upload-artifact@v3
with:
name: mirai-console
path: mirai-console/backend/mirai-console/build/libs

- name: Upload mirai-console-terminal
uses: actions/upload-artifact@v3
with:
name: mirai-console-terminal
path: mirai-console/frontend/mirai-console-terminal/build/libs

- name: Upload mirai-console-compiler-annotations
uses: actions/upload-artifact@v3
with:
name: mirai-console-compiler-annotations
path: mirai-console/tools/mirai-console-compiler-annotations/build/libs

- name: Upload mirai-console-compiler-common
uses: actions/upload-artifact@v3
with:
name: mirai-console-compiler-common
path: mirai-console/tools/mirai-console-compiler-common/build/libs

- name: Upload mirai-console-intellij
uses: actions/upload-artifact@v3
with:
name: mirai-console-intellij
path: mirai-console/tools/intelli-plugin/build/distribution

- name: Upload mirai-logging-log4j2
uses: actions/upload-artifact@v3
with:
name: mirai-logging-log4j2
path: logging/mirai-logging-log4j2/build/libs

- name: Upload mirai-logging-slf4j
uses: actions/upload-artifact@v3
with:
name: mirai-logging-slf4j
path: logging/mirai-logging-slf4j/build/libs

- name: Upload mirai-logging-slf4j-logback
uses: actions/upload-artifact@v3
with:
name: mirai-logging-slf4j-logback
path: logging/mirai-logging-slf4j-logback/build/libs
- name: Publish MavenLocal
run: ./gradlew publishToMavenLocal ${{ env.gradleArgs }}

- name: Upload mirai-logging-slf4j-simple
- name: Upload MavenLocal
uses: actions/upload-artifact@v3
with:
name: mirai-logging-slf4j-simple
path: logging/mirai-logging-slf4j-simple/build/libs
name: maven-cache
path: ~/.m2
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ internal fun main() {
error("Don't launch IntegrationTestBootstrap directly. See /test/MiraiConsoleIntegrationTestBootstrap.kt")
}
}
System.setProperty("mirai.console.skip-end-user-readme", "")
// @context: env.testunit = true
// @context: env.inJUnitProcess = false
// @context: env.exitProcessSafety = true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright 2019-2023 Mamoe Technologies and contributors.
#
# 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
# Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
#
# https://github.com/mamoe/mirai/blob/dev/LICENSE
#

net.mamoe.console.itest.plugincandependsonmiraiconsole.PluginCanDependsOnMiraiConsole
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright 2019-2023 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/

package net.mamoe.console.itest.plugincandependsonmiraiconsole

import net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription
import net.mamoe.mirai.console.plugin.jvm.KotlinPlugin

internal object PluginCanDependsOnMiraiConsole : KotlinPlugin(
JvmPluginDescription("net.mamoe.tester.plugin-can-depends-mirai-console", "1.0.0") {
dependsOn("net.mamoe.mirai-console")
}
) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
net.mamoe.consoleit.plugin-with-yml:plugin-library:0.0.0
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
/*
* Copyright 2019-2022 Mamoe Technologies and contributors.
* Copyright 2019-2023 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/

package net.mamoe.mirai.internal.utils
package net.mamoe.console.itest.pluginwithpluginyml.library

internal expect object MarkerManager {
fun getMarker(name: String): Marker
public object PluginLibrary {
@JvmStatic
public fun ok() {
println("Plugin with plugin.yml using libraries under clinit ok")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
net.mamoe.consoleit.plugin-with-yml:plugin-library:0.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright 2019-2023 Mamoe Technologies and contributors.
#
# 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
# Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
#
# https://github.com/mamoe/mirai/blob/dev/LICENSE
#

net.mamoe.console.itest.pluginwithpluginyml.clinit.PluginWithPluginYmlClinitTest
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id: net.mamoe.console.itest.plugin-with-yml-can-use-library-while-clinit
version: 0.0.0

dependencies:
- net.mamoe.console.itest.plugin-with-yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2019-2023 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/

package net.mamoe.console.itest.pluginwithpluginyml.clinit

import net.mamoe.mirai.console.plugin.jvm.KotlinPlugin

internal class PluginWithPluginYmlClinitTest : KotlinPlugin() {

companion object {
init {
// this is <clinit>

Thread.dumpStack()
Class.forName("net.mamoe.console.itest.pluginwithpluginyml.library.PluginLibrary")
.getMethod("ok").invoke(null)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright 2019-2023 Mamoe Technologies and contributors.
#
# 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
# Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
#
# https://github.com/mamoe/mirai/blob/dev/LICENSE
#

net.mamoe.console.itest.pluginwithpluginyml.PluginWithPluginYml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id: net.mamoe.console.itest.plugin-with-yml
version: 0.0.0

dependencies:
- net.mamoe.console.itest.serviceloader
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package net.mamoe.console.itest.pluginwithpluginyml

import net.mamoe.mirai.console.plugin.PluginManager
import net.mamoe.mirai.console.plugin.PluginManager.INSTANCE.description
import net.mamoe.mirai.console.plugin.jvm.KotlinPlugin
import kotlin.test.assertTrue

/*
* Copyright 2019-2023 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/

internal object PluginWithPluginYml : KotlinPlugin() {
override fun onEnable() {
println(description)
println(description.id)
val pluginId = description.id

assertTrue {
PluginManager.plugins.first { it.description.id == pluginId } === PluginWithPluginYml
}
}
}
4 changes: 4 additions & 0 deletions mirai-console/backend/mirai-console/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ tasks {
}
}

tasks.withType<Test> {
this.jvmArgs("-Dmirai.console.skip-end-user-readme")
}

tasks.getByName("compileKotlin").dependsOn(
DependencyDumper.registerDumpTaskKtSrc(
project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1287,21 +1287,50 @@ public final class net/mamoe/mirai/console/data/java/JavaAutoSavePluginData$Comp
public final fun createKType (Ljava/lang/Class;[Lkotlin/reflect/KType;)Lkotlin/reflect/KType;
}

public final class net/mamoe/mirai/console/enduserreadme/EndUserReadme {
public static final field Companion Lnet/mamoe/mirai/console/enduserreadme/EndUserReadme$Companion;
public static final field DELAY Ljava/lang/String;
public static final field PAUSE Ljava/lang/String;
public fun <init> ()V
public final fun put (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public final fun putAll (Ljava/lang/String;)V
}

public final class net/mamoe/mirai/console/enduserreadme/EndUserReadme$Companion {
}

public final class net/mamoe/mirai/console/enduserreadme/EndUserReadme$Render {
public fun <init> ()V
public final fun delay ()V
public final fun delay (I)V
public final fun msg (Ljava/lang/String;)V
public final fun pause ()V
public final fun plusAssign (Ljava/lang/String;)V
public final fun render ()Ljava/lang/String;
public final fun unaryPlus (Ljava/lang/String;)V
}

public abstract class net/mamoe/mirai/console/events/AutoLoginEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/console/events/ConsoleEvent, net/mamoe/mirai/event/events/BotEvent {
}

public final class net/mamoe/mirai/console/events/AutoLoginEvent$Failure : net/mamoe/mirai/console/events/AutoLoginEvent {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public final fun getCause ()Ljava/lang/Throwable;
public fun toString ()Ljava/lang/String;
}

public final class net/mamoe/mirai/console/events/AutoLoginEvent$Success : net/mamoe/mirai/console/events/AutoLoginEvent {
public fun getBot ()Lnet/mamoe/mirai/Bot;
public fun toString ()Ljava/lang/String;
}

public abstract interface class net/mamoe/mirai/console/events/ConsoleEvent : net/mamoe/mirai/event/Event {
}

public final class net/mamoe/mirai/console/events/EndUserReadmeInitializeEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/console/events/ConsoleEvent {
public final fun getReadme ()Lnet/mamoe/mirai/console/enduserreadme/EndUserReadme;
}

public final class net/mamoe/mirai/console/events/StartupEvent : net/mamoe/mirai/event/AbstractEvent, net/mamoe/mirai/console/events/ConsoleEvent {
public final fun getTimestamp ()J
}
Expand Down Expand Up @@ -1755,6 +1784,7 @@ public abstract interface class net/mamoe/mirai/console/permission/PermitteeId {
public static fun getAllParentsWithSelf (Lnet/mamoe/mirai/console/permission/PermitteeId;)Lkotlin/sequences/Sequence;
public abstract fun getDirectParents ()[Lnet/mamoe/mirai/console/permission/PermitteeId;
public static fun hasChild (Lnet/mamoe/mirai/console/permission/PermitteeId;Lnet/mamoe/mirai/console/permission/PermitteeId;)Z
public static fun isChildOf (Lnet/mamoe/mirai/console/permission/PermitteeId;Lnet/mamoe/mirai/console/permission/PermitteeId;)Z
}

public final class net/mamoe/mirai/console/permission/PermitteeId$Companion {
Expand All @@ -1767,6 +1797,11 @@ public final class net/mamoe/mirai/console/permission/PermitteeId$Companion {
public final synthetic fun getPermitteeId (Lnet/mamoe/mirai/contact/User;)Lnet/mamoe/mirai/console/permission/AbstractPermitteeId$ExactUser;
public final synthetic fun getPermitteeIdOnTemp (Lnet/mamoe/mirai/contact/Member;)Lnet/mamoe/mirai/console/permission/AbstractPermitteeId$ExactGroupTemp;
public final fun hasChild (Lnet/mamoe/mirai/console/permission/PermitteeId;Lnet/mamoe/mirai/console/permission/PermitteeId;)Z
public final fun isChildOf (Lnet/mamoe/mirai/console/permission/PermitteeId;Lnet/mamoe/mirai/console/permission/PermitteeId;)Z
}

public abstract interface class net/mamoe/mirai/console/plugin/NotYetLoadedPlugin : net/mamoe/mirai/console/plugin/Plugin {
public abstract fun resolve ()Lnet/mamoe/mirai/console/plugin/Plugin;
}

public abstract interface class net/mamoe/mirai/console/plugin/Plugin : net/mamoe/mirai/console/command/CommandOwner {
Expand Down Expand Up @@ -1957,8 +1992,12 @@ public abstract class net/mamoe/mirai/console/plugin/jvm/AbstractJvmPlugin : net
public fun <init> ()V
public fun <init> (Lkotlin/coroutines/CoroutineContext;)V
public synthetic fun <init> (Lkotlin/coroutines/CoroutineContext;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;)V
public fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;Lkotlin/coroutines/CoroutineContext;)V
public synthetic fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;Lkotlin/coroutines/CoroutineContext;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getAutoSaveIntervalMillis ()Lkotlin/ranges/LongRange;
public final fun getDataHolderName ()Ljava/lang/String;
public final fun getDescription ()Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;
protected final fun getJvmPluginClasspath ()Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginClasspath;
public final fun getLoader ()Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginLoader;
public synthetic fun getLoader ()Lnet/mamoe/mirai/console/plugin/loader/PluginLoader;
Expand All @@ -1979,10 +2018,12 @@ public final class net/mamoe/mirai/console/plugin/jvm/AbstractJvmPluginKt {
}

public abstract class net/mamoe/mirai/console/plugin/jvm/JavaPlugin : net/mamoe/mirai/console/plugin/jvm/AbstractJvmPlugin, net/mamoe/mirai/console/plugin/jvm/JvmPlugin {
public fun <init> ()V
public fun <init> (Lkotlin/coroutines/CoroutineContext;)V
public synthetic fun <init> (Lkotlin/coroutines/CoroutineContext;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;)V
public fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;Lkotlin/coroutines/CoroutineContext;)V
public synthetic fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;Lkotlin/coroutines/CoroutineContext;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getDescription ()Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;
public final fun getScheduler ()Lnet/mamoe/mirai/console/plugin/jvm/JavaPluginScheduler;
}

Expand Down Expand Up @@ -2098,10 +2139,12 @@ public final class net/mamoe/mirai/console/plugin/jvm/JvmPluginLoader$BuiltIn :
}

public abstract class net/mamoe/mirai/console/plugin/jvm/KotlinPlugin : net/mamoe/mirai/console/plugin/jvm/AbstractJvmPlugin, net/mamoe/mirai/console/plugin/jvm/JvmPlugin {
public fun <init> ()V
public fun <init> (Lkotlin/coroutines/CoroutineContext;)V
public synthetic fun <init> (Lkotlin/coroutines/CoroutineContext;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;)V
public fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;Lkotlin/coroutines/CoroutineContext;)V
public synthetic fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;Lkotlin/coroutines/CoroutineContext;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getDescription ()Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;
}

public abstract class net/mamoe/mirai/console/plugin/loader/AbstractFilePluginLoader : net/mamoe/mirai/console/plugin/loader/FilePluginLoader {
Expand Down
Loading

0 comments on commit 2f93f36

Please sign in to comment.