mill.androidlib.hilt

Members list

Type members

Classlikes

Trait for mixing in AndroidAppKotlinModule to support the Hilt Dependency Injection framework for Android.

Trait for mixing in AndroidAppKotlinModule to support the Hilt Dependency Injection framework for Android.

It prepends compilation steps by using Kotlin Symbol Processing for pre-processing the Hilt annotations and generating the necessary classes for Hilt to work, then compiles all the sources together with a Java pre-processor step and finally a transform ASM step to achieve the compile time dependency injection!

Usage:

object app extends AndroidHiltSupport { ... }

Attributes

Source
AndroidHiltSupport.scala
Supertypes
trait KspModule
trait KotlinModule
trait JavaModule
trait RunModule
trait RunModuleApi
trait BspModule
trait BspModuleApi
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all

A module that can be used to run bytecode transformations with mill.androidlib.hilt.AndroidHiltTransformAsm to achieve Dependency Injection using Hilt .

A module that can be used to run bytecode transformations with mill.androidlib.hilt.AndroidHiltTransformAsm to achieve Dependency Injection using Hilt .

Attributes

Companion
object
Source
AndroidHiltTransform.scala
Supertypes
class RootModule0
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Known subtypes

Attributes

Companion
trait
Source
AndroidHiltTransform.scala
Supertypes
class RootModule0
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Self type

A standalone executable utility to transform compiled classes with Hilt dependency injection context.

A standalone executable utility to transform compiled classes with Hilt dependency injection context.

Example usage: java -classpath <classpath> mill.kotlinlib.android.hilt.AndroidHiltTransformAsm <input-directory> <output-directory> where the input directory is the directory containing the compiled classes and the output-directory an already existing directory to place the transformed classes.

The classes are only transformed if they contain the @AndroidEntryPoint or @HiltAndroidApp annotations, otherwise they are copied as is. This code is an adaptation of the gradle hilt plugin transformASM task that can be found in https://github.com/google/dagger/blob/b3d3443e3581b8530cd85929614a1765cd37b12c/java/dagger/hilt/android/plugin/main/src/main/kotlin/dagger/hilt/android/plugin/transform/AndroidEntryPointClassVisitor.kt#L122

Attributes

Source
AndroidHiltTransformAsm.scala
Supertypes
class Object
trait Matchable
class Any
Self type