Skip to content

enhancement/bento-35: Use Gradle convention script plugins.#36

Open
philliplbryant wants to merge 8 commits into
Col-E:masterfrom
philliplbryant:enhancement/BENTO-35
Open

enhancement/bento-35: Use Gradle convention script plugins.#36
philliplbryant wants to merge 8 commits into
Col-E:masterfrom
philliplbryant:enhancement/BENTO-35

Conversation

@philliplbryant
Copy link
Copy Markdown

These changes modify Gradle files to use convention script plugins (in lieu of allprojects and subprojects blocks). This is done in preparation for adding modules for docking layout persistence.

Phil Bryant added 2 commits April 29, 2026 11:44
Copy link
Copy Markdown
Author

@philliplbryant philliplbryant Apr 29, 2026

Choose a reason for hiding this comment

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

Registers a task for compiling classes for all test types.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

In a simpler gradle build, you have gradlew test which compiles the necessary classes compileTestJava then runs them test. What's the difference / use-case here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I apologize for not clarifying this sooner. In hindsight, I should have waited to include this until I had pushed the code containing the tests I’ve written for the persistence framework, as they will ultimately depend on this setup. To streamline this review, I intentionally removed several unused components, but I mistakenly overlooked this one — my apologies for the oversight.

To provide more context, my approach is to organize tests into "suites" based on their specific purposes and execution requirements. For instance, some tests are designed to run in parallel, while others are not. Similarly, certain tests require a graphics environment or other specialized configurations. Each suite is paired with its own convention scripts, which define the necessary test tasks and configurations for that suite. Lifecycle tasks — such as allClasses (ALL_CLASSES_TASK_NAME) in bento.project.build-lifecycle.gradle — are used to aggregate these individual tasks, enabling all related tasks to be executed with a single command. In a similar vein, a checkAll task is planned to execute a series of check*** tasks, running all tests across all test suites (and optionally gathering reports such as JaCoCo, if desired).

At this stage, I understand that this structure may not appear entirely necessary yet. However, as I continue to incorporate additional code for the persistence framework — which introduces four distinct types of test suites/tasks — I believe this approach will become increasingly valuable.

Given this context, would you prefer that I remove this for now and reintroduce it later, once the relevant tests and test suite conventions are fully integrated? I’d be happy to adjust based on your preference.

Comment thread build-logic/src/main/groovy/bento.project.project-convention.gradle
Comment thread build-logic/src/main/groovy/bento.release.publish-convention.gradle
Comment thread build-logic/src/main/groovy/bento.test.unit-test-suite.gradle
Comment thread core/build.gradle
Comment thread demos/basic/src/main/java/module-info.java
Comment thread gradle/wrapper/gradle-wrapper.properties
Comment thread gradle/libs.versions.toml Outdated
Comment thread platform/build.gradle
Comment thread build.gradle
Comment thread build.gradle
Comment thread CONTRIBUTING.md
Comment thread gradle.properties
Comment thread gradlew
Comment thread gradlew.bat
Comment thread README.md
Comment thread settings.gradle
Comment thread gradle/wrapper/gradle-wrapper.jar
@Col-E Col-E added the enhancement New feature or request label May 1, 2026
Copy link
Copy Markdown
Author

@philliplbryant philliplbryant left a comment

Choose a reason for hiding this comment

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

@Col-E, do you have any feedback for this pull request?

@Col-E
Copy link
Copy Markdown
Owner

Col-E commented May 8, 2026

Hectic week on my end, sorry for the lack of attention

@philliplbryant
Copy link
Copy Markdown
Author

No worries; just making sure the review
posted correctly.

@Col-E
Copy link
Copy Markdown
Owner

Col-E commented May 13, 2026

Took a look locally and made some changes to fit repo style a bit closer: changes.patch

Gist is mostly stylistic changes. I'll pull a few comments out from here that are noteworthy.

Comment thread build-logic/src/main/groovy/bento.project.project-convention.gradle Outdated
Comment thread build-logic/src/main/groovy/bento.project.project-convention.gradle
Comment thread build-logic/src/main/groovy/bento.project.project-convention.gradle Outdated
Comment on lines +103 to +111
// Name JARs using full project name, based on the project path.
// Otherwise, we might get JARs with the same names that will collide
// when aggregated by tasks like an installer task.
def jarBaseName =
project.path
// Delete the leading ':'
.substring(1)
// Replace the remaining ':' with '.'
.replace(':', '.')
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can be more succinctly described: Extract artifact Id from directory name.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I 'm not clear what you have in mind. I could set the artifact ID (I think we might have to actually do so for multiple IDs if we also publish source and JavaDoc JARs)?

This is a carry-over from a much larger project my team manages. We have a legacy project (30+ years in the making) and change is a lot slower than we'd like. We have 450 modules and we have frequently encounter issues aggregating those JARs to obfuscate and deploy them. That is not (and hopefully will not ever be) an issue with a smaller project like this - which is being developed using best practices unknow to us at the time much of our codebase was written.

Would you prefer I just use the module name without changing it, refactor it to use this convention but use it elsewhere, or do you have something else in mind?

Comment thread build-logic/src/main/groovy/bento.release.publish-convention.gradle Outdated
Comment thread build-logic/src/main/groovy/bento.release.publish-convention.gradle
Comment thread gradle/libs.versions.toml Outdated
Comment thread gradle/libs.versions.toml
Comment thread platform/build.gradle Outdated
Phil Bryant added 2 commits May 13, 2026 22:58
* Create a subheading for build tool versions and deleted usage comments.
* Used a project extra to DRY up and reuse the normalized module name.
* Used the `def javaMajorVersionAsInt` as intended.
* Removed encoding comments.
* Removed training white spaces in string literals.
* Define the project version in the version catalog.
* Suppress unused version warnings to exclude them from Qodana and IntelliJ.
Comment thread gradle/libs.versions.toml
Phil Bryant added 2 commits May 14, 2026 05:14
* Delete usage comments.
* Opportunistic upgrade JReleaser Gradle plugin version; fixes three CVE (Common Vulnerabilities and Exposures).
Comment thread gradle/libs.versions.toml
* Use a typesafe, configuration cache compatible convention extension.
Comment thread build-logic/src/main/groovy/bento.release.publish-convention.gradle
* Add documentation to the `BentoConventionExtension`.
* Remove trailing whitespaces from values in the publish convention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants