Skip to content

Commit 7a750d1

Browse files
committed
Merge remote-tracking branch 'upstream/master' into object-fields
2 parents 1c816eb + e78dd40 commit 7a750d1

File tree

339 files changed

+3761
-3214
lines changed

Some content is hidden

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

339 files changed

+3761
-3214
lines changed

build.gradle

Lines changed: 3 additions & 6 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 {
@@ -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: 13 additions & 45 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

@@ -209,7 +177,7 @@ if (project != rootProject) {
209177
if (isLuceneSnapshot) {
210178
systemProperty 'test.lucene-snapshot-revision', isLuceneSnapshot[0][1]
211179
}
212-
maxParallelForks System.getProperty('tests.jvms', project.rootProject.ext.defaultParallel.toString()) as Integer
180+
maxParallelForks System.getProperty('tI', project.rootProject.ext.defaultParallel.toString()) as Integer
213181
}
214182
check.dependsOn(integTest)
215183

0 commit comments

Comments
 (0)