Skip to content

Commit 0ec5ac9

Browse files
author
Christoph Büscher
committed
Merge branch 'master' into updateable-synonyms
2 parents 5efac3d + 0db0e13 commit 0ec5ac9

File tree

350 files changed

+7049
-6882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

350 files changed

+7049
-6882
lines changed

.ci/build-cache.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
if (System.getenv('GRADLE_BUILD_CACHE_URL')) {
2+
gradle.settingsEvaluated { settings ->
3+
settings.buildCache {
4+
remote(HttpBuildCache) {
5+
url = System.getenv('GRADLE_BUILD_CACHE_URL')
6+
push = Boolean.valueOf(System.getenv('GRADLE_BUILD_CACHE_PUSH') ?: 'false')
7+
if (System.getenv('GRADLE_BUILD_CACHE_USERNAME') && System.getenv('GRADLE_BUILD_CACHE_PASSWORD')) {
8+
credentials {
9+
username = System.getenv('GRADLE_BUILD_CACHE_USERNAME')
10+
password = System.getenv('GRADLE_BUILD_CACHE_PASSWORD')
11+
}
12+
}
13+
}
14+
}
15+
}
16+
} else {
17+
throw new GradleException("You must supply a value for GRADLE_BUILD_CACHE_URL environment variable when applying build-cache.gradle init script")
18+
}

build.gradle

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import org.gradle.plugins.ide.eclipse.model.SourceFolder
3131
plugins {
3232
id 'com.gradle.build-scan' version '2.2.1'
3333
id 'base'
34+
id 'elasticsearch.global-build-info'
3435
}
3536
if (Boolean.valueOf(project.findProperty('org.elasticsearch.acceptScanTOS') ?: "false")) {
3637
buildScan {
@@ -162,8 +163,8 @@ task verifyVersions {
162163
* after the backport of the backcompat code is complete.
163164
*/
164165

165-
boolean bwc_tests_enabled = false
166-
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/38373" /* place a PR link here when committing bwc changes */
166+
boolean bwc_tests_enabled = true
167+
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
167168
if (bwc_tests_enabled == false) {
168169
if (bwc_tests_disabled_issue.isEmpty()) {
169170
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")
@@ -262,7 +263,7 @@ allprojects {
262263
}
263264

264265
project.afterEvaluate {
265-
configurations.all {
266+
configurations.matching { it.canBeResolved }.all {
266267
resolutionStrategy.dependencySubstitution { DependencySubstitutions subs ->
267268
projectSubstitutions.each { k,v ->
268269
subs.substitute(subs.module(k)).with(subs.project(v))
@@ -336,7 +337,7 @@ gradle.projectsEvaluated {
336337
if (tasks.findByPath('test') != null && tasks.findByPath('integTest') != null) {
337338
integTest.mustRunAfter test
338339
}
339-
configurations.all { Configuration configuration ->
340+
configurations.matching { it.canBeResolved }.all { Configuration configuration ->
340341
dependencies.all { Dependency dep ->
341342
Project upstreamProject = dependencyToProject(dep)
342343
if (upstreamProject != null) {
@@ -617,7 +618,3 @@ allprojects {
617618
}
618619
}
619620
}
620-
621-
622-
623-

buildSrc/build.gradle

Lines changed: 12 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,17 @@ if (project == rootProject) {
4545
// we update the version property to reflect if we are building a snapshot or a release build
4646
// we write this back out below to load it in the Build.java which will be shown in rest main action
4747
// to indicate this being a snapshot build or a release build.
48-
File propsFile = project.file('version.properties')
49-
Properties props = VersionPropertiesLoader.loadBuildSrcVersion(propsFile)
48+
Properties props = VersionPropertiesLoader.loadBuildSrcVersion(project.file('version.properties'))
5049
version = props.getProperty("elasticsearch")
50+
51+
task generateVersionProperties(type: WriteProperties) {
52+
outputFile = "${buildDir}/version.properties"
53+
comment = 'Generated version properties'
54+
properties(props)
55+
}
56+
5157
processResources {
52-
inputs.file(propsFile)
53-
// We need to be explicit with the version because we add snapshot and qualifier to it based on properties
54-
inputs.property("dynamic_elasticsearch_version", props.getProperty("elasticsearch"))
55-
doLast {
56-
Writer writer = file("$destinationDir/version.properties").newWriter()
57-
try {
58-
props.store(writer, "Generated version properties")
59-
} finally {
60-
writer.close()
61-
}
62-
}
58+
from(generateVersionProperties)
6359
}
6460

6561
/*****************************************************************************
@@ -69,37 +65,10 @@ processResources {
6965
if (JavaVersion.current() < JavaVersion.VERSION_11) {
7066
throw new GradleException('At least Java 11 is required to build elasticsearch gradle tools')
7167
}
72-
// Gradle 4.10 does not support setting this to 11 yet
73-
targetCompatibility = "10"
74-
sourceCompatibility = "10"
75-
76-
// We have a few classes that need to be compiled for older java versions because these are used to run checks against
77-
// those
78-
sourceSets {
79-
minimumRuntime {
80-
// We only want Java here, but the Groovy doesn't configure javadoc correctly if we don't define this as groovy
81-
groovy {
82-
srcDirs = ['src/main/minimumRuntime']
83-
}
84-
}
85-
}
86-
compileMinimumRuntimeGroovy {
87-
targetCompatibility = 8
88-
sourceCompatibility = 8
89-
}
90-
dependencies {
91-
if (project.ext.has("isEclipse") == false || project.ext.isEclipse == false) {
92-
// eclipse is confused if this is set explicitly
93-
compile sourceSets.minimumRuntime.output
94-
}
95-
minimumRuntimeCompile "junit:junit:${props.getProperty('junit')}"
96-
minimumRuntimeCompile localGroovy()
97-
minimumRuntimeCompile gradleApi()
98-
}
99-
jar {
100-
from sourceSets.minimumRuntime.output
101-
}
10268

69+
// Keep compatibility with Java 8 for external users of build-tools that haven't migrated to Java 11
70+
targetCompatibility = '8'
71+
sourceCompatibility = '8'
10372

10473
/*****************************************************************************
10574
* Dependencies used by the entire build *
@@ -164,7 +133,6 @@ if (project != rootProject) {
164133
dependenciesInfo.enabled = false
165134
forbiddenApisMain.enabled = false
166135
forbiddenApisTest.enabled = false
167-
forbiddenApisMinimumRuntime.enabled = false
168136
jarHell.enabled = false
169137
thirdPartyAudit.enabled = false
170138

0 commit comments

Comments
 (0)