Skip to content

Update Gradle wrapper to 9.2.1 and resolve pmd issues#114

Open
haroon-sheikh wants to merge 3 commits intomasterfrom
gradle-wrapper-9.2
Open

Update Gradle wrapper to 9.2.1 and resolve pmd issues#114
haroon-sheikh wants to merge 3 commits intomasterfrom
gradle-wrapper-9.2

Conversation

@haroon-sheikh
Copy link
Contributor

This pull request updates the Gauge Gradle plugin to version 3.1.0 and introduces several improvements and cleanups to the plugin codebase and its tests. The most significant changes include updating dependencies and Gradle versions, refactoring code for clarity and maintainability, and improving test conventions.

Dependency and Version Updates:

  • Upgraded the Gauge Gradle plugin version from 2.1.0 to 3.1.0 in the README.md, build.gradle example, and plugin/gradle.properties.
  • Updated the Gradle wrapper to use version 9.2.1 (was 8.14.3) and updated the distribution SHA256 checksum accordingly in gradle-wrapper.properties.

Codebase Improvements and Refactoring:

  • Refactored task classes (AbstractGaugeTask, GaugeClasspathTask, GaugeTask, GaugeValidateTask) to use super for setting group, description, and dependencies, and to pass descriptions via constructors for clarity.
  • Made GaugeConstants a final class and added a private constructor to prevent instantiation.
  • Cleaned up and simplified the GaugeCommand class by removing unnecessary imports, streamlining flag logic, and using toList() instead of Collectors.toList().
  • Moved default property conventions for the GaugeExtension from the class constructor to the plugin application logic in GaugePlugin, improving separation of concerns.

Test and Example Code Improvements:

  • Updated integration and unit test classes to use package-private class and method visibility (removing public), reordered imports, and improved code style for consistency.
  • Enhanced the test project plugin application block to use a multi-line string and set failOnNoDiscoveredTests = false for test tasks.

Build Script and Wrapper Cleanup:

  • Removed unused or redundant CLASSPATH assignments in gradlew and gradlew.bat scripts.
  • Updated copyright year in gradlew.

These changes collectively modernize the plugin, improve maintainability, and ensure compatibility with the latest Gradle and Gauge versions.

@gaugebot
Copy link

gaugebot bot commented Nov 28, 2025

@haroon-sheikh Thank you for contributing to gauge-gradle-plugin. Your pull request has been labeled as a release candidate 🎉🎉.

Merging this PR will trigger a release.

Please bump up the version as part of this PR.

Instructions to bump the version can found at CONTRIBUTING.md

If the CONTRIBUTING.md file does not exist or does not include instructions about bumping up the version, please looks previous commits in git history to see what changes need to be done.

@chadlwilson
Copy link
Contributor

I spent a while reviewing this and changing to test across multiple (older) Gradle versions for backward compat in #119 , and discovered that there seems to be some problem with the windows tests (they are actually failing and have been for a while, but the PowerShell scripting in the build is incorrect and seemingly swallowing the failure)

I couldn't work out why they are failing and the pattern is indiscernable (it's kinda like the 1st or 2nd integration test gets stuck or causes the runner to crash).

Will probably refactor a bit to move this forward to be able to look at the windows issues separately though.

@haroon-sheikh
Copy link
Contributor Author

Thanks @chadlwilson for looking into this.. I'd suggest we get this in as It should already be compatible with gradle v8 and v9 both. Testing with different gradle versions is a an overkill imho, as it should be up to the consumers to manage the version of Gradle wrapper.

@chadlwilson
Copy link
Contributor

The problem is that if you don't specifically validate with different Gradle runtime versions there's really nothing to stop you consuming parts of the API which don't work in previous versions - since Gradle seemingly does not seem to allow you to build a plugin using newer Gradle while targeting an older API version in a binary safe way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants