@@ -225,162 +225,23 @@ tasks.register("verifyVersions") {
225225// longer used for that purpose, but instead a way to run only functional tests. We should
226226// rework the functionalTests task to be more explicit about which tasks it wants to run
227227// so that that this flag is no longer needed.
228- boolean bwc_tests_enabled = true
228+ boolean bwcTestsEnabled = true
229229if (project. gradle. startParameter. taskNames. any { it. startsWith(" checkPart" ) || it == ' functionalTests' }) {
230230 // Disable BWC tests for checkPart* tasks and platform support tests as it's expected that this will run on it's own check
231- bwc_tests_enabled = false
231+ bwcTestsEnabled = false
232232}
233233
234234subprojects { proj ->
235235 apply plugin : ' elasticsearch.base'
236236}
237237
238238allprojects {
239- // We disable this plugin for now till we shaked out the issues we see
240- // e.g. see https://github.com/elastic/elasticsearch/issues/72169
241- // apply plugin:'elasticsearch.internal-test-rerun'
242-
243- plugins. withType(BaseInternalPluginBuildPlugin ). whenPluginAdded {
244- project. dependencies {
245- compileOnly project(" :server" )
246- testImplementation project(" :test:framework" )
247- }
248- }
249-
250- ext. bwc_tests_enabled = bwc_tests_enabled
251-
252- // eclipse configuration
253239 apply plugin : ' elasticsearch.eclipse'
254-
255- /*
256- * Allow accessing com/sun/net/httpserver in projects that have
257- * configured forbidden apis to allow it.
258- */
259- plugins. withType(ForbiddenApisPlugin ) {
260- eclipse. classpath. file. whenMerged { classpath ->
261- if (false == forbiddenApisTest. bundledSignatures. contains(' jdk-non-portable' )) {
262- classpath. entries
263- .findAll { it. kind == " con" && it. toString(). contains(" org.eclipse.jdt.launching.JRE_CONTAINER" ) }
264- .each {
265- it. accessRules. add(new AccessRule (" accessible" , " com/sun/net/httpserver/*" ))
266- }
267- }
268- }
269- }
270-
271- tasks. register(' resolveAllDependencies' , ResolveAllDependencies ) {
272- def ignoredPrefixes = [DistributionDownloadPlugin . ES_DISTRO_CONFIG_PREFIX , " jdbcDriver" ]
273- configs = project. configurations. matching { config -> ignoredPrefixes. any { config. name. startsWith(it) } == false }
274- resolveJavaToolChain = true
275- if (project. path. contains(" fixture" )) {
276- dependsOn tasks. withType(ComposePull )
277- }
278- if (project. path. contains(" :distribution:docker" )) {
279- enabled = false
280- }
281- if (project. path. contains(" :libs:cli" )) {
282- // ensure we resolve p2 dependencies for the spotless eclipse formatter
283- dependsOn " spotlessJavaCheck"
284- }
285- }
286-
287- ext. withReleaseBuild = { Closure config ->
288- if (buildParams. snapshotBuild == false ) {
289- config. call()
290- }
291- }
292-
293- plugins. withId(' lifecycle-base' ) {
294- if (project. path. startsWith(" :x-pack:" )) {
295- if (project. path. contains(" security" ) || project. path. contains(" :ml" )) {
296- tasks. register(' checkPart4' ) {
297- dependsOn ' check'
298- withReleaseBuild {
299- dependsOn ' assemble'
300- }
301- }
302- } else if (project. path == " :x-pack:plugin" || project. path. contains(" ql" ) || project. path. contains(" smoke-test" )) {
303- tasks. register(' checkPart3' ) {
304- dependsOn ' check'
305- withReleaseBuild {
306- dependsOn ' assemble'
307- }
308- }
309- } else if (project. path. contains(" multi-node" )) {
310- tasks. register(' checkPart5' ) {
311- dependsOn ' check'
312- withReleaseBuild {
313- dependsOn ' assemble'
314- }
315- }
316- } else {
317- tasks. register(' checkPart2' ) {
318- dependsOn ' check'
319- withReleaseBuild {
320- dependsOn ' assemble'
321- }
322- }
323- }
324- } else {
325- tasks. register(' checkPart1' ) {
326- dependsOn ' check'
327- withReleaseBuild {
328- dependsOn ' assemble'
329- }
330- }
331- }
332- tasks. register(' functionalTests' ) {
333- dependsOn ' check'
334- withReleaseBuild {
335- dependsOn ' assemble'
336- }
337- }
338- }
339-
340- /*
341- * Remove assemble/dependenciesInfo on all qa projects because we don't
342- * need to publish artifacts for them.
343- */
344- if (project. name. equals(' qa' ) || project. path. contains(' :qa:' )) {
345- maybeConfigure(project. tasks, ' assemble' ) {
346- it. enabled = false
347- }
348- maybeConfigure(project. tasks, ' dependenciesInfo' ) {
349- it. enabled = false
350- }
351- }
352-
353- project. afterEvaluate {
354- // Ensure similar tasks in dependent projects run first. The projectsEvaluated here is
355- // important because, while dependencies.all will pickup future dependencies,
356- // it is not necessarily true that the task exists in both projects at the time
357- // the dependency is added.
358- if (project. path == ' :test:framework' ) {
359- // :test:framework:test cannot run before and after :server:test
360- return
361- }
362- tasks. matching { it. name. equals(' integTest' ) }. configureEach { integTestTask ->
363- integTestTask. mustRunAfter tasks. matching { it. name. equals(" test" ) }
364- }
365-
366- /* configurations.matching { it.canBeResolved }.all { Configuration configuration ->
367- dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep ->
368- Project upstreamProject = dep.dependencyProject
369- if (project.path != upstreamProject?.path) {
370- for (String taskName : ['test', 'integTest']) {
371- project.tasks.matching { it.name == taskName }.configureEach { task ->
372- task.shouldRunAfter(upstreamProject.tasks.matching { upStreamTask -> upStreamTask.name == taskName })
373- }
374- }
375- }
376- }
377- }*/
378- }
379-
380240 apply plugin : ' elasticsearch.formatting'
241+ // bwc_tests_enabled is a ext flag defined in 'elasticsearch.all-projects.gradle'
242+ bwc_tests_enabled = bwcTestsEnabled
381243}
382244
383-
384245tasks. register(" verifyBwcTestsEnabled" ) {
385246 doLast {
386247 if (bwc_tests_enabled == false ) {
@@ -412,24 +273,6 @@ tasks.named("wrapper").configure {
412273 }
413274}
414275
415- gradle. projectsEvaluated {
416- // Having the same group and name for distinct projects causes Gradle to consider them equal when resolving
417- // dependencies leading to hard to debug failures. Run a check across all project to prevent this from happening.
418- // see: https://github.com/gradle/gradle/issues/847
419- Map coordsToProject = [:]
420- project. allprojects. forEach { p ->
421- String coords = " ${ p.group} :${ p.name} "
422- if (false == coordsToProject. putIfAbsent(coords, p)) {
423- throw new GradleException (
424- " Detected that two projects: ${ p.path} and ${ coordsToProject[coords].path} " +
425- " have the same name and group: ${ coords} . " +
426- " This doesn't currently work correctly in Gradle, see: " +
427- " https://github.com/gradle/gradle/issues/847"
428- )
429- }
430- }
431- }
432-
433276tasks. named(" validateChangelogs" ). configure {
434277 def triggeredTaskNames = gradle. startParameter. taskNames
435278 onlyIf {
0 commit comments