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

Add groups to tasks #86

Merged
merged 3 commits into from Sep 1, 2022
Merged

Add groups to tasks #86

merged 3 commits into from Sep 1, 2022

Conversation

sschuberth
Copy link
Contributor

Please have a look at the individual commit messages for the details.

Copy link
Contributor

@hvisser hvisser left a comment

Choose a reason for hiding this comment

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

Thanks for the PR :)

I prefer to keep the Gradle version on what it was because it affects the supported Kotlin version and the test kit version too. Could you revert that commit?

@@ -47,6 +47,11 @@ abstract class VersionCatalogApplyUpdatesTask : DefaultTask() {
keep.orNull?.getVersionCatalogRefs() ?: emptySet()
}

init {
description = "Applies changes to the Gradle versions catalog file."
group = "Help"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if "help" for the group makes a lot of sense, the group usually relates to the type of task. Maybe it should be something like "version catalog" or "version catalog update", since all tasks are related to the version catalog (plugin) here?

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 agree that "Help" is debatable, but my primary goal here was to align with what the gradle-versions-plugin uses, also see the commit message.

Copy link
Contributor

@hvisser hvisser Sep 1, 2022

Choose a reason for hiding this comment

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

Yeah agree it's debatable, and I'm not sure what their rationale was for them, but I think it makes more sense to group it under Version catalog update so that all of the plugin tasks are grouped. That mean more to folks looking for tasks around updating their version catalog more than putting it under help I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't that group name a bit too narrow? Like, if each plugin came up with a group name for just its own tasks, we'd get a lot of groups. How about something slightly more generic like "Maintenance" or "Dependency Management"? That way, we could probably also convince @ben-manes to settle on the group name we come up with here in his gradle-versions-plugin.

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't know really, for example the shadow plugin adds it's own shadow group, I don't think there is a set of well-defined group names. I lean toward just picking the plugin name for that reason, at least for now, because that would help you locate the tasks you are looking for and we don't get into the territory if versionCatalogFormat is "dependency management" or "formatting" either ;)

I'm sorry if this all sounds very nitpicky 🙃 Settling on "Dependency management" is fine with me too, if you feel strongly about not adding a group based on the plugin name :)

Choose a reason for hiding this comment

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

Gradle's dependency management tasks are under Help so it made sense to align them. At the time of Gradle 1.0 this was dependencies but has expanded to buildEnvironment and dependencyInsight. Since the versions plugin only offers one task it did not make sense to add a new section vs piggyback, and I had hoped they would offer the feature natively like Maven does.

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'caffeine'.
dependencies - Displays all dependencies declared in root project 'caffeine'.
dependencyInsight - Displays the insight into a specific dependency in root project 'caffeine'.
dependencyUpdates - Displays the dependency updates for the project.
help - Displays a help message.
javaToolchains - Displays the detected java toolchains.
outgoingVariants - Displays the outgoing variants of root project 'caffeine'.
projects - Displays the sub-projects of root project 'caffeine'.
properties - Displays the properties of root project 'caffeine'.
resolvableConfigurations - Displays the configurations that can be resolved in root project 'caffeine'.
tasks - Displays the tasks runnable from root project 'caffeine' (some of the displayed tasks may belong to subprojects).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for chiming in Ben!

@sschuberth
Copy link
Contributor Author

I prefer to keep the Gradle version on what it was because it affects the supported Kotlin version and the test kit version too. Could you revert that commit?

Would it be feasible to then at least update to a non-rc version and use Gradle 7.4 final?

@hvisser
Copy link
Contributor

hvisser commented Sep 1, 2022

I prefer to keep the Gradle version on what it was because it affects the supported Kotlin version and the test kit version too. Could you revert that commit?

Would it be feasible to then at least update to a non-rc version and use Gradle 7.4 final?

Yeah sure, I think that would still use the same Kotlin versions. It's technically not something that is required for this PR though.

See [1]. Do not upgrade to latest version 7.5.1 just yet to maintain
compatibility with older Kotlin versions.

[1]: https://docs.gradle.org/7.4/release-notes.html
This way the tasks become "public" and will be shown by `./gradlew
tasks`. The group name is aligned with the gradle-versions-plugin.
@sschuberth
Copy link
Contributor Author

All done.

Copy link
Contributor

@hvisser hvisser left a comment

Choose a reason for hiding this comment

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

Thanks again :)

@hvisser hvisser merged commit e5e87a8 into littlerobots:main Sep 1, 2022
@sschuberth sschuberth deleted the task-groups branch September 1, 2022 16:07
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.

None yet

3 participants