Repository navigation
Expand file tree
/
Copy pathsrcsets.gradle
More file actions
95 lines (84 loc) · 2.73 KB
/
Copy pathsrcsets.gradle
File metadata and controls
95 lines (84 loc) · 2.73 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
/** Configures the source sets for the code/ subprojects.
*
* Ideally this would have been done in the root build.gradle file, but due to disagreements
* between Gradle and IntelliJ's gradle plugin about how to interpret the sourceSets block
* when applied to subprojects from the root project, this has to be done in each subproject.
* */
apply plugin: 'java'
apply plugin: 'com.adarshr.test-logger'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'application'
test {
maxHeapSize = "8G"
useJUnitPlatform()
}
tasks.register('fastTests', Test) {
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
maxHeapSize = "8G"
useJUnitPlatform {
excludeTags("slow", "flaky")
}
}
tasks.withType(Test).configureEach {
// Back scratch allocator slabs with collectable arenas, so that tests that create
// allocator factories do not accumulate permanent global arena allocations
systemProperty 'system.scratchAllocatorAutoArena', 'true'
}
if (project.plugins.hasPlugin('application')) {
if (!application.mainClass.isPresent() || !application.applicationName.endsWith("-service")) {
tasks.shadowJar.enabled = false
}
else {
}
shadowJar {
// Service providers must reach the transformer before duplicate entries are removed.
filesMatching(['META-INF/services/**', 'META-INF/*.kotlin_module']) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
mergeServiceFiles()
archiveBaseName = application.applicationName
archiveClassifier = ''
archiveVersion = project.version
zip64 true
// Manifest for executable JAR
manifest {
attributes(
'Main-Class': application.mainClass,
'Implementation-Version': project.version
)
}
// Minimize JAR size by excluding unnecessary files
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
}
dependencies {
testImplementation platform(libs.junit.bom)
// Keep Jackson modules pulled in by test tools on the same release.
testImplementation platform(libs.jackson.bom)
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
sourceSets {
main {
java {
srcDirs = [
'java',
'build/generated/sources/proto/main/grpc',
'build/generated/sources/proto/main/java'
]
}
resources {
srcDirs = [ 'resources' ]
}
}
test {
java {
srcDirs = [ 'test' ]
}
resources {
srcDirs = [ 'test-resources' ]
}
}
}