Add module mirai-console-wrapper

This commit is contained in:
Him188 2020-03-05 17:29:12 +08:00
parent 954cd45970
commit f1710b0bed
4 changed files with 69 additions and 0 deletions

View File

@ -3,6 +3,7 @@ kotlin.code.style=official
# config
miraiVersion=0.24.1
miraiConsoleVersion=0.3.1
miraiConsoleWrapperVersion=1.0.0
kotlin.incremental.multiplatform=true
kotlin.parallel.tasks.in.project=true
# kotlin

View File

@ -0,0 +1,51 @@
plugins {
id("kotlin")
}
apply(plugin = "com.github.johnrengelman.shadow")
val kotlinVersion: String by rootProject.ext
val coroutinesVersion: String by rootProject.ext
val coroutinesIoVersion: String by rootProject.ext
val ktorVersion: String by rootProject.ext
fun kotlinx(id: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$id:$version"
fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
manifest {
attributes["Main-Class"] = "net.mamoe.mirai.console.wrapper.WrapperMain"
}
}
val miraiVersion: String by rootProject.ext
kotlin {
sourceSets {
all {
languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.useExperimentalAnnotation("kotlin.Experimental")
languageSettings.useExperimentalAnnotation("kotlin.OptIn")
}
}
}
dependencies {
compileOnly("net.mamoe:mirai-core-jvm:$miraiVersion")
api(kotlin("stdlib", kotlinVersion))
api(kotlin("reflect", kotlinVersion))
api(kotlinx("coroutines-core", coroutinesVersion))
api(ktor("client-core-jvm", ktorVersion))
api(ktor("client-cio", ktorVersion))
}
val miraiConsoleWrapperVersion: String by project.ext
version = miraiConsoleWrapperVersion
description = "Console with plugin support for mirai"

View File

@ -0,0 +1,16 @@
/*
* 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
*/
package net.mamoe.mirai.console.wrapper
object WrapperMain {
@JvmStatic
fun main(args: Array<String>) {
}
}

View File

@ -23,6 +23,7 @@ rootProject.name = 'mirai-console'
include(':mirai-console')
include(':mirai-console-terminal')
include(':mirai-console-wrapper')
try{
def javaVersion = System.getProperty("java.version")