mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-06 01:52:27 +08:00
Add compatibility tests
This commit is contained in:
parent
4b05cb45d1
commit
15527b56d8
@ -23,8 +23,7 @@ kotlin {
|
||||
dependencies {
|
||||
api(kotlin("stdlib"))
|
||||
runtimeOnly(project(":mirai-core-qqandroid"))
|
||||
compileOnly("net.mamoe:mirai-core-qqandroid-jvm:0.33.0")
|
||||
api(kotlinx("coroutines-core", Versions.Kotlin.coroutines))
|
||||
compileOnly("net.mamoe:mirai-core-qqandroid:0.38.0")
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,8 +33,7 @@ kotlin {
|
||||
api(kotlin("test"))
|
||||
api(kotlin("test-junit"))
|
||||
runtimeOnly(project(":mirai-core-qqandroid"))
|
||||
compileOnly("net.mamoe:mirai-core-qqandroid-jvm:0.33.0")
|
||||
api(kotlinx("coroutines-core", Versions.Kotlin.coroutines))
|
||||
compileOnly("net.mamoe:mirai-core-qqandroid:0.38.0")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
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("");
|
||||
}
|
||||
}
|
@ -24,6 +24,7 @@ rootProject.name = 'mirai'
|
||||
include(':mirai-core')
|
||||
include(':mirai-core-qqandroid')
|
||||
//include(':compatibility-validator') // THIS WILL CAUSE A DEPENDENCY RESOLUTION BUG
|
||||
//include(':java-compatibility-validator')
|
||||
|
||||
// include(':mirai-api-http')
|
||||
enableFeaturePreview('GRADLE_METADATA')
|
Loading…
Reference in New Issue
Block a user