Rearrange frontend modules, extract mirai-console-pure to a frontend module.

This commit is contained in:
Him188 2020-05-14 08:18:03 +08:00
parent ec1d24ebe7
commit 4521cfbc9e
72 changed files with 73 additions and 20 deletions

View File

@ -1,6 +1,5 @@
package net.mamoe.mirai.console.events;
import kotlinx.coroutines.GlobalScope;
import net.mamoe.mirai.console.plugins.PluginBase;
import net.mamoe.mirai.event.Event;
import net.mamoe.mirai.event.Listener;

View File

@ -9,15 +9,9 @@
package net.mamoe.mirai.console.events;
import kotlinx.coroutines.GlobalScope;
import net.mamoe.mirai.event.Event;
import net.mamoe.mirai.event.Listener;
import net.mamoe.mirai.event.ListeningStatus;
import org.jetbrains.annotations.NotNull;
import java.util.function.Consumer;
import java.util.function.Function;
/**
* 事件处理
*/

View File

@ -9,7 +9,7 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package net.mamoe.mirai.console.events;
package net.mamoe.mirai.console.events
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.runBlocking

View File

@ -14,6 +14,8 @@ object Versions {
const val core = "1.0-RC2-1"
const val console = "0.5.1"
const val consoleGraphical = "0.0.7"
const val consoleTerminal = "0.1.0"
const val consolePure = "0.1.0"
}
object Kotlin {

View File

@ -8,8 +8,6 @@
*/
package net.mamoe.mirai.console.graphical
import net.mamoe.mirai.console.pure.MiraiConsoleUIPure
import net.mamoe.mirai.console.MiraiConsole
import tornadofx.launch
import kotlin.concurrent.thread

View File

@ -5,7 +5,10 @@ import javafx.scene.effect.BlurType
import javafx.scene.effect.DropShadow
import javafx.scene.paint.Color
import javafx.scene.text.FontWeight
import tornadofx.*
import tornadofx.box
import tornadofx.c
import tornadofx.csselement
import tornadofx.px
class LoginViewStyleSheet : BaseStyleSheet() {

View File

@ -1,9 +1,11 @@
package net.mamoe.mirai.console.graphical.stylesheet
import javafx.scene.Cursor
import javafx.scene.paint.Color
import javafx.scene.text.FontWeight
import tornadofx.*
import tornadofx.box
import tornadofx.c
import tornadofx.cssclass
import tornadofx.px
class PrimaryStyleSheet : BaseStyleSheet() {
companion object {

View File

@ -6,7 +6,6 @@ import javafx.beans.value.ObservableValue
import javafx.collections.ObservableList
import javafx.event.EventTarget
import javafx.scene.Node
import javafx.scene.control.Button
import javafx.scene.control.ListView
import tornadofx.SortedFilteredList
import tornadofx.attachTo

View File

@ -3,7 +3,6 @@ package net.mamoe.mirai.console.graphical.view
import com.jfoenix.controls.JFXTreeTableColumn
import javafx.scene.control.TreeTableCell
import net.mamoe.mirai.console.graphical.controller.MiraiGraphicalUIController
import net.mamoe.mirai.console.graphical.event.ReloadEvent
import net.mamoe.mirai.console.graphical.model.PluginModel
import net.mamoe.mirai.console.graphical.stylesheet.PluginViewStyleSheet
import net.mamoe.mirai.console.graphical.util.jfxButton

View File

@ -3,7 +3,6 @@ package net.mamoe.mirai.console.graphical.view
import com.jfoenix.controls.JFXButton
import com.jfoenix.controls.JFXListCell
import javafx.collections.ObservableList
import javafx.geometry.Insets
import javafx.geometry.Pos
import javafx.scene.control.Alert
import javafx.scene.control.ButtonType
@ -18,11 +17,7 @@ import kotlinx.coroutines.runBlocking
import net.mamoe.mirai.console.graphical.controller.MiraiGraphicalUIController
import net.mamoe.mirai.console.graphical.model.BotModel
import net.mamoe.mirai.console.graphical.util.*
import net.mamoe.mirai.console.graphical.util.jfxButton
import net.mamoe.mirai.console.graphical.util.jfxListView
import net.mamoe.mirai.console.graphical.util.jfxTabPane
import tornadofx.*
import tornadofx.Stylesheet.Companion.contextMenu
class PrimaryView : View() {

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,54 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("java")
`maven-publish`
id("com.jfrog.bintray")
}
apply(plugin = "com.github.johnrengelman.shadow")
kotlin {
sourceSets {
all {
languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.useExperimentalAnnotation("kotlin.Experimental")
languageSettings.useExperimentalAnnotation("kotlin.OptIn")
languageSettings.progressiveMode = true
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.utils.MiraiInternalAPI")
languageSettings.useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
languageSettings.useExperimentalAnnotation("kotlin.experimental.ExperimentalTypeInference")
languageSettings.useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
}
}
}
dependencies {
compileOnly(project(":mirai-console"))
compileOnly(kotlin("stdlib")) // embedded by core
testApi("net.mamoe:mirai-core-qqandroid:${Versions.Mirai.core}")
testApi(project(":mirai-console"))
}
version = Versions.Mirai.consolePure
description = "Console Pure CLI frontend for mirai"
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType(JavaCompile::class.java) {
options.encoding = "UTF8"
}

View File

@ -24,7 +24,14 @@ pluginManagement {
rootProject.name = 'mirai-console'
include(':mirai-console')
project(':mirai-console').dir = file("backend/mirai-console")
include(':mirai-console-pure')
project(':mirai-console-pure').dir = file("frontend/mirai-console-pure")
include(':mirai-console-terminal')
project(':mirai-console-terminal').dir = file("frontend/mirai-console-terminal")
try{
def javaVersion = System.getProperty("java.version")
@ -43,6 +50,7 @@ try{
}
if (javaVersionNum >= 9) {
include(':mirai-console-graphical')
project(':mirai-console-graphical').dir = file("frontend/mirai-console-graphical")
} else {
println("jdk版本为 "+ javaVersionNum)
println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 请使用JDK 9以上版本引入模块 `:mirai-console-graphical`\n")