-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
122 lines (101 loc) · 3.45 KB
/
build.gradle
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.8.20'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.20'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'net.mamoe.mirai-console' version '2.16.0'
id 'maven-publish'
}
group = project.maven_group
version = project.version
java {
archivesBaseName = 'OneBot-Mirai'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven {
url "https://maven.nova-committee.cn/releases"
}
maven { url "https://repo.mirai.mamoe.net/keep/mcl" }
mavenCentral()
}
dependencies {
implementation("org.java-websocket:Java-WebSocket:1.5.5")
"shadowLink"("org.java-websocket:Java-WebSocket")
implementation("cn.evole.bot:OneBot-SDK:0.2.8")
"shadowLink"("cn.evole.bot:OneBot-SDK")
implementation ("io.github.kongweiguang:KHTTP:0.0.3")
"shadowLink"("io.github.kongweiguang:KHTTP")
implementation("com.google.code.gson:gson:2.10.1")
compileOnly "org.projectlombok:lombok:1.18.24"
annotationProcessor "org.projectlombok:lombok:1.18.24"
annotationProcessor "org.java-websocket:Java-WebSocket:1.5.5"
testImplementation('ch.qos.logback:logback-classic:1.4.12')
testImplementation("org.slf4j:slf4j-simple:2.0.7")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.mockito:mockito-core:5.4.0")
}
artifacts {
archives jar
archives shadowJar
}
mirai {
jvmTarget = JavaVersion.VERSION_17
excludeDependency("org.slf4j", "slf4j-api")
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
options.release.set(17)
}
def resourceTargets = ['plugin.yml']
def replaceProperties = [
name: name, version: version, author: authors, description: description
]
tasks.withType(ProcessResources).configureEach {
inputs.properties replaceProperties
filesMatching(resourceTargets) {
expand replaceProperties
}
}
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
version = "${project.version}"
artifactId = "${project.archives_base_name}"
groupId = "${project.maven_group}"
pom {
name = 'OneBot Mirai'
description = '基于 [OneBot] 标准的 mirai 插件版'
url = 'https://github.com/cnlimiter/onebot-mirai'
licenses {
license {
name = 'AGPLV3'
url = 'https://www.gnu.org/licenses/gpl-3.0.html'
}
}
developers {
developer {
id = 'cnlimiter'
name = 'cnlimiter'
email = '[email protected]'
}
}
}
}
}
repositories {
if (System.getenv('MAVEN_USERNAME') != null && System.getenv('MAVEN_PASSWORD') != null) {
maven {
name 'release'
url = 'https://maven.nova-committee.cn/releases'
credentials {
username System.getenv('MAVEN_USERNAME')
password System.getenv('MAVEN_PASSWORD')
}
}
}
}
}