Skip to content

Fix Gradle 4.3.1 compatibility for logging #27382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import java.nio.file.Files

import org.gradle.util.GradleVersion

apply plugin: 'groovy'

group = 'org.elasticsearch.gradle'
Expand Down Expand Up @@ -99,9 +101,11 @@ dependencies {

// Gradle 2.14+ removed ProgressLogger(-Factory) classes from the public APIs
// Use logging dependency instead
// Gradle 4.3.1 stopped releasing the logging jars to jcenter, just use the last available one
GradleVersion logVersion = GradleVersion.current() > GradleVersion.version('4.3') ? GradleVersion.version('4.3') : GradleVersion.current()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think we should do this, I think we should depend on the right version. I understand that entails an additional external dependency, but the dependency will end up cached locally anyway except on Gradle upgrades. For CI this has no impact since we upgrade infrequently there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the wrong tradeoff. We use gradle-logging as a compileOnly dependency, and the interface we use has been super stable since forever. We would notice (build breaks) if something would change in that regard in future versions. Ignoring security concerns, adding a dependency on a repository that might not have the same uptime as jcenter could annoy us more... I've updated the PR according to your suggestion as I want to see this fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, if this dependency is as stable as you say let's take it the way that you proposed first.


dependencies {
compileOnly "org.gradle:gradle-logging:${GradleVersion.current().getVersion()}"
compileOnly "org.gradle:gradle-logging:${logVersion.getVersion()}"
compile 'ru.vyarus:gradle-animalsniffer-plugin:1.2.0' // Gradle 2.14 requires a version > 1.0.1
}

Expand Down