How to use interactive build time

in our ant build function it would ask us what version of our project we wanted to build. We’d give it the version ( GitHub - Bearsampp/module-composer: 📦 Composer module for Bearsampp project ) for an example repo.
Can we reliably do that with gradle? Claude AI said interactive is not a good thing to use.

Using System.console() is not a good idea, as it will not work in most cases.

But using anything based on System.in should work just fine.

For a built-in integrated solution you currently would have to use Gradle internals.

Another option would be to use a graphical UI like opening a Swing dialog.

See also Can't use System.console() with the Gradle Daemon · Issue #1251 · gradle/gradle · GitHub for more information.