-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
87 lines (78 loc) · 3.34 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
import java.time.Duration
buildscript {
ext {
junit5Version = '5.11.3' // https://junit.org/junit5/
junit5PlatformVersion = '1.11.3'
slf4jVersion = '2.0.16' // http://www.slf4j.org/download.html
// TODO bump Jackson version, but also consider if we care about keeping Android compatibility for SDK versions < 26
// https://github.com/FasterXML/jackson/wiki/Jackson-Releases
jacksonVersion = '2.13.0' // https://github.com/FasterXML/jackson-databind/releases
// retrofit is why we need allow-opens. context: https://stackoverflow.com/questions/60915381/retrofit2-maven-project-illegal-reflective-access-warning // https://github.com/square/retrofit/issues/3341
retrofitVersion = "2.11.0" // https://github.com/square/retrofit/releases
okhttpVersion = "4.12.0" // https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
dockerComposePluginVersion = "0.17.11" // https://github.com/avast/gradle-docker-compose-plugin/releases
}
}
plugins {
id "com.avast.gradle.docker-compose" version "$dockerComposePluginVersion"
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish' // necessary for jitpack
apply plugin: 'docker-compose'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
maven { url "https://repo.maven.apache.org/maven2" }
}
dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junit5Version
testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5Version"
testImplementation "org.junit.platform:junit-platform-commons:$junit5PlatformVersion"
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: junit5Version
implementation 'org.jetbrains:annotations:21.0.1' // https://search.maven.org/search?q=g:org.jetbrains%20AND%20a:annotations
}
test {
useJUnitPlatform {
excludeTags 'integration'
}
if(JavaVersion.current() >= JavaVersion.VERSION_1_9) {
// If we don't have this, we get warnings for something about retrofit2.Platform
jvmArgs "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile){
options.compilerArgs << "-Xlint:deprecation"
}
}
task integration(type: Test) {
useJUnitPlatform {
includeTags 'integration'
}
if(JavaVersion.current() >= JavaVersion.VERSION_1_9) {
// If we don't have this, we get warnings for something about retrofit2.Platform
jvmArgs "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
}
}
dockerCompose {
useComposeFiles = ['../testing/docker-compose.yml']
isRequiredBy integration
waitForTcpPortsTimeout = Duration.ofMinutes(1)
}
publishing { // necessary for jitpack
publications {
mavenJava(MavenPublication) {
// thanks https://stackoverflow.com/a/68515859/5434860
groupId = "${group}"
artifactId = "${project.name}"
version = "${version}"
from project.components.java
}
}
}
}
wrapper {
gradleVersion = '8.11.1'
distributionType = Wrapper.DistributionType.ALL
}