-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
112 lines (92 loc) · 2.68 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
plugins {
id 'java-library'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
id 'com.diffplug.spotless' version '6.25.0'
id 'org.barfuin.gradle.jacocolog' version '3.1.0'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'io.getstream'
version = '1.27.2'
description = 'Stream Chat official Java SDK'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
withJavadocJar()
withSourcesJar()
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url uri('https://repo.maven.apache.org/maven2/') }
}
dependencies {
implementation(platform("com.squareup.okhttp3:okhttp-bom:4.12.0"))
// define any required OkHttp artifacts without version
implementation("com.squareup.okhttp3:okhttp")
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.9.0'
implementation 'io.jsonwebtoken:jjwt-api:0.12.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.5'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
compileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
testCompileOnly 'org.projectlombok:lombok:1.18.32'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.32'
}
def localProperties = new Properties()
def localPropertiesFile = project.rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localProperties.load(localPropertiesFile.newDataInputStream())
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
events 'standard_out', 'standard_error', "passed", "skipped", "failed"
}
doFirst {
// Inject local properties into tests runtime system properties
localProperties.each{k, v ->
systemProperty k.toString(), v.toString()
}
}
finalizedBy jacocoTestReport
}
def generatedVersionDir = "${buildDir}/generated-version"
sourceSets {
main {
output.dir(generatedVersionDir, builtBy: 'generateVersionProperties')
}
}
spotless {
java {
googleJavaFormat()
}
groovyGradle {
target '*.gradle'
greclipse()
}
}
jacocoTestReport {
dependsOn test
}
task generateVersionProperties {
doLast {
def propertiesFile = file "$generatedVersionDir/version.properties"
propertiesFile.parentFile.mkdirs()
def properties = new Properties()
properties.setProperty("version", rootProject.version.toString())
propertiesFile.withWriter { properties.store(it, null) }
}
}
processResources.dependsOn generateVersionProperties
shadowJar {
enableRelocation true
relocationPrefix "shadowed"
mergeServiceFiles()
}
apply from: "publish.gradle"