-
Notifications
You must be signed in to change notification settings - Fork 1k
/
build.gradle
205 lines (174 loc) · 7.83 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
196
197
198
199
200
201
202
203
204
205
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
plugins {
id "base"
id "lucene.build-infra"
alias(deps.plugins.dependencychecks)
alias(deps.plugins.spotless) apply false
alias(deps.plugins.benmanes.versions)
alias(deps.plugins.forbiddenapis) apply false
alias(deps.plugins.versionCatalogUpdate) apply false
alias(deps.plugins.randomizedtesting) apply false
alias(deps.plugins.owasp.dependencycheck)
alias(deps.plugins.undercouch.download) apply false
alias(deps.plugins.errorprone) apply false
alias(deps.plugins.jacocolog) apply false
}
apply from: file('gradle/globals.gradle')
// General metadata.
// Calculate project version:
version = {
// Release manager: update base version here after release:
String baseVersion = '11.0.0'
// On a release explicitly set release version in one go:
// -Dversion.release=x.y.z
// Jenkins can just set just a suffix, overriding SNAPSHOT, e.g. using build id:
// -Dversion.suffix=jenkins123
String versionSuffix = propertyOrDefault('version.suffix', 'SNAPSHOT')
return propertyOrDefault('version.release', "${baseVersion}-${versionSuffix}")
}()
description = 'Grandparent project for Apache Lucene Core'
// Propagate version and derived properties across projects.
allprojects {
version = rootProject.version
}
ext {
// "base" version is stripped of the qualifier. Compute it.
baseVersion = {
def m = (version =~ /^(\d+\.\d+\.\d+)(-(.+))?/)
if (!m) {
throw new GradleException("Can't strip version to just x.y.z: " + rootProject.version)
}
return m[0][1]
}()
// "majorVersion" is an integer with just the major version. Compute it.
majorVersion = {
def m = (version =~ /^(\d+)\.\d+\.\d+(-(.+))?/)
if (!m) {
throw new GradleException("Can't strip version to just major version: " + rootProject.version)
}
return m[0][1] as int
}
// Minimum Java version required to compile and run Lucene.
minJavaVersion = JavaVersion.toVersion(deps.versions.minJava.get())
// also change this in extractor tool: ExtractForeignAPI
vectorIncubatorJavaVersions = [ JavaVersion.VERSION_21, JavaVersion.VERSION_22, JavaVersion.VERSION_23 ] as Set
// snapshot build marker used in scripts.
snapshotBuild = version.contains("SNAPSHOT")
// Build timestamp.
def tstamp = ZonedDateTime.now()
buildDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(tstamp)
buildTime = DateTimeFormatter.ofPattern("HH:mm:ss").format(tstamp)
buildYear = DateTimeFormatter.ofPattern("yyyy").format(tstamp)
// Allow definiting external tool locations using system props.
externalTool = { name ->
def resolved = propertyOrDefault("${name}.exe", name as String)
logger.info("External tool '${name}' resolved to: ${resolved}")
return resolved
}
}
configurations {
groovy
}
dependencies {
// Use a newer groovy that doesn't have illegal reflective accesses.
groovy deps.groovy
}
// Include smaller chunks configuring dedicated build areas.
// Some of these intersect or add additional functionality.
// The order of inclusion of these files shouldn't matter (but may
// if the build file is incorrectly written and evaluates something
// eagerly).
apply from: file('gradle/conventions.gradle')
apply from: file('gradle/generation/local-settings.gradle')
// Make sure the build environment is consistent.
apply from: file('gradle/validation/check-environment.gradle')
// Set up defaults and configure aspects for certain modules or functionality
// (java, tests)
apply from: file('gradle/java/folder-layout.gradle')
apply from: file('gradle/java/javac.gradle')
apply from: file('gradle/java/core-mrjar.gradle')
apply from: file('gradle/testing/defaults-tests.gradle')
apply from: file('gradle/testing/randomization.gradle')
apply from: file('gradle/testing/fail-on-no-tests.gradle')
apply from: file('gradle/testing/alternative-jdk-support.gradle')
apply from: file('gradle/java/jar-manifest.gradle')
apply from: file('gradle/java/modules.gradle')
// IDE support, settings and specials.
apply from: file('gradle/ide/intellij-idea.gradle')
apply from: file('gradle/ide/eclipse.gradle')
// Maven artifact publishing.
apply from: file('gradle/maven/publications.gradle')
// Validation tasks
apply from: file('gradle/validation/measure-task-times.gradle')
apply from: file('gradle/validation/error-prone.gradle')
apply from: file('gradle/validation/precommit.gradle')
apply from: file('gradle/validation/forbidden-apis.gradle')
apply from: file('gradle/validation/jar-checks.gradle')
apply from: file('gradle/validation/git-status.gradle')
apply from: file('gradle/validation/validate-source-patterns.gradle')
apply from: file('gradle/validation/rat-sources.gradle')
apply from: file('gradle/validation/owasp-dependency-check.gradle')
apply from: file('gradle/validation/ecj-lint.gradle')
apply from: file('gradle/validation/gradlew-scripts-tweaked.gradle')
apply from: file('gradle/validation/dependencies.gradle')
apply from: file('gradle/validation/spotless.gradle')
// Wire up included builds to some validation tasks.
rootProject.tasks.named("tidy").configure {
dependsOn gradle.includedBuilds*.task(":tidy")
}
rootProject.tasks.named("clean").configure {
dependsOn gradle.includedBuilds*.task(":clean")
}
rootProject.tasks.named("check").configure {
dependsOn gradle.includedBuilds*.task(":forbiddenApis")
}
// Source or data regeneration tasks
apply from: file('gradle/generation/regenerate.gradle')
apply from: file('gradle/generation/jflex.gradle')
apply from: file('gradle/generation/moman.gradle')
apply from: file('gradle/generation/snowball.gradle')
apply from: file('gradle/generation/kuromoji.gradle')
apply from: file('gradle/generation/nori.gradle')
apply from: file('gradle/generation/icu.gradle')
apply from: file('gradle/generation/javacc.gradle')
apply from: file('gradle/generation/forUtil.gradle')
apply from: file('gradle/generation/antlr.gradle')
apply from: file('gradle/generation/unicode-test-classes.gradle')
apply from: file('gradle/generation/extract-jdk-apis.gradle')
apply from: file('gradle/datasets/external-datasets.gradle')
// Additional development aids.
apply from: file('gradle/testing/per-project-summary.gradle')
apply from: file('gradle/testing/slowest-tests-at-end.gradle')
apply from: file('gradle/testing/failed-tests-at-end.gradle')
apply from: file('gradle/testing/profiling.gradle')
apply from: file('gradle/testing/beasting.gradle')
apply from: file('gradle/testing/coverage.gradle')
apply from: file('gradle/help.gradle')
apply from: file('gradle/documentation/documentation.gradle')
apply from: file('gradle/documentation/changes-to-html.gradle')
apply from: file('gradle/documentation/markdown.gradle')
apply from: file('gradle/documentation/render-javadoc.gradle')
apply from: file('gradle/documentation/check-broken-links.gradle')
apply from: file('gradle/hacks/gradle-archives.gradle')
apply from: file('gradle/hacks/wipe-temp.gradle')
apply from: file('gradle/hacks/hashmapAssertions.gradle')
apply from: file('gradle/hacks/turbocharge-jvm-opts.gradle')
apply from: file('gradle/hacks/dummy-outputs.gradle')
apply from: file('gradle/pylucene/pylucene.gradle')