-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
124 lines (109 loc) · 3.24 KB
/
Copy pathbuild.gradle
File metadata and controls
124 lines (109 loc) · 3.24 KB
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
plugins {
id 'java'
id 'maven-publish'
id 'com.google.protobuf' version '0.9.4'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}
group = 'com.orisunlabs'
version = project.findProperty('version') ?: '0.0.1'
repositories {
mavenCentral()
}
def grpcVersion = '1.75.0'
def protobufVersion = '4.28.2'
dependencies {
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"
implementation 'javax.annotation:javax.annotation-api:1.3.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testImplementation "io.grpc:grpc-inprocess:${grpcVersion}"
}
shadowJar {
archiveBaseName.set('orisun-client')
archiveClassifier.set('')
// archiveVersion.set('0.0.1') // Set your version
manifest {
attributes 'Main-Class': 'com.orisunlabs.orisun.client.OrisunClient' // Replace with your main class if needed
}
mergeServiceFiles()
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protobufVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
// Configure the protobuf source directory
sourceSets {
main {
proto {
srcDir 'protos'
}
}
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
groupId = 'com.orisunlabs'
artifactId = 'orisun-java-client'
version = project.version
pom {
name = 'Orisun Java Client'
description = 'Java client for the Orisun Event Store'
url = 'https://github.com/oexza/orisun-client-java'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'oexza'
name = 'Your Name'
email = 'your.email@example.com'
}
}
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/oexza/orisun-client-java")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
// If you want to publish to Maven Central
// maven {
// name = "OSSRH"
// url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
// credentials {
// username = System.getenv("OSSRH_USERNAME")
// password = System.getenv("OSSRH_PASSWORD")
// }
// }
}
}
test {
useJUnitPlatform()
}