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 16:43:52 +01:00
|
|
|
import java.time.ZonedDateTime
|
|
|
|
import java.time.format.DateTimeFormatter
|
2019-12-06 11:55:53 +01:00
|
|
|
|
2019-12-02 15:34:57 +01:00
|
|
|
plugins {
|
|
|
|
id "base"
|
2020-01-09 14:23:35 +01:00
|
|
|
id "com.palantir.consistent-versions" version "1.14.0"
|
2020-01-26 10:45:05 +01:00
|
|
|
id "org.owasp.dependencycheck" version "5.3.0"
|
2020-09-23 14:56:46 +02:00
|
|
|
id 'de.thetaphi.forbiddenapis' version '3.1' apply false
|
2020-02-11 18:56:11 -05:00
|
|
|
id "de.undercouch.download" version "4.0.2" apply false
|
2020-09-07 14:42:48 -07:00
|
|
|
id "net.ltgt.errorprone" version "1.2.1" apply false
|
2020-12-17 13:11:54 +01:00
|
|
|
id 'com.diffplug.spotless' version "5.8.2" apply false
|
2019-12-02 15:34:57 +01:00
|
|
|
}
|
|
|
|
|
2020-08-23 19:26:40 +02:00
|
|
|
apply from: file('gradle/defaults.gradle')
|
2020-04-04 20:56:35 +02:00
|
|
|
|
2020-05-17 14:46:26 +02:00
|
|
|
// General metadata.
|
2020-08-23 19:26:40 +02:00
|
|
|
|
|
|
|
// Calculate project version:
|
|
|
|
version = {
|
|
|
|
// Release manager: update base version here after release:
|
|
|
|
String baseVersion = '9.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}")
|
|
|
|
}()
|
2020-05-17 14:46:26 +02:00
|
|
|
description = 'Grandparent project for Apache Lucene Core and Apache Solr'
|
|
|
|
|
2020-04-04 20:56:35 +02:00
|
|
|
// Propagate version and derived properties across projects.
|
2019-12-02 15:34:57 +01:00
|
|
|
allprojects {
|
2020-04-04 20:56:35 +02:00
|
|
|
version = rootProject.version
|
2019-12-02 15:34:57 +01:00
|
|
|
}
|
|
|
|
|
2020-01-10 16:43:52 +01:00
|
|
|
ext {
|
2020-04-04 20:56:35 +02:00
|
|
|
// "base" version is stripped of the qualifier. Compute it.
|
|
|
|
baseVersion = {
|
|
|
|
def m = (version =~ /^(\d+\.\d+\.\d+)(-(.+))?/)
|
|
|
|
if (!m) {
|
|
|
|
throw GradleException("Can't strip version to just x.y.z: " + rootProject.version)
|
|
|
|
}
|
|
|
|
return m[0][1]
|
|
|
|
}()
|
2020-05-17 14:46:26 +02:00
|
|
|
// "majorVersion" is an integer with just the major version. Compute it.
|
|
|
|
majorVersion = {
|
|
|
|
def m = (version =~ /^(\d+)\.\d+\.\d+(-(.+))?/)
|
|
|
|
if (!m) {
|
|
|
|
throw GradleException("Can't strip version to just major version: " + rootProject.version)
|
|
|
|
}
|
|
|
|
return m[0][1] as int
|
|
|
|
}
|
2020-06-01 10:00:46 +02:00
|
|
|
// snapshot build marker used in scripts.
|
|
|
|
snapshotBuild = version.contains("SNAPSHOT")
|
2020-04-04 20:56:35 +02:00
|
|
|
|
|
|
|
// Build timestamp.
|
2020-01-10 16:43:52 +01: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 11:44:21 +01:00
|
|
|
|
2020-08-21 21:47:11 +02:00
|
|
|
minJavaVersion = JavaVersion.VERSION_11
|
|
|
|
|
2020-02-20 13:54:07 +01:00
|
|
|
// Declare script dependency versions outside of palantir's
|
|
|
|
// version unification control. These are not our main dependencies.
|
2020-01-15 11:44:21 +01:00
|
|
|
scriptDepVersions = [
|
2020-01-26 19:44:18 +01:00
|
|
|
"apache-rat": "0.11",
|
2020-10-08 14:25:51 -05:00
|
|
|
"commons-codec": "1.13",
|
2020-02-20 13:54:07 +01:00
|
|
|
"ecj": "3.19.0",
|
2020-09-17 13:29:18 +02:00
|
|
|
"javacc": "7.0.4",
|
2020-01-29 17:01:34 +01:00
|
|
|
"jflex": "1.7.0",
|
2020-11-03 12:50:05 +01:00
|
|
|
"jgit": "5.9.0.202009080501-r",
|
2020-05-17 14:46:26 +02:00
|
|
|
"flexmark": "0.61.24",
|
2020-01-15 11:44:21 +01:00
|
|
|
]
|
2020-11-03 12:50:05 +01:00
|
|
|
|
2020-08-30 17:10:18 +02: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 16:43:52 +01:00
|
|
|
}
|
|
|
|
|
2019-12-02 15:34:57 +01: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).
|
|
|
|
|
2020-01-09 17:40:51 +01:00
|
|
|
apply from: file('gradle/generate-defaults.gradle')
|
2019-12-05 11:14:09 +01:00
|
|
|
|
2020-02-19 02:43:47 +09:00
|
|
|
// Ant-compatibility layer: apply folder layout early so that
|
|
|
|
// evaluation of other scripts doesn't need to be deferred.
|
|
|
|
apply from: file('gradle/ant-compat/folder-layout.gradle')
|
|
|
|
|
2019-12-02 15:34:57 +01:00
|
|
|
// Set up defaults and configure aspects for certain modules or functionality
|
|
|
|
// (java, tests)
|
|
|
|
apply from: file('gradle/defaults-java.gradle')
|
|
|
|
apply from: file('gradle/testing/defaults-tests.gradle')
|
|
|
|
apply from: file('gradle/testing/randomization.gradle')
|
2019-12-05 13:23:43 +01:00
|
|
|
apply from: file('gradle/testing/fail-on-no-tests.gradle')
|
2020-07-21 09:19:38 +02:00
|
|
|
apply from: file('gradle/testing/alternative-jdk-support.gradle')
|
2020-04-04 20:56:35 +02:00
|
|
|
apply from: file('gradle/jar-manifest.gradle')
|
2019-12-03 12:10:13 +01:00
|
|
|
|
2020-10-08 14:25:51 -05:00
|
|
|
// Publishing and releasing
|
2019-12-03 12:10:13 +01:00
|
|
|
apply from: file('gradle/maven/defaults-maven.gradle')
|
2020-10-08 14:25:51 -05:00
|
|
|
apply from: file('gradle/releasing.gradle')
|
2019-12-02 15:34:57 +01:00
|
|
|
|
2020-04-09 13:55:42 +02:00
|
|
|
// IDE support, settings and specials.
|
|
|
|
apply from: file('gradle/ide/intellij-idea.gradle')
|
2020-08-21 21:47:11 +02:00
|
|
|
apply from: file('gradle/ide/eclipse.gradle')
|
2019-12-02 15:34:57 +01:00
|
|
|
|
2019-12-03 14:40:35 +01:00
|
|
|
// Validation tasks
|
2020-09-07 14:42:48 -07:00
|
|
|
apply from: file('gradle/validation/error-prone.gradle')
|
2020-01-03 15:22:36 +01:00
|
|
|
apply from: file('gradle/validation/precommit.gradle')
|
2019-12-03 14:40:35 +01:00
|
|
|
apply from: file('gradle/validation/forbidden-apis.gradle')
|
2019-12-11 18:41:27 +01:00
|
|
|
apply from: file('gradle/validation/jar-checks.gradle')
|
2020-01-03 15:22:36 +01:00
|
|
|
apply from: file('gradle/validation/git-status.gradle')
|
2020-01-03 16:04:12 +01:00
|
|
|
apply from: file('gradle/validation/versions-props-sorted.gradle')
|
2020-01-10 12:02:30 +01:00
|
|
|
apply from: file('gradle/validation/validate-source-patterns.gradle')
|
2020-01-10 12:49:04 +01:00
|
|
|
apply from: file('gradle/validation/config-file-sanity.gradle')
|
2020-01-15 02:55:41 -06:00
|
|
|
apply from: file('gradle/validation/rat-sources.gradle')
|
2020-01-26 10:01:51 +01:00
|
|
|
apply from: file('gradle/validation/owasp-dependency-check.gradle')
|
2020-02-19 02:43:47 +09:00
|
|
|
apply from: file('gradle/validation/ecj-lint.gradle')
|
2020-02-21 10:40:12 +01:00
|
|
|
apply from: file('gradle/validation/gradlew-scripts-tweaked.gradle')
|
2020-04-17 20:40:32 -04:00
|
|
|
apply from: file('gradle/validation/validate-log-calls.gradle')
|
2020-05-20 23:23:24 +09:00
|
|
|
apply from: file('gradle/validation/check-broken-links.gradle')
|
2020-12-17 13:11:54 +01:00
|
|
|
apply from: file('gradle/validation/spotless.gradle')
|
2019-12-03 14:40:35 +01:00
|
|
|
|
2020-01-26 19:44:18 +01:00
|
|
|
// Source or data regeneration tasks
|
|
|
|
apply from: file('gradle/generation/jflex.gradle')
|
2020-01-29 17:01:34 +01:00
|
|
|
apply from: file('gradle/generation/javacc.gradle')
|
2020-02-11 18:56:11 -05:00
|
|
|
apply from: file('gradle/generation/util.gradle')
|
LUCENE-9220: regenerate all stemmers/stopwords/test data from snowball 2.0 (#1262)
Previous situation:
* The snowball base classes (Among, SnowballProgram, etc) had accumulated local performance-related changes. There was a task that would also "patch" generated classes (e.g. GermanStemmer) after-the-fact.
* Snowball classes had many "non-changes" from the original such as removal of tabs addition of javadocs, license headers, etc.
* Snowball test data (inputs and expected stems) was incorporated into lucene testing, but this was maintained manually. Also files had become large, making the test too slow (Nightly).
* Snowball stopwords lists from their website were manually maintained. In some cases encoding fixes were manually applied.
* Some generated stemmers (such as Estonian and Armenian) exist in lucene, but have no corresponding `.sbl` file in snowball sources at all.
Besides this mess, snowball project is "moving along" and acquiring new languages, adding non-BSD-licensed test data, huge test data, and other complexity. So it is time to automate the integration better.
New situation:
* Lucene has a `gradle snowball` regeneration task. It works on Linux or Mac only. It checks out their repos, applies the `snowball.patch` in our repository, compiles snowball stemmers, regenerates all java code, applies any adjustments so that our build is happy.
* Tests data is automatically regenerated from the commit hash of the snowball test data repository. Not all languages are tested from their data: only where the license is simple BSD. Test data is also (deterministically) sampled, so that we don't have huge files. We just want to make sure our integration works.
* Randomized tests are still set to test every language with generated fake words. The regeneration task ensures all languages get tested (it writes a simple text file list of them).
* Stopword files are automatically regenerated from the commit hash of the snowball website repository.
* The regeneration procedure is idempotent. This way when stuff does change, you know exactly what happened. For example if test data changes to a different license, you may see a git deletion. Or if a new language/stopwords/test data gets added, you will see git additions.
2020-02-17 12:38:01 -05:00
|
|
|
apply from: file('gradle/generation/snowball.gradle')
|
2020-02-20 19:00:56 +01:00
|
|
|
apply from: file('gradle/generation/kuromoji.gradle')
|
2020-09-28 20:28:21 +09:00
|
|
|
apply from: file('gradle/generation/nori.gradle')
|
2021-02-14 21:07:39 +01:00
|
|
|
apply from: file('gradle/generation/icu.gradle')
|
2020-01-26 19:44:18 +01:00
|
|
|
|
2020-11-16 00:40:03 -08:00
|
|
|
// Shared configuration of subprojects containing native code.
|
|
|
|
apply from: file('gradle/native/disable-native.gradle')
|
|
|
|
|
2019-12-02 15:34:57 +01:00
|
|
|
// Additional development aids.
|
2019-12-03 12:10:13 +01:00
|
|
|
apply from: file('gradle/maven/maven-local.gradle')
|
2019-12-02 15:34:57 +01:00
|
|
|
apply from: file('gradle/testing/per-project-summary.gradle')
|
|
|
|
apply from: file('gradle/testing/slowest-tests-at-end.gradle')
|
2020-01-08 12:20:09 +01: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 09:28:50 +02:00
|
|
|
apply from: file('gradle/testing/beasting.gradle')
|
2019-12-02 15:34:57 +01:00
|
|
|
apply from: file('gradle/help.gradle')
|
|
|
|
|
|
|
|
// Ant-compatibility layer. ALL OF THESE SHOULD BE GONE at some point. They are
|
|
|
|
// here so that we can coexist with current ant build but they are indicative
|
|
|
|
// of potential problems with the build conventions, dependencies, etc.
|
2019-12-13 12:01:26 +01:00
|
|
|
apply from: file('gradle/ant-compat/force-versions.gradle')
|
2019-12-02 15:34:57 +01:00
|
|
|
apply from: file('gradle/ant-compat/misc.gradle')
|
|
|
|
apply from: file('gradle/ant-compat/post-jar.gradle')
|
|
|
|
apply from: file('gradle/ant-compat/test-classes-cross-deps.gradle')
|
|
|
|
apply from: file('gradle/ant-compat/artifact-naming.gradle')
|
2020-04-30 17:21:53 +09:00
|
|
|
|
|
|
|
apply from: file('gradle/documentation/documentation.gradle')
|
|
|
|
apply from: file('gradle/documentation/changes-to-html.gradle')
|
2020-05-17 14:46:26 +02:00
|
|
|
apply from: file('gradle/documentation/markdown.gradle')
|
2020-07-21 09:19:38 +02:00
|
|
|
apply from: file('gradle/documentation/render-javadoc.gradle')
|
2020-06-23 16:10:49 -04:00
|
|
|
|
2020-09-10 09:48:04 +02:00
|
|
|
apply from: file('gradle/hacks/gradle-archives.gradle')
|
2020-06-23 16:10:49 -04:00
|
|
|
apply from: file('gradle/hacks/findbugs.gradle')
|
2020-08-20 13:49:24 +02:00
|
|
|
apply from: file('gradle/hacks/gradle.gradle')
|
2020-08-31 12:20:30 +02:00
|
|
|
apply from: file('gradle/hacks/hashmapAssertions.gradle')
|
2020-08-31 14:55:45 +02:00
|
|
|
|
2020-08-31 15:43:56 +02:00
|
|
|
apply from: file('gradle/solr/packaging.gradle')
|
|
|
|
apply from: file('gradle/solr/solr-forbidden-apis.gradle')
|