forked from cnlimiter/onebot-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
107 lines (85 loc) · 2.99 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
plugins {
id 'java'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
version = project.client_version
group = project.maven_group
def targetJavaVersion = 8
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
it.options.release = targetJavaVersion
}
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
archivesBaseName = project.archives_base_name
}
configurations {
shadow
implementation.extendsFrom shadow
}
repositories {
maven { url = "https://repo.papermc.io/repository/maven-public/" }
maven { url = "https://maven.nova-committee.cn/releases"}
mavenCentral()
}
dependencies {
compileOnly("org.projectlombok:lombok:1.18.24")
compileOnly("com.google.code.gson:gson:2.8.9")
compileOnly("org.jetbrains:annotations:24.0.1")
compileOnly("org.apache.logging.log4j:log4j-api:2.19.0")
compileOnly("org.apache.logging.log4j:log4j-core:2.19.0")
testImplementation("org.apache.logging.log4j:log4j-core:2.19.0")
testImplementation("com.google.code.gson:gson:2.8.9")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.mockito:mockito-core:5.4.0")
testImplementation("org.projectlombok:lombok:1.18.24")
shadow "net.kyori:event-api:${eventbus_version}"
shadow "net.kyori:event-method:${eventbus_version}"
shadow "cn.evole.bot:OneBot-SDK:${sdk_version}"
shadow "org.java-websocket:Java-WebSocket:${websocket_version}"
annotationProcessor("org.projectlombok:lombok:1.18.24")
}
artifacts {
archives jar
archives shadowJar
}
shadowJar {
project.configurations.shadow.setTransitive(false);
configurations = [project.configurations.shadow]
relocate 'org.java_websocket', "cn.evole.onebot.sdk.websocket"
relocate 'net.kyori.event', "cn.evole.onebot.eventbus"
dependencies {
exclude(dependency('org.slf4j:slf4j-api:2.0.6'))
}
archiveClassifier = ""
archiveBaseName.set(project.archives_base_name)
archiveVersion.set(project.client_version)
}
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
version = "${project.client_version}"
artifactId = "${project.archives_base_name}"
groupId = "${project.maven_group}"
}
}
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')
}
}
}
}
}