mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-03 15:10:14 +08:00
Add build.gradle
This commit is contained in:
parent
4f305ebd58
commit
2f7a9cf9d4
@ -7,7 +7,7 @@ import java.net.URL
|
|||||||
import java.util.jar.JarFile
|
import java.util.jar.JarFile
|
||||||
|
|
||||||
|
|
||||||
abstract class PluginBase constructor() {
|
abstract class PluginBase {
|
||||||
val dataFolder by lazy {
|
val dataFolder by lazy {
|
||||||
File(PluginManager.pluginsPath + pluginDescription.name).also { it.mkdir() }
|
File(PluginManager.pluginsPath + pluginDescription.name).also { it.mkdir() }
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ class PluginDescription(
|
|||||||
var basePath = "net.mamoe.mirai.PluginMain"
|
var basePath = "net.mamoe.mirai.PluginMain"
|
||||||
var info = "Unknown"
|
var info = "Unknown"
|
||||||
var version = "1.0.0"
|
var version = "1.0.0"
|
||||||
val depends = mutableListOf<String>();
|
val depends = mutableListOf<String>()
|
||||||
|
|
||||||
content.forEach {
|
content.forEach {
|
||||||
val line = it.trim()
|
val line = it.trim()
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
package net.mamoe.mirai.japt;
|
package net.mamoe.mirai.japt;
|
||||||
|
|
||||||
public interface BlockingBot {
|
public interface BlockingBot {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
0
mirai-plugins/build.gradle
Normal file
0
mirai-plugins/build.gradle
Normal file
43
mirai-plugins/image-sender/build.gradle.kts
Normal file
43
mirai-plugins/image-sender/build.gradle.kts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("jvm")
|
||||||
|
java
|
||||||
|
}
|
||||||
|
|
||||||
|
val kotlinVersion: String by rootProject.ext
|
||||||
|
val atomicFuVersion: String by rootProject.ext
|
||||||
|
val coroutinesVersion: String by rootProject.ext
|
||||||
|
val kotlinXIoVersion: String by rootProject.ext
|
||||||
|
val coroutinesIoVersion: String by rootProject.ext
|
||||||
|
val serializationVersion: String by rootProject.ext
|
||||||
|
|
||||||
|
val klockVersion: String by rootProject.ext
|
||||||
|
val ktorVersion: String by rootProject.ext
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
sourceSets {
|
||||||
|
all {
|
||||||
|
languageSettings.enableLanguageFeature("InlineClasses")
|
||||||
|
languageSettings.useExperimentalAnnotation("kotlin.Experimental")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun kotlinx(id: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$id:$version"
|
||||||
|
|
||||||
|
fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
api(project(":mirai-core"))
|
||||||
|
api(project(":mirai-console"))
|
||||||
|
runtimeOnly(files("../mirai-core/build/classes/kotlin/jvm/main")) // classpath is not added correctly by IDE
|
||||||
|
|
||||||
|
api(kotlin("stdlib", kotlinVersion))
|
||||||
|
api(kotlinx("io-jvm", kotlinXIoVersion))
|
||||||
|
api(kotlinx("io", kotlinXIoVersion))
|
||||||
|
api(kotlinx("coroutines-io", coroutinesIoVersion))
|
||||||
|
api(kotlinx("coroutines-core", coroutinesVersion))
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<JavaCompile>() {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
}
|
@ -43,6 +43,8 @@ include(':mirai-api-http')
|
|||||||
include(':mirai-demos:mirai-demo-1')
|
include(':mirai-demos:mirai-demo-1')
|
||||||
include(':mirai-demos:mirai-demo-gentleman')
|
include(':mirai-demos:mirai-demo-gentleman')
|
||||||
include(':mirai-demos')
|
include(':mirai-demos')
|
||||||
|
include(':mirai-plugins')
|
||||||
|
include(':mirai-plugins:image-sender')
|
||||||
|
|
||||||
def javaVersion = System.getProperty("java.version")
|
def javaVersion = System.getProperty("java.version")
|
||||||
if (javaVersion.substring(0, javaVersion.indexOf(".")).toInteger() >= 11) {
|
if (javaVersion.substring(0, javaVersion.indexOf(".")).toInteger() >= 11) {
|
||||||
@ -53,5 +55,6 @@ if (javaVersion.substring(0, javaVersion.indexOf(".")).toInteger() >= 11) {
|
|||||||
|
|
||||||
project(':mirai-demos:mirai-demo-1').projectDir = file('mirai-demos/mirai-demo-1')
|
project(':mirai-demos:mirai-demo-1').projectDir = file('mirai-demos/mirai-demo-1')
|
||||||
project(':mirai-demos:mirai-demo-gentleman').projectDir = file('mirai-demos/mirai-demo-gentleman')
|
project(':mirai-demos:mirai-demo-gentleman').projectDir = file('mirai-demos/mirai-demo-gentleman')
|
||||||
|
project(':mirai-plugins:image-sender').projectDir = file('mirai-plugins/image-sender')
|
||||||
|
|
||||||
enableFeaturePreview('GRADLE_METADATA')
|
enableFeaturePreview('GRADLE_METADATA')
|
Loading…
Reference in New Issue
Block a user