Usage of external tool in build

I am writing this in hopes to receive some guidenance on my project.

When building my app (Gadgetbridge), I would like to use a derivation of the Kaitai compiler during the build process. Here is how to build the compiler:

git clone -b serialization https://github.com/kaitai-io/kaitai_struct_compiler.git
cd kaitai_struct_compiler
sbt --error compilerJVM/stage

Then, the compiler needs to be invoked through a console command on every build.

Here is my question:

What's the most elegant way of using that compiler without violating F-Droids inclusion criteria?

Can I somehow pre-compile and package the compiler and download that while building the app?

Or do I need to build the compiler while building the app? If so, how would I ensure an installed instance of sbt?

Thanks!

Edited by Daniel Dakhno