Skip to content
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

Fix build script to run with Gradle 7 #145

Merged
merged 1 commit into from
Oct 27, 2021

Conversation

andsel
Copy link
Contributor

@andsel andsel commented Oct 27, 2021

Release notes

Update build infrastructure to Gradle 7.2

What does this PR do?

Update the Gradle wrapper used to version 7.2 and fixed build.gradle script.

Why is it important/What is the impact to the user?

Developers can use JDK >= 17 to build the plugin

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

Run ./gradlew clean vendor

Related issues

Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

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

LGTM, minor request for documenting why a certain gradle setting is needed

build.gradle Outdated
classpath = sourceSets.main.runtimeClasspath
}

task generateGemJarRequiresFile {
configurations.implementation.canBeResolved = true
Copy link
Member

Choose a reason for hiding this comment

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

can you add a comment here on why this is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is that without that the

configurations.implementation.allDependencies {....}

can't see the resolved dependencies. According to the table (it's from Gradle's JavaLibraryPlugin, but the same applies to JavaPlugin) the implementation configuration doesn't resolve the dependencies.

Forcing that canBeResolved = true the dependencies get resolved and can be seen from the other inspection code segments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The best solution is to use runtimeClasspath in configurations.runtimeClasspath.allDependencies because it's already resolved and don't need the explicit resolution flag

Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

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

LGTM

@andsel andsel merged commit ac65746 into logstash-plugins:master Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants