-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
101 lines (91 loc) · 2.62 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
import com.google.protobuf.gradle.*
import net.researchgate.release.GitAdapter
plugins {
java
id("com.google.protobuf") version "0.8.16"
id("net.researchgate.release") version "2.8.1"
`java-library`
`maven-publish`
}
version = "$version"
group = "$group"
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
maven("https://plugins.gradle.org/m2/")
maven {
url = uri("https://repo1.maven.org/maven2")
isAllowInsecureProtocol = true
}
}
dependencies {
implementation("com.google.protobuf:protobuf-java:3.15.3")
implementation("io.grpc:grpc-stub:1.30.0")
implementation("io.grpc:grpc-protobuf:1.30.0")
implementation("io.grpc:grpc-netty:1.30.0")
testImplementation("junit:junit:4.13")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.15.3"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.30.0"
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
id("grpc")
}
}
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
}
}
}
release {
failOnSnapshotDependencies = true
with(propertyMissing("git") as GitAdapter.GitConfig) {
requireBranch = "main"
}
preTagCommitMessage = "Gradle Release Plugin - pre tag commit: "
tagCommitMessage = "Gradle Release Plugin - creating tag: "
newVersionCommitMessage = "Gradle Release Plugin - new version commit: "
}
tasks {
"afterReleaseBuild" {
dependsOn(getTasksByName("publish", true))
}
}
publishing {
publications {
repositories {
maven {
isAllowInsecureProtocol = true
url =
System.getenv("GITHUB_REPOSITORY")?.toString()?.let { uri("https://maven.pkg.github.com/".plus(it)) }
?: uri(findProperty("artifactory").toString())
credentials {
username = System.getenv("ARTIFACTORY_USERNAME")?.toString()
?: findProperty("artifactoryUsername").toString()
password = System.getenv("ARTIFACTORY_PASSCODE")?.toString()
?: findProperty("artifactoryPassword").toString()
}
}
}
}
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}