Repository navigation
Expand file tree
/
Copy pathsettings.gradle
More file actions
188 lines (168 loc) · 8.03 KB
/
Copy pathsettings.gradle
File metadata and controls
188 lines (168 loc) · 8.03 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
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
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at https://docs.gradle.org/4.10.2/userguide/multi_project_builds.html
*/
pluginManagement {
includeBuild 'local-build-plugins'
}
plugins {
id 'com.gradle.develocity' version '4.6.0'
id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.8.0'
}
// Conditionally include local hibernate-orm build when path is specified
// Usage: ./gradlew build -PlocalHibernateOrmPath=../hibernate-orm
// Or add "localHibernateOrmPath = ../hibernate-orm" to gradle.properties
def localOrmPath = settings.ext.find("localHibernateOrmPath")
if ( localOrmPath ) {
logger.lifecycle "Using local Hibernate ORM build from: ${localOrmPath}"
includeBuild localOrmPath
}
rootProject.name = 'hibernate-reactive'
// When updating the baseline, make sure to update the JDK version in the javadoc link
gradle.ext.baselineJavaVersion = JavaLanguageVersion.of( 17 )
// Gradle does bytecode transformation on tests.
// You can't use bytecode higher than what Gradle supports, even with toolchains.
def GRADLE_MAX_SUPPORTED_BYTECODE_VERSION = 26
// This overrides the default version catalog in gradle/libs.versions.toml, which can be
// useful to monitor compatibility for upcoming versions on CI:
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
// ./gradlew build -PhibernateOrmVersion=7.1.1.Final
def hibernateOrmVersion = settings.ext.find("hibernateOrmVersion") ?: ""
if ( hibernateOrmVersion != "" ) {
version("hibernateOrmVersion", hibernateOrmVersion)
}
// ./gradlew build -PhibernateOrmGradlePluginVersion=7.1.1.Final
def hibernateOrmGradlePluginVersion = settings.ext.find("hibernateOrmGradlePluginVersion") ?: ""
if ( hibernateOrmGradlePluginVersion ) {
version("hibernateOrmGradlePluginVersion", hibernateOrmGradlePluginVersion)
}
// ./gradlew build -PvertxSqlClientVersion=4.0.0-SNAPSHOT
def vertxSqlClientVersion = settings.ext.find("vertxSqlClientVersion") ?: ""
if ( vertxSqlClientVersion ) {
version("vertxSqlClientVersion", vertxSqlClientVersion)
}
// ./gradlew build -PvertxWebVersion=4.0.0-SNAPSHOT
def vertxWebVersion = settings.ext.find("vertxWebVersion") ?: vertxSqlClientVersion
if ( vertxWebVersion ) {
version("vertxWebVersion", vertxWebVersion)
}
// ./gradlew build -PvertxWebClientVersion=4.0.0-SNAPSHOT
def vertxWebClientVersion = settings.ext.find("vertxWebClientVersion") ?: vertxSqlClientVersion
if ( vertxWebClientVersion ) {
version("vertxWebClientVersion", vertxWebClientVersion)
}
}
}
}
// If either 'main.jdk.version' or 'test.jdk.version' is set, enable the toolchain and use the selected jdk.
// If only one property is set, the other defaults to the baseline Java version (8).
// Note that when toolchain is enabled, you also need to specify
// the location of the selected jdks
// (auto-download and auto-detect are disabled in gradle.properties).
//
// Example (with SDKMAN):
// ./gradlew build -Ptest.jdk.version=15 \
// -Porg.gradle.java.installations.paths=$SDKMAN_CANDIDATES_DIR/java/15.0.1-open,$SDKMAN_CANDIDATES_DIR/java/8
if ( hasProperty( 'main.jdk.version' ) || hasProperty( 'test.jdk.version' ) ) {
// Testing a particular JDK version
// Gradle doesn't support all JDK versions unless we use toolchains
gradle.ext.javaToolchainEnabled = true
gradle.ext.javaVersions = [
main: [
compiler: JavaLanguageVersion.of(
hasProperty( 'main.jdk.version' )
? getProperty( 'main.jdk.version' ) as Integer
: gradle.ext.baselineJavaVersion.asInt()
),
release: gradle.ext.baselineJavaVersion
],
test: [
compiler: JavaLanguageVersion.of(
hasProperty( 'test.jdk.version' )
? getProperty( 'test.jdk.version' ) as Integer
: gradle.ext.baselineJavaVersion.asInt()
)
]
]
def testCompilerVersion = gradle.ext.javaVersions.test.compiler
if ( testCompilerVersion.asInt() > GRADLE_MAX_SUPPORTED_BYTECODE_VERSION ) {
logger.warn( "[WARN] Gradle does not support bytecode version '${testCompilerVersion}'." +
" Forcing test bytecode to version ${GRADLE_MAX_SUPPORTED_BYTECODE_VERSION}." )
gradle.ext.javaVersions.test.release = JavaLanguageVersion.of( GRADLE_MAX_SUPPORTED_BYTECODE_VERSION )
}
else {
gradle.ext.javaVersions.test.release = testCompilerVersion
}
gradle.ext.javaVersions.test.launcher = testCompilerVersion
}
else {
// Not testing a particular JDK version: we will use the same JDK used to run Gradle.
// We disable toolchains for convenience, so that anyone can just run the build with their own JDK
// without any additional options and without downloading the whole JDK.
gradle.ext.javaToolchainEnabled = false
def gradleJdkVersion = JavaLanguageVersion.of( JavaVersion.current().getMajorVersion() )
if ( gradleJdkVersion.asInt() > GRADLE_MAX_SUPPORTED_BYTECODE_VERSION ) {
logger.warn( "[WARN] Gradle does not support this JDK, because it is too recent; build is likely to fail." +
" To avoid failures, you should use an older Java version when running Gradle, and rely on toolchains." +
" To that end, specify the version of Java you want to run tests with using property 'test.jdk.version'," +
" and specify the path to JDK8 *and* a JDK of the test version using property 'org.gradle.java.installations.paths'." +
" Example:" +
"./gradlew build -Ptest.jdk.version=15 -Porg.gradle.java.installations.paths=\$SDKMAN_CANDIDATES_DIR/java/15.0.1-open,\$SDKMAN_CANDIDATES_DIR/java/8" )
}
gradle.ext.javaVersions = [
main: [
compiler: gradleJdkVersion,
release: gradle.ext.baselineJavaVersion
],
test: [
compiler: gradleJdkVersion,
release: gradleJdkVersion,
launcher: gradleJdkVersion
]
]
}
logger.lifecycle "Java versions for main code: " + gradle.ext.javaVersions.main
logger.lifecycle "Java versions for tests: " + gradle.ext.javaVersions.test
gradle.ext.javadocJdkVersion = gradle.ext.javaVersions.main.compiler.asInt()
include 'hibernate-reactive-core'
include 'session-example'
include 'native-sql-example'
include 'documentation'
include 'release'
include 'reporting'
include 'bytecode-enhancements-it'
include 'verticle-postgres-it'
include 'techempower-postgres-it'
include 'hibernate-validator-postgres-it'
include 'local-build-asciidoctor-extensions'
// Examples
for ( project in rootProject.children ) {
if ( project.name.endsWith( "-example" ) ) {
project.projectDir = file( "examples/${project.name}" )
}
}
// Integration tests
for ( project in rootProject.children ) {
if ( project.name.endsWith( "-it" ) ) {
project.projectDir = file( "integration-tests/${project.name}" )
}
}
apply from: file( 'gradle/gradle-develocity.gradle' )
buildCache {
local {
// do not use local build cache for CI jobs, period!
enabled = !settings.ext.isCiEnvironment
}
remote(develocity.buildCache) {
enabled = settings.ext.useRemoteCache
// Check access key presence to avoid build cache errors on PR builds when access key is not present
def accessKey = System.getenv("DEVELOCITY_ACCESS_KEY")
push = settings.ext.populateRemoteBuildCache && accessKey
}
}