Display on a web page information about a running gradle build

I’m running a gradle build on a server.
I want to display on a web page the percentage of execution of the build.
Can I, from an external groovy script, get this kind of information about a running gradle build ?

You can use the Tooling API and register progress listeners to get that info.

1 Like


I’ve tried :

But it doesn’t give me information about the percentage of progress of the build.

The percentage complete is not a trivial value to calculate. Many tools (eg TeamCity) don’t know the percentage remaining / complete for the first build. It’s only the second (and subsequent) build where you can compare the current build with the previous build.

You might need to store some statistics about the previous build in order to estimate the time / percentage remaining.

I know it’s not trivial, that’s why i want to use the one calculated and displayed by Gradle during the build… to avoid to calculate it by myself. even it’s not accurate, i just need an indicator of the progress…

All the percentage calculation on the CLI does is use the percentage of tasks executed of the total list of tasks. There’s no time aspect.

@CedricChampeau @etiennestuder @adammurdoch Is it possible to get the “execution plan” via the Tooling API? I had a quick look, but couldn’t see how to get this.

Right now: no, you cannot.