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

gradlew tasks should sort tasks groups according to a lifecycle or something like that #10133

Open
vlsi opened this issue Jul 31, 2019 · 4 comments
Labels
a:feature A new functionality in:reporting-tasks help dependencyInsight dependencies

Comments

@vlsi
Copy link
Contributor

vlsi commented Jul 31, 2019

Expected Behavior

./gradlew tasks should provide user-friendly order rather than machine-friendly one.

For instance:

Getting started tasks
IDE tasks
Source validation tasks (e.g. static analysis)
Build tasks
Build verification tasks (e.g. tests, coverage)
Documentation tasks
Publishing tasks
Release tasks

I'm not sure if that would be an overkill, but it might make sense if user could configure "dependencies between build groups" so ./gradlew tasks would do a topological sort for the task groups.

For instance, if a new build group is added (e.g. "integration test tasks") by build script author, then they could specify that "integration test tasks" group depends on "Build verification tasks" group and Publishing tasks depend on "integration test tasks" group.
That would make task group order extensible.

Alternative (or additional) option is to infer group dependency from task dependencies, however it might be resource-intensive. On the other hand, it would transparently support things like "unit test tasks group" should be printed after "build tasks group" because "test tasks" depend on "build tasks"

Just for the reference, here's a current output of tasks:

------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------

Build tasks
-----------
allDepInsight - Shows insights where the dependency is used. For instance: allDepInsight --configuration compile --dependency org.jsoup:jsoup
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles main classes.
clean - Deletes the build directory.
createDist - Copies JMeter jars and dependencies to projectRoot/lib/ folder
jar - Assembles a jar archive containing the main classes.
renderLicenseForBinary - Generate LICENSE file for binary distribution
renderLicenseForSource - Generate LICENSE file for source distribution
testClasses - Assembles test classes.

Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

Coverage reports tasks
----------------------
jacocoReport - Generates an aggregate report from all subprojects

Development tasks
-----------------
runGui - Builds and starts JMeter GUI

Distribution tasks
------------------
distTar - Creates binary distribution with LF line endings for text files
distTarSource - Creates source distribution with LF line endings for text files
distZip - Creates binary distribution with CRLF line endings for text files
distZipSource - Creates source distribution with CRLF line endings for text files

Documentation tasks
-------------------
groovydoc - Generates Groovydoc API documentation for the main source code.
javadoc - Generates Javadoc API documentation for the main source code.
javadocAggregate - Generates aggregate javadoc for all the artifacts
previewPrintableDocs - Creates preview of a printable documentation to build/docs/printable_preview
previewSite - Creates preview of a site to build/docs/site

Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'jmeter'.
components - Displays the components produced by root project 'jmeter'. [incubating]
dependencies - Displays all dependencies declared in root project 'jmeter'.
dependencyInsight - Displays the insight into a specific dependency in root project 'jmeter'.
dependentComponents - Displays the dependent components of components in root project 'jmeter'. [incubating]
help - Displays a help message.
kotlinDslAccessorsReport - Prints the Kotlin code for accessing the currently available project extensions and conventions.
model - Displays the configuration model of root project 'jmeter'. [incubating]
projects - Displays the sub-projects of root project 'jmeter'.
properties - Displays the properties of root project 'jmeter'.
tasks - Displays the tasks runnable from root project 'jmeter' (some of the displayed tasks may belong to subprojects).

IDE tasks
---------
cleanEclipse - Cleans all Eclipse files.
cleanIdea - Cleans IDEA project files (IML, IPR)
eclipse - Generates all Eclipse files.
idea - Generates IDEA project files (IML, IPR, IWS)
openIdea - Opens the IDEA project

Publishing tasks
----------------
publish - Publishes all publications produced by this project.
publishAllPublicationsToNexusRepository - Publishes all Maven publications produced by this project to the nexus repository.
publishToMavenLocal - Publishes all Maven publications produced by this project to the local Maven cache.
pushPreviewSite - Builds and publishes site preview

Release tasks
-------------
closeAndReleaseRepository - Closes and releases an artifacts repository in Nexus
closeRepository - Closes an open artifacts repository in Nexus
createRcTag - Create release candidate tag if missing
createReleaseTag - Create release tag if missing
getStagingProfile - Gets a staging profile id in Nexus - a diagnostic task
prepareVote - Stage artifacts and prepare text for vote mail
publishDist - Publish release artifacts to SVN and Nexus
publishSvnDist - Publish release artifacts to SVN dist repository
pushRcTag - Push release candidate tag to a remote repository
pushReleaseTag - Push release tag to a remote repository
releaseRepository - Releases a closed artifacts repository in Nexus
stageDist - Stage release artifacts to SVN and Nexus
stageSvnDist - Stage release artifacts to SVN dist repository

Test tasks
----------
generatePom - test

Verification tasks
------------------
batchTests - Executes all the batch tests (add -PallBatch to see individual batch tasks)
calculateChecksums - Calculates and prints the checksums of the project dependencies
check - Runs all checks.
jacocoTestCoverageVerification - Verifies code coverage metrics based on specified rules for the test task.
jacocoTestReport - Generates code coverage report for the test task.
rat - Runs Apache Rat audit tool
spotbugsMain - Run SpotBugs analysis for main classes
spotbugsTest - Run SpotBugs analysis for test classes
test - Runs the unit tests.
verifyChecksums - Verifies checksums of the project dependencies

Current Behavior

Currently Gradle sorts task groups by lexicographical order.
It makes it hard to understand "where" to look for the required task.

Context

I'm migrating Apache JMeter's build to Gradle, and having "sensible" task order would simplify user experience, especially for Gradle newbies.

@vlsi vlsi added a:feature A new functionality from:contributor labels Jul 31, 2019
@vlsi vlsi changed the title Sort tasks in gradlew tasks groups by "lifecycle" or something like that gradlew tasks should sort tasks groups according to a lifecycle or something like that Jul 31, 2019
@stale
Copy link

stale bot commented Oct 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Oct 6, 2020
@vlsi
Copy link
Contributor Author

vlsi commented Oct 6, 2020

This is still relevant

@stale stale bot removed the stale label Oct 6, 2020
@ljacomet ljacomet added in:reporting-tasks help dependencyInsight dependencies and removed to-triage labels Jul 12, 2021
@stale
Copy link

stale bot commented Aug 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@vlsi
Copy link
Contributor Author

vlsi commented Aug 12, 2022

I think this is still relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:reporting-tasks help dependencyInsight dependencies
Projects
None yet
Development

No branches or pull requests

4 participants