-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
107 lines (90 loc) · 2.42 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
import com.google.protobuf.gradle.*
plugins {
`java-library`
`maven-publish`
// gRPC
id("com.google.protobuf") version "0.9.4"
}
group = "dev.emortal.api.agonessdk"
version = "1.0-SNAPSHOT"
val grpcVersion = "1.66.0"
repositories {
mavenCentral()
}
dependencies {
// gRPC
api("io.grpc:grpc-protobuf:$grpcVersion")
api("io.grpc:grpc-stub:$grpcVersion")
api("io.grpc:grpc-netty:$grpcVersion")
// compileOnly("jakarta.annotation:jakarta.annotation-api:3.0.0")
compileOnly("javax.annotation:javax.annotation-api:1.3.2")
implementation("org.slf4j:slf4j-api:2.0.16")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.2")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.3"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
}
generateProtoTasks {
all().forEach {
it.plugins {
id("grpc") {}
}
}
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
tasks {
test {
useJUnitPlatform()
}
}
publishing {
repositories {
maven {
name = "development"
url = uri("https://repo.emortal.dev/snapshots")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_SECRET")
}
}
maven {
name = "release"
url = uri("https://repo.emortal.dev/releases")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_SECRET")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "dev.emortal.api"
artifactId = "agones-sdk"
val commitHash = System.getenv("COMMIT_HASH_SHORT")
val releaseVersion = System.getenv("RELEASE_VERSION")
version = commitHash ?: releaseVersion ?: "local"
from(components["java"])
}
}
}
// Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
sourceSets {
main {
java {
srcDirs("build/generated/source/proto/main/grpc")
srcDirs("build/generated/source/proto/main/java")
}
}
}