Is there a way to generate the documentation of a buildConfigField in gradle

66 Views Asked by At

I have in my gradle various buildConfigFields and I would like to generate the JavaDoc for one of those in the BuildConfig class.
I already have a comment in gradle

buildConfigField 'Integer', 'BACKGROUND_COUNTDOWN', '30 * 60 * 1000 - 10000' // 29 minutes, 50 seconds, the remaining 10 seconds are countdown shown in the foreground

I would like to have that comment written in JavaDoc above the corresponding constant in BuildConfig

/**
* 29 minutes, 50 seconds, the remaining 10 seconds are countdown shown in the foreground
*/
public static final Integer STOP_ALARM_BACKGROUND_COUNTDOWN = 30 * 60 * 1000 - 10000;

this way, when another programmer does Ctrl + Q on that constant, whenever they find it in the code, they see the comment as documentation, without having to go look it up in the gradle file.

enter image description here

Is such a thing even possible?

1

There are 1 best solutions below

3
Some random IT boy On

As per the official docs there seems to have a field called comment. It doesn't specify if it's a //-style comment or a javadoc-style comment; you might give that a try