forked from micronaut-projects/micronaut-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (108 loc) · 4.47 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
import java.time.Duration
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "io.micronaut.build.internal:micronaut-gradle-plugins:4.1.1"
}
}
subprojects { Project subproject ->
group "io.micronaut.data"
boolean isExampleOrBenchmark = subproject.parent.name == "docs-examples" || subproject.name.contains("example") || subproject.name.contains("benchmark")
ext {
skipDocumentation = true
}
if (subproject.name != 'data-bom' && !isExampleOrBenchmark) {
if (subproject.name != 'data-tck') {
skipDocumentation = false
}
apply plugin: "io.micronaut.build.internal.common"
apply plugin: "io.micronaut.build.internal.dependency-updates"
apply plugin: "io.micronaut.build.internal.publishing"
repositories {
mavenCentral()
}
micronautBuild {
resolutionStrategy {
force "jakarta.transaction:jakarta.transaction-api:$jakartaTxVersion"
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs.addAll([
'-parameters',
// enables incremental compilation
'-Amicronaut.processing.incremental=true',
'-Amicronaut.processing.annotations=io.micronaut.data.*,io.micronaut.core.annotation.*,javax.persistence.*',
"-Amicronaut.processing.group=$project.group",
"-Amicronaut.processing.module=$project.name",
])
}
} else if (isExampleOrBenchmark) {
repositories {
mavenCentral()
}
apply plugin:'java'
if (subproject.path.contains("groovy") && JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16)) {
test.enabled(false)
}
} else {
apply plugin: "java-platform"
version projectVersion
apply plugin: "io.micronaut.build.internal.dependency-updates"
apply plugin: "io.micronaut.build.internal.publishing"
repositories {
mavenCentral()
}
}
tasks.withType(Test) {
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_15)) {
jvmArgs "--enable-preview"
}
timeout = Duration.ofHours(1)
}
if (subproject.name != 'data-bom') {
dependencies {
implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion")
annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation platform("org.testcontainers:testcontainers-bom:$testContainersVersion")
testImplementation "io.micronaut.test:micronaut-test-spock"
}
configurations {
all {
resolutionStrategy.force "org.hibernate:hibernate-core:$hibernateVersion"
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.name == 'groovy-all') {
throw new GradleException("Dependency 'groovy-all' not allowed!")
}
if (groovyVersion && details.requested.group == 'org.codehaus.groovy') {
details.useVersion groovyVersion
}
if (micronautSqlVersion && details.requested.group == 'io.micronaut.sql') {
details.useVersion micronautSqlVersion
}
if (spockVersion && details.requested.group == 'org.spockframework') {
details.useVersion spockVersion
}
}
if (micronautTestVersion) {
resolutionStrategy.force "io.micronaut.test:micronaut-test-spock:$micronautTestVersion"
}
}
}
tasks.withType(Test) {
jvmArgs '-Xmx2048m'
systemProperty "micronaut.cloud.platform", "OTHER"
if (JavaVersion.current() == JavaVersion.VERSION_15) {
jvmArgs "--enable-preview"
}
timeout = Duration.ofHours(1)
}
}
}
apply plugin: "io.micronaut.build.internal.docs"
apply plugin: "io.micronaut.build.internal.dependency-updates"