-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
89 lines (71 loc) · 2.16 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
plugins {
id("me.him188.maven-central-publish") version "1.0.0-dev-3"
val kotlinVersion = "1.6.0"
kotlin("jvm") version kotlinVersion
kotlin("plugin.serialization") version "1.6.20-RC"
id("net.mamoe.mirai-console") version "2.11.0-M1"
}
group = "org.itxtech"
version = "1.0.0"
description = "The Websocket API Server for Mirai Console"
kotlin {
sourceSets {
all {
languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.optIn("kotlin.Experimental")
}
}
}
repositories {
maven("https://maven.aliyun.com/repository/public")
mavenCentral()
}
dependencies {
// External Dependencies
compileOnly("net.mamoe:mirai-console-terminal:2.11.0-M1")
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2")
// Embedded Dependencies
implementation("io.ktor:ktor-websockets:1.6.8")
implementation("io.ktor:ktor-server-netty:1.6.8")
implementation("io.ktor:ktor-server-core:1.6.8")
}
tasks.create<Jar>("fatJar") {
archiveClassifier.set("all")
dependsOn("jar")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveFileName.set("soyuz-${project.version}-all.jar")
manifest {
attributes["Name"] = "iTXTech Soyuz"
attributes["Revision"] = Runtime.getRuntime().exec("git rev-parse --short HEAD")
.inputStream.bufferedReader().readText().trim()
}
val list = ArrayList<Any>()
configurations.compileClasspath.get().copyRecursive().forEach { file ->
arrayOf("ktor-websockets", "ktor-server").forEach {
if (file.absolutePath.contains(it)) {
list.add(zipTree(file))
}
}
}
from(list, sourceSets.main.get().output)
}
tasks {
"assemble" {
dependsOn("fatJar")
}
}
mavenCentralPublish {
singleDevGithubProject("iTXTech", "soyuz")
licenseAGplV3()
useCentralS01()
publication {
artifacts.artifact(tasks.getByName("fatJar"))
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
tasks.withType<JavaCompile> {
sourceCompatibility = "11"
targetCompatibility = "11"
}