jvmbytecode-manipulationdagger-hiltjvm-bytecode

What is bytecode transformation?


While reading a documentation of dagger-hilt, I came across such a term "bytecode transformation". What is bytecode transformation ?

the complete sentence

The Hilt Gradle plugin runs a bytecode transformation to make the APIs easier to use.

What is the benefit of using bytecode transformation ?


Solution

  • Bytecode transformation happens after compilation and before dexing. Its input is bytecode and output is bytecode.

    Android tools team has privately announced that the existing bytecode transformation API is going to be deprecated and replaced with new ones. Hopefully they will publish bytecode transformations soon.

    Readmore: