2020-02-27 13:18:33 +08:00
|
|
|
import java.util.*
|
2020-03-29 15:58:35 +08:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
2020-02-27 13:18:33 +08:00
|
|
|
|
|
|
|
plugins {
|
2020-03-24 18:02:19 +08:00
|
|
|
kotlin("jvm")
|
|
|
|
kotlin("plugin.serialization")
|
2020-02-27 13:18:33 +08:00
|
|
|
id("java")
|
|
|
|
`maven-publish`
|
|
|
|
id("com.jfrog.bintray")
|
|
|
|
}
|
|
|
|
|
2020-03-06 17:39:53 +08:00
|
|
|
apply(plugin = "com.github.johnrengelman.shadow")
|
|
|
|
|
2020-03-05 09:45:54 +08:00
|
|
|
kotlin {
|
|
|
|
sourceSets {
|
|
|
|
all {
|
|
|
|
languageSettings.enableLanguageFeature("InlineClasses")
|
|
|
|
|
|
|
|
languageSettings.useExperimentalAnnotation("kotlin.Experimental")
|
|
|
|
languageSettings.useExperimentalAnnotation("kotlin.OptIn")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-27 13:18:33 +08:00
|
|
|
dependencies {
|
2020-03-24 18:02:19 +08:00
|
|
|
compileOnly("net.mamoe:mirai-core-jvm:${Versions.Mirai.core}")
|
|
|
|
compileOnly("net.mamoe:mirai-core-qqandroid-jvm:${Versions.Mirai.core}")
|
2020-02-27 13:18:33 +08:00
|
|
|
|
2020-03-04 22:15:46 +08:00
|
|
|
|
2020-03-28 21:06:47 +08:00
|
|
|
implementation(group = "com.alibaba", name = "fastjson", version = "1.2.62")
|
|
|
|
implementation(group = "org.yaml", name = "snakeyaml", version = "1.25")
|
|
|
|
implementation(group = "com.moandjiezana.toml", name = "toml4j", version = "0.7.2")
|
2020-03-29 15:58:35 +08:00
|
|
|
implementation(kotlin("stdlib-jdk8"))
|
2020-02-27 13:18:33 +08:00
|
|
|
}
|
|
|
|
|
2020-03-05 09:45:54 +08:00
|
|
|
val miraiConsoleVersion: String by project.ext
|
|
|
|
version = miraiConsoleVersion
|
2020-02-27 13:18:33 +08:00
|
|
|
|
|
|
|
description = "Console with plugin support for mirai"
|
|
|
|
bintray {
|
|
|
|
val keyProps = Properties()
|
|
|
|
val keyFile = file("../keys.properties")
|
|
|
|
if (keyFile.exists()) keyFile.inputStream().use { keyProps.load(it) }
|
|
|
|
if (keyFile.exists()) keyFile.inputStream().use { keyProps.load(it) }
|
|
|
|
|
|
|
|
user = keyProps.getProperty("bintrayUser")
|
|
|
|
key = keyProps.getProperty("bintrayKey")
|
|
|
|
setPublications("mavenJava")
|
|
|
|
setConfigurations("archives")
|
|
|
|
|
|
|
|
pkg.apply {
|
|
|
|
repo = "mirai"
|
|
|
|
name = "mirai-console"
|
|
|
|
setLicenses("AGPLv3")
|
|
|
|
publicDownloadNumbers = true
|
|
|
|
vcsUrl = "https://github.com/mamoe/mirai"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Suppress("DEPRECATION")
|
|
|
|
val sourcesJar by tasks.registering(Jar::class) {
|
|
|
|
classifier = "sources"
|
|
|
|
from(sourceSets.main.get().allSource)
|
|
|
|
}
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
/*
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
// change to point to your repo, e.g. http://my.org/repo
|
|
|
|
url = uri("$buildDir/repo")
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
publications {
|
|
|
|
register("mavenJava", MavenPublication::class) {
|
|
|
|
from(components["java"])
|
|
|
|
|
|
|
|
groupId = rootProject.group.toString()
|
|
|
|
artifactId = "mirai-console"
|
2020-03-05 09:45:54 +08:00
|
|
|
version = miraiConsoleVersion
|
2020-02-27 13:18:33 +08:00
|
|
|
|
|
|
|
pom.withXml {
|
|
|
|
val root = asNode()
|
|
|
|
root.appendNode("description", description)
|
|
|
|
root.appendNode("name", project.name)
|
|
|
|
root.appendNode("url", "https://github.com/mamoe/mirai")
|
|
|
|
root.children().last()
|
|
|
|
}
|
|
|
|
|
|
|
|
artifact(sourcesJar.get())
|
|
|
|
}
|
|
|
|
}
|
2020-03-29 15:58:35 +08:00
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven("https://dl.bintray.com/kotlin/kotlin-eap")
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
val compileKotlin: KotlinCompile by tasks
|
|
|
|
compileKotlin.kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
|
|
|
}
|
|
|
|
val compileTestKotlin: KotlinCompile by tasks
|
|
|
|
compileTestKotlin.kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
2020-02-27 13:18:33 +08:00
|
|
|
}
|