mirror of
https://github.com/mamoe/mirai.git
synced 2026-09-03 21:23:00 +08:00
Add compatibility tests
This commit is contained in:
47
java-compatibility-validator/build.gradle.kts
Normal file
47
java-compatibility-validator/build.gradle.kts
Normal file
@@ -0,0 +1,47 @@
|
||||
@file:Suppress("UNUSED_VARIABLE")
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
java
|
||||
}
|
||||
|
||||
description = "Java compatibility validator for mirai-core and mirai-core-qqandroid"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
sourceSets {
|
||||
all {
|
||||
languageSettings.enableLanguageFeature("InlineClasses")
|
||||
languageSettings.useExperimentalAnnotation("kotlin.Experimental")
|
||||
}
|
||||
|
||||
main {
|
||||
dependencies {
|
||||
api(kotlin("stdlib"))
|
||||
api(project(":mirai-core-qqandroid"))
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
dependencies {
|
||||
api(kotlin("stdlib"))
|
||||
api(kotlin("test"))
|
||||
api(kotlin("test-junit"))
|
||||
api(project(":mirai-core-qqandroid"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package test;
|
||||
|
||||
import net.mamoe.mirai.Bot;
|
||||
import net.mamoe.mirai.contact.Contact;
|
||||
import net.mamoe.mirai.contact.QQ;
|
||||
|
||||
/*
|
||||
* Copyright 2020 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/master/LICENSE
|
||||
*/
|
||||
public class MPPCompatibilityTest {
|
||||
public static void main(String[] args) {
|
||||
final QQ next = Bot.getInstances().get(0).getFriends().iterator().next();
|
||||
((Contact) next).sendMessage("");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user