2020-01-27 12:05:34 -05:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2020-01-10 10:43:52 -05:00
|
|
|
import java.time.ZonedDateTime
|
|
|
|
import java.time.format.DateTimeFormatter
|
2019-12-06 05:55:53 -05:00
|
|
|
|
2019-12-02 09:34:57 -05:00
|
|
|
plugins {
|
|
|
|
id "base"
|
2022-09-25 11:10:22 -04:00
|
|
|
id "com.palantir.consistent-versions" version "2.11.0"
|
|
|
|
id "org.owasp.dependencycheck" version "7.2.0"
|
2022-10-02 10:42:36 -04:00
|
|
|
id 'de.thetaphi.forbiddenapis' version '3.4' apply false
|
2022-09-25 11:10:22 -04:00
|
|
|
id "de.undercouch.download" version "5.2.0" apply false
|
2022-11-15 19:28:52 -05:00
|
|
|
id "net.ltgt.errorprone" version "3.0.1" apply false
|
2022-09-25 11:10:22 -04:00
|
|
|
id 'com.diffplug.spotless' version "6.5.2" apply false
|
2022-10-29 02:33:37 -04:00
|
|
|
id 'org.barfuin.gradle.jacocolog' version "3.0.0-RC2" apply false
|
2019-12-02 09:34:57 -05:00
|
|
|
}
|
|
|
|
|
2021-03-30 04:55:19 -04:00
|
|
|
apply from: file('gradle/globals.gradle')
|
2020-04-04 14:56:35 -04:00
|
|
|
|
2020-05-17 08:46:26 -04:00
|
|
|
// General metadata.
|
2020-08-23 13:26:40 -04:00
|
|
|
|
|
|
|
// Calculate project version:
|
|
|
|
version = {
|
|
|
|
// Release manager: update base version here after release:
|
2021-11-02 06:47:19 -04:00
|
|
|
String baseVersion = '10.0.0'
|
2020-08-23 13:26:40 -04:00
|
|
|
|
|
|
|
// 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}")
|
|
|
|
}()
|
2022-01-11 11:42:21 -05:00
|
|
|
description = 'Grandparent project for Apache Lucene Core'
|
2020-05-17 08:46:26 -04:00
|
|
|
|
2020-04-04 14:56:35 -04:00
|
|
|
// Propagate version and derived properties across projects.
|
2019-12-02 09:34:57 -05:00
|
|
|
allprojects {
|
2020-04-04 14:56:35 -04:00
|
|
|
version = rootProject.version
|
2019-12-02 09:34:57 -05:00
|
|
|
}
|
|
|
|
|
2020-01-10 10:43:52 -05:00
|
|
|
ext {
|
2020-04-04 14:56:35 -04:00
|
|
|
// "base" version is stripped of the qualifier. Compute it.
|
|
|
|
baseVersion = {
|
|
|
|
def m = (version =~ /^(\d+\.\d+\.\d+)(-(.+))?/)
|
|
|
|
if (!m) {
|
2021-04-16 16:35:51 -04:00
|
|
|
throw new GradleException("Can't strip version to just x.y.z: " + rootProject.version)
|
2020-04-04 14:56:35 -04:00
|
|
|
}
|
|
|
|
return m[0][1]
|
|
|
|
}()
|
2020-05-17 08:46:26 -04:00
|
|
|
// "majorVersion" is an integer with just the major version. Compute it.
|
|
|
|
majorVersion = {
|
|
|
|
def m = (version =~ /^(\d+)\.\d+\.\d+(-(.+))?/)
|
|
|
|
if (!m) {
|
2021-04-16 16:35:51 -04:00
|
|
|
throw new GradleException("Can't strip version to just major version: " + rootProject.version)
|
2020-05-17 08:46:26 -04:00
|
|
|
}
|
|
|
|
return m[0][1] as int
|
|
|
|
}
|
2021-08-01 08:14:42 -04:00
|
|
|
|
|
|
|
// Minimum Java version required to compile and run Lucene.
|
2022-01-10 09:42:15 -05:00
|
|
|
minJavaVersion = JavaVersion.VERSION_17
|
2021-08-01 08:14:42 -04:00
|
|
|
|
2020-06-01 04:00:46 -04:00
|
|
|
// snapshot build marker used in scripts.
|
|
|
|
snapshotBuild = version.contains("SNAPSHOT")
|
2020-04-04 14:56:35 -04:00
|
|
|
|
|
|
|
// Build timestamp.
|
2020-01-10 10:43:52 -05:00
|
|
|
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)
|
2020-01-15 05:44:21 -05:00
|
|
|
|
2020-08-30 11:10:18 -04:00
|
|
|
// 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
|
|
|
|
}
|
2020-01-10 10:43:52 -05:00
|
|
|
}
|
|
|
|
|
2021-04-12 14:16:43 -04:00
|
|
|
configurations {
|
|
|
|
groovy
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
// Use a newer groovy that doesn't have illegal reflective accesses.
|
2022-09-25 11:10:22 -04:00
|
|
|
groovy "org.codehaus.groovy:groovy-all:3.0.12"
|
2021-04-12 14:16:43 -04:00
|
|
|
}
|
|
|
|
|
2021-04-05 14:12:56 -04:00
|
|
|
apply from: file('buildSrc/scriptDepVersions.gradle')
|
|
|
|
|
2019-12-02 09:34:57 -05:00
|
|
|
// 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).
|
|
|
|
|
2021-03-30 04:55:19 -04:00
|
|
|
apply from: file('gradle/generation/local-settings.gradle')
|
2019-12-05 05:14:09 -05:00
|
|
|
|
2021-12-19 02:51:13 -05:00
|
|
|
// IDE support, settings and specials.
|
|
|
|
apply from: file('gradle/ide/intellij-idea.gradle')
|
|
|
|
apply from: file('gradle/ide/eclipse.gradle')
|
|
|
|
|
2019-12-02 09:34:57 -05:00
|
|
|
// Set up defaults and configure aspects for certain modules or functionality
|
|
|
|
// (java, tests)
|
2021-03-30 05:13:41 -04:00
|
|
|
apply from: file('gradle/java/folder-layout.gradle')
|
2021-03-30 04:55:19 -04:00
|
|
|
apply from: file('gradle/java/javac.gradle')
|
2022-12-26 04:07:44 -05:00
|
|
|
apply from: file('gradle/java/memorysegment-mrjar.gradle')
|
2019-12-02 09:34:57 -05:00
|
|
|
apply from: file('gradle/testing/defaults-tests.gradle')
|
|
|
|
apply from: file('gradle/testing/randomization.gradle')
|
2019-12-05 07:23:43 -05:00
|
|
|
apply from: file('gradle/testing/fail-on-no-tests.gradle')
|
2020-07-21 03:19:38 -04:00
|
|
|
apply from: file('gradle/testing/alternative-jdk-support.gradle')
|
2021-03-30 04:55:19 -04:00
|
|
|
apply from: file('gradle/java/jar-manifest.gradle')
|
2021-12-19 02:51:13 -05:00
|
|
|
apply from: file('gradle/java/modules.gradle')
|
2019-12-03 06:10:13 -05:00
|
|
|
|
2021-10-13 05:50:58 -04:00
|
|
|
// Maven artifact publishing.
|
|
|
|
apply from: file('gradle/maven/publications.gradle')
|
2019-12-02 09:34:57 -05:00
|
|
|
|
2019-12-03 08:40:35 -05:00
|
|
|
// Validation tasks
|
2021-02-20 14:05:47 -05:00
|
|
|
apply from: file('gradle/validation/measure-task-times.gradle')
|
2020-09-07 17:42:48 -04:00
|
|
|
apply from: file('gradle/validation/error-prone.gradle')
|
2020-01-03 09:22:36 -05:00
|
|
|
apply from: file('gradle/validation/precommit.gradle')
|
2019-12-03 08:40:35 -05:00
|
|
|
apply from: file('gradle/validation/forbidden-apis.gradle')
|
2019-12-11 12:41:27 -05:00
|
|
|
apply from: file('gradle/validation/jar-checks.gradle')
|
2020-01-03 09:22:36 -05:00
|
|
|
apply from: file('gradle/validation/git-status.gradle')
|
2020-01-03 10:04:12 -05:00
|
|
|
apply from: file('gradle/validation/versions-props-sorted.gradle')
|
2020-01-10 06:02:30 -05:00
|
|
|
apply from: file('gradle/validation/validate-source-patterns.gradle')
|
2020-01-15 03:55:41 -05:00
|
|
|
apply from: file('gradle/validation/rat-sources.gradle')
|
2020-01-26 04:01:51 -05:00
|
|
|
apply from: file('gradle/validation/owasp-dependency-check.gradle')
|
2020-02-18 12:43:47 -05:00
|
|
|
apply from: file('gradle/validation/ecj-lint.gradle')
|
2020-02-21 04:40:12 -05:00
|
|
|
apply from: file('gradle/validation/gradlew-scripts-tweaked.gradle')
|
2021-03-08 08:59:08 -05:00
|
|
|
|
2021-03-18 06:04:45 -04:00
|
|
|
apply from: file('gradle/validation/spotless.gradle')
|
2021-03-08 08:59:08 -05:00
|
|
|
|
2020-01-26 13:44:18 -05:00
|
|
|
// Source or data regeneration tasks
|
2021-03-23 04:25:53 -04:00
|
|
|
apply from: file('gradle/generation/regenerate.gradle')
|
2021-03-18 06:04:45 -04:00
|
|
|
apply from: file('gradle/generation/jflex.gradle')
|
2021-04-02 03:56:47 -04:00
|
|
|
apply from: file('gradle/generation/moman.gradle')
|
2021-03-18 06:04:45 -04:00
|
|
|
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')
|
2020-01-29 11:01:34 -05:00
|
|
|
apply from: file('gradle/generation/javacc.gradle')
|
2021-05-05 16:03:06 -04:00
|
|
|
apply from: file('gradle/generation/forUtil.gradle')
|
2021-08-27 06:47:19 -04:00
|
|
|
apply from: file('gradle/generation/antlr.gradle')
|
2022-11-19 17:40:45 -05:00
|
|
|
apply from: file('gradle/generation/unicode-test-classes.gradle')
|
2023-03-09 15:27:31 -05:00
|
|
|
apply from: file('gradle/generation/panama-foreign.gradle')
|
2020-01-26 13:44:18 -05:00
|
|
|
|
2021-03-22 07:22:39 -04:00
|
|
|
apply from: file('gradle/datasets/external-datasets.gradle')
|
|
|
|
|
2019-12-02 09:34:57 -05:00
|
|
|
// Additional development aids.
|
|
|
|
apply from: file('gradle/testing/per-project-summary.gradle')
|
|
|
|
apply from: file('gradle/testing/slowest-tests-at-end.gradle')
|
2020-01-08 06:20:09 -05:00
|
|
|
apply from: file('gradle/testing/failed-tests-at-end.gradle')
|
2020-01-28 11:27:18 -05:00
|
|
|
apply from: file('gradle/testing/profiling.gradle')
|
2020-08-18 03:28:50 -04:00
|
|
|
apply from: file('gradle/testing/beasting.gradle')
|
2021-05-02 10:24:06 -04:00
|
|
|
apply from: file('gradle/testing/coverage.gradle')
|
2019-12-02 09:34:57 -05:00
|
|
|
apply from: file('gradle/help.gradle')
|
|
|
|
|
2020-04-30 04:21:53 -04:00
|
|
|
apply from: file('gradle/documentation/documentation.gradle')
|
|
|
|
apply from: file('gradle/documentation/changes-to-html.gradle')
|
2020-05-17 08:46:26 -04:00
|
|
|
apply from: file('gradle/documentation/markdown.gradle')
|
2020-07-21 03:19:38 -04:00
|
|
|
apply from: file('gradle/documentation/render-javadoc.gradle')
|
2021-03-30 04:55:19 -04:00
|
|
|
apply from: file('gradle/documentation/check-broken-links.gradle')
|
2020-06-23 16:10:49 -04:00
|
|
|
|
2020-09-10 03:48:04 -04:00
|
|
|
apply from: file('gradle/hacks/gradle-archives.gradle')
|
2021-03-30 04:08:44 -04:00
|
|
|
apply from: file('gradle/hacks/wipe-temp.gradle')
|
2020-08-31 06:20:30 -04:00
|
|
|
apply from: file('gradle/hacks/hashmapAssertions.gradle')
|
2021-03-23 05:39:09 -04:00
|
|
|
apply from: file('gradle/hacks/turbocharge-jvm-opts.gradle')
|
2021-03-30 14:15:55 -04:00
|
|
|
apply from: file('gradle/hacks/dummy-outputs.gradle')
|
2022-01-03 15:11:35 -05:00
|
|
|
|
2022-10-05 21:46:20 -04:00
|
|
|
apply from: file('gradle/pylucene/pylucene.gradle')
|