forked from FAForever/faf-java-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
195 lines (158 loc) · 5.85 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
import org.springframework.boot.gradle.plugin.SpringBootPlugin
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.0")
}
}
plugins {
id "java"
id "org.springframework.boot" version "3.2.0"
id "idea"
id "com.adarshr.test-logger" version "4.0.0"
}
group = 'faforever'
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
bootJar.enabled = true
jar.enabled = false
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
compileJava.dependsOn(processResources)
configurations {
compile.exclude module: "assertj-core"
}
idea {
module {
testSourceDirs += file('src/inttest/java')
}
}
processResources {
filesMatching('**/application.yml') {
filter {
it.replace('#faf-api.version#', project.version.toString())
}
}
}
sourceSets {
inttest {
java.srcDir 'src/inttest/java'
resources.srcDir 'src/inttest/resources'
compileClasspath += sourceSets.test.compileClasspath
runtimeClasspath += sourceSets.test.runtimeClasspath
}
}
configurations {
inttestCompile.extendsFrom testCompile
inttestRuntime.extendsFrom testRuntime
}
task inttest(type: Test) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Runs the integration tests."
setTestClassesDirs(files(sourceSets.inttest.output))
classpath = sourceSets.inttest.runtimeClasspath
testLogging {
events("failed")
exceptionFormat = 'full'
}
useJUnitPlatform()
mustRunAfter test
}
processInttestResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
// JACOCO & COVERALLS
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
jacocoTestReport {
dependsOn inttest
executionData.from = files(["$buildDir/jacoco/test.exec", "$buildDir/jacoco/inttest.exec"])
reports {
xml.required = true
}
}
// CODACY
configurations {
codacy
}
task sendCoverageToCodacy(type: JavaExec, dependsOn: jacocoTestReport) {
mainClass = "com.codacy.CodacyCoverageReporter"
classpath = configurations.codacy
args = ["report", "-l", "Java", "-r", "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"]
}
configurations.all {
// Cache -SNAPSHOT for 60 seconds only
resolutionStrategy.cacheChangingModulesFor 60, 'seconds'
}
build.dependsOn inttest
test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
ext {
}
dependencies {
// Spring Boot managed dependencies
implementation(platform(SpringBootPlugin.BOM_COORDINATES))
implementation("org.projectlombok:lombok")
annotationProcessor(platform(SpringBootPlugin.BOM_COORDINATES))
annotationProcessor("org.projectlombok:lombok")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
testAnnotationProcessor(platform(SpringBootPlugin.BOM_COORDINATES))
testAnnotationProcessor("org.projectlombok:lombok")
testAnnotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-amqp")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("org.springframework.boot:spring-boot-starter-mail")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("io.micrometer:micrometer-core")
implementation("com.github.ben-manes.caffeine:caffeine")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("com.jayway.jsonpath:json-path")
testImplementation("com.jayway.jsonpath:json-path-assert")
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
runtimeOnly("org.mariadb.jdbc:mariadb-java-client")
// Manually managed dependencies
def elideVersion = "7.0.0"
def springdocVersion = "2.2.0"
implementation("com.yahoo.elide:elide-core:${elideVersion}")
implementation("com.yahoo.elide:elide-model-config:${elideVersion}")
implementation("com.yahoo.elide:elide-spring-boot-autoconfigure:${elideVersion}")
implementation("com.yahoo.elide:elide-swagger:${elideVersion}")
implementation("com.yahoo.elide:elide-datastore-jpa:${elideVersion}")
implementation("com.yahoo.elide:elide-datastore-multiplex:${elideVersion}")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:${springdocVersion}")
implementation("com.github.FAForever:faf-java-commons:0e5d22ffff6e4dea81bac494d532627fcca8ebc4")
implementation("org.kohsuke:github-api:1.318")
implementation("org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r")
implementation("org.jetbrains:annotations:24.1.0")
implementation("com.google.guava:guava:32.1.3-jre")
implementation("org.luaj:luaj-jse:3.0.1")
implementation("io.github.micheljung:nocatch:2.0")
implementation("org.apache.commons:commons-compress:1.25.0")
implementation("org.json:json:20231013")
implementation("org.jsoup:jsoup:1.17.1")
implementation("com.github.jasminb:jsonapi-converter:0.13")
implementation("commons-codec:commons-codec:1.16.0")
// Required library for FafTokenService approach (called by nimbus-jwt)
runtimeOnly("org.bouncycastle:bcpkix-jdk15on:1.70")
testImplementation("junit-addons:junit-addons:1.4")
testImplementation("org.testcontainers:junit-jupiter:1.19.3")
testImplementation("org.testcontainers:mariadb:1.19.3")
codacy("com.github.codacy:codacy-coverage-reporter:13.13.13")
}