Implementation details of Gradle


(SirWindfield) #1

I couldn’t think of any other place to ask you guys and girls out there who worked hard on Gradle. Sorry if I create any inconvenience.

So I am currently writing an application in Ruby and was looking for some way to achieve the same output as Gradle, having specific lines always displayed on the same line. I got the basic idea of using ‘\r’ (carriage return) but I was wondering how Gradle is able to output other stuff (like tests passed and build process) above the static build process line (the bold one at the bottom). I couldn’t get a ‘scroll’ or ‘log view’ effect like this going and wanted to ask you for some help here.

Could you explain it to me on how it’s done or link me to the source code? I wasn’t able to find it.


(Luke Daley) #2

It boils down to using https://en.wikipedia.org/wiki/ANSI_escape_code

There are a few gems available to make this easier, such as https://github.com/geemus/formatador.

Good luck!