-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
181 lines (152 loc) · 5.49 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
plugins {
id 'idea'
id 'eclipse'
id 'de.undercouch.download' version '5.5.0'
id 'java'
id 'java-library'
id 'signing'
id "com.google.protobuf" version "0.9.4"
id "com.vanniktech.maven.publish" version "0.30.0"
}
import com.vanniktech.maven.publish.SonatypeHost
task sourcesJar(type: Jar) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
}
java {
withSourcesJar()
}
group = "com.devcycle"
archivesBaseName = "java-server-sdk"
version = "2.5.0"
mavenPublishing {
coordinates("com.devcycle", "java-server-sdk", version)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
signAllPublications()
pom {
name = 'DevCycle Java Server SDK'
description = 'Server side SDK to interact with DevCycle.'
url = 'https://devcycle.com'
licenses {
license {
name = 'MIT License'
url = 'https://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'devcycle'
name = 'DevCycle Engineering'
email = '[email protected]'
organization = 'DevCycle'
}
}
scm {
connection = 'scm:git:git://github.com/DevCycleHQ/java-server-sdk.git'
developerConnection = 'scm:git:ssh://github.com:DevCycleHQ/java-server-sdk.git'
url = 'https://github.com/DevCycleHQ/java-server-sdk'
}
}
}
signing {
// The signing key needs to be an ascii armored key version of the binary gpg keyfile
// encoded in base64 to preserver formatting when used in an environment variable
def signingKey = base64Decode(findProperty("signingKey"))
def signingKeyId = findProperty("signingKeyId")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications
}
def base64Decode(encodedString){
if(encodedString != null) {
byte[] decoded = encodedString.decodeBase64()
String decode = new String(decoded)
return decode
}
return null;
}
repositories {
mavenCentral()
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
def wasmResourcePath = "$projectDir/src/main/resources"
def wasmVersion = "1.25.3"
def wasmUrl = "https://unpkg.com/@devcycle/bucketing-assembly-script@$wasmVersion/build/bucketing-lib.release.wasm"
task downloadDVCBucketingWASM(type: Download) {
src wasmUrl
dest wasmResourcePath
doLast {
println "Completed DevCycle Bucketing WASM Download to $wasmResourcePath"
}
}
processResources.dependsOn downloadDVCBucketingWASM
sourcesJar.dependsOn downloadDVCBucketingWASM
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.24.4"
}
}
ext {
retrofit_version = "2.11.0"
jackson_version = "2.15.3"
swagger_annotations_version = "2.2.18"
lombok_version = "1.18.30"
okhttp_version = "4.12.0"
wasmtime_version = "0.19.0"
junit_version = "4.13.2"
mockito_core_version = "5.6.0"
protobuf_version = "3.24.4"
openfeature_version = "1.7.0"
eventsource_version = "4.1.1"
}
dependencies {
annotationProcessor("org.projectlombok:lombok:$lombok_version")
implementation("com.squareup.okhttp3:okhttp:$okhttp_version")
implementation("com.squareup.retrofit2:retrofit:$retrofit_version") {
exclude group: "com.squareup.okhttp3", module: "okhttp"
}
implementation("com.squareup.retrofit2:converter-jackson:$retrofit_version") {
exclude group: "com.squareup.okhttp3", module: "okhttp"
}
api("com.fasterxml.jackson.core:jackson-databind:$jackson_version")
implementation("io.swagger.core.v3:swagger-annotations:$swagger_annotations_version")
implementation("io.github.kawamuray.wasmtime:wasmtime-java:$wasmtime_version")
implementation("com.google.protobuf:protobuf-java:$protobuf_version")
implementation("dev.openfeature:sdk:$openfeature_version")
implementation("com.launchdarkly:okhttp-eventsource:$eventsource_version")
compileOnly("org.projectlombok:lombok:$lombok_version")
testAnnotationProcessor("org.projectlombok:lombok:$lombok_version")
testImplementation("junit:junit:$junit_version")
testImplementation("org.mockito:mockito-core:$mockito_core_version")
testImplementation("com.squareup.retrofit2:retrofit-mock:$retrofit_version")
testCompileOnly("org.projectlombok:lombok:$lombok_version")
}
// Gradle magic for adding a new "examples" source set that's separate from the main source set
sourceSets {
examples {
java {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
}
configurations {
examplesImplementation.extendsFrom implementation
examplesRuntimeOnly.extendsFrom runtimeOnly
}
task runLocalExample(type: JavaExec) {
description = "Run the local bucketing example"
classpath = sourceSets.examples.runtimeClasspath
mainClass = 'com.devcycle.examples.LocalExample'
}
task runCloudExample(type: JavaExec) {
description = "Run the cloud bucketing example"
classpath = sourceSets.examples.runtimeClasspath
mainClass = 'com.devcycle.examples.CloudExample'
}
task runOpenFeatureExample(type: JavaExec) {
description = "Run the OpenFeature example"
classpath = sourceSets.examples.runtimeClasspath
mainClass = 'com.devcycle.examples.OpenFeatureExample'
}