-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle.kts
138 lines (126 loc) · 3.56 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import com.google.protobuf.gradle.*
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("com.google.protobuf:protobuf-gradle-plugin:0.8.13")
}
}
plugins {
id("org.springframework.boot") version "2.4.13"
id("io.spring.dependency-management") version "1.0.10.RELEASE"
id("com.google.protobuf") version "0.8.13"
kotlin("plugin.spring") version "1.4.0"
`maven-publish`
java
signing
kotlin("jvm") version "1.4.10"
kotlin("kapt") version "1.4.10"
}
group = "net.lz1998"
version = "0.0.39"
repositories {
mavenCentral()
}
dependencies {
api("com.google.protobuf:protobuf-javalite:3.8.0")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8")
api("org.springframework.boot:spring-boot-starter-websocket")
kapt("org.springframework.boot:spring-boot-configuration-processor")
api(kotlin("stdlib-jdk8"))
testImplementation("junit", "junit", "4.12")
}
protobuf {
generatedFilesBaseDir = "$projectDir/src"
println(generatedFilesBaseDir)
protoc {
// You still need protoc like in the non-Android case
artifact = "com.google.protobuf:protoc:3.8.0"
}
generateProtoTasks {
all().forEach {
it.builtins {
remove("java")
id("java") {
option("lite")
}
}
}
}
}
sourceSets {
main {
proto {
// 除了默认的'src/main/proto'目录新增proto文件的方法
srcDir("onebot_idl")
include("**/*.proto")
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
jar {
enabled = true
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("pbbot-spring-boot-starter")
description.set("A spring boot starter for qq bot development.")
url.set("https://cq.lz1998.net")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("lz1998")
name.set("lizheng")
email.set("[email protected]")
}
developer {
id.set("life")
name.set("wangguogang")
email.set("[email protected]")
}
}
scm {
url.set("scm:git:[email protected]:lz1998/spring-cq.git")
developerConnection.set("scm:git:[email protected]:lz1998/spring-cq.git")
connection.set("scm:git:[email protected]:lz1998/spring-cq.git")
}
}
}
}
repositories {
maven {
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = properties["sonatype_username"].toString()
password = properties["sonatype_password"].toString()
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications["maven"])
}