Class HiltCompilerOptions
- java.lang.Object
-
- dagger.hilt.processor.internal.HiltCompilerOptions
-
public final class HiltCompilerOptions extends java.lang.ObjectHilt annotation processor options.
-
-
Constructor Summary
Constructors Constructor Description HiltCompilerOptions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckWrongAndDeprecatedOptions(androidx.room.compiler.processing.XProcessingEnv env)static GradleProjectTypegetGradleProjectType(androidx.room.compiler.processing.XProcessingEnv env)Returns project type or null if Hilt Gradle Plugin is not applied.static java.util.Set<java.lang.String>getProcessorOptions()static booleanisAndroidSuperClassValidationDisabled(androidx.room.compiler.processing.XTypeElement element)Returnstrueif the superclass validation is disabled fordagger.hilt.android.AndroidEntryPoint-annotated classes.static booleanisAssistedInjectViewModelsEnabled(androidx.room.compiler.processing.XTypeElement viewModelElement)static booleanisCrossCompilationRootValidationDisabled(com.google.common.collect.ImmutableSet<androidx.room.compiler.processing.XTypeElement> rootElements, androidx.room.compiler.processing.XProcessingEnv env)Returnstrueif cross-compilation root validation is disabled.static booleanisModuleInstallInCheckDisabled(androidx.room.compiler.processing.XProcessingEnv env)Returnstrueif the check fordagger.hilt.InstallInis disabled.static booleanisSharedTestComponentsEnabled(androidx.room.compiler.processing.XProcessingEnv env)Returnstrueof unit tests should try to share generated components, rather than using separate generated components per Hilt test root.static booleanuseAggregatingRootProcessor(androidx.room.compiler.processing.XProcessingEnv env)Returnstrueif the aggregating processor is enabled (default istrue).
-
-
-
Method Detail
-
isAndroidSuperClassValidationDisabled
public static boolean isAndroidSuperClassValidationDisabled(androidx.room.compiler.processing.XTypeElement element)
Returnstrueif the superclass validation is disabled fordagger.hilt.android.AndroidEntryPoint-annotated classes.This flag is for internal use only! The superclass validation checks that the super class is a generated
Hilt_class. This flag is disabled by the Hilt Gradle plugin to enable bytecode transformation to change the superclass.
-
isCrossCompilationRootValidationDisabled
public static boolean isCrossCompilationRootValidationDisabled(com.google.common.collect.ImmutableSet<androidx.room.compiler.processing.XTypeElement> rootElements, androidx.room.compiler.processing.XProcessingEnv env)Returnstrueif cross-compilation root validation is disabled.This flag should rarely be needed, but may be used for legacy/migration purposes if tests require the use of
dagger.hilt.android.HiltAndroidApprather thandagger.hilt.android.testing.HiltAndroidTest.Note that Hilt still does validation within a single compilation unit. In particular, a compilation unit that contains a
HiltAndroidAppusage cannot have otherHiltAndroidApporHiltAndroidTestusages in the same compilation unit.
-
isModuleInstallInCheckDisabled
public static boolean isModuleInstallInCheckDisabled(androidx.room.compiler.processing.XProcessingEnv env)
Returnstrueif the check fordagger.hilt.InstallInis disabled.
-
isSharedTestComponentsEnabled
public static boolean isSharedTestComponentsEnabled(androidx.room.compiler.processing.XProcessingEnv env)
Returnstrueof unit tests should try to share generated components, rather than using separate generated components per Hilt test root.Tests that provide their own test bindings (e.g. using
dagger.hilt.android.testing.BindValueor a testModule) cannot use the shared component. In these cases, a component will be generated for the test.
-
useAggregatingRootProcessor
public static boolean useAggregatingRootProcessor(androidx.room.compiler.processing.XProcessingEnv env)
Returnstrueif the aggregating processor is enabled (default istrue).Note:This is for internal use only!
-
getGradleProjectType
public static GradleProjectType getGradleProjectType(androidx.room.compiler.processing.XProcessingEnv env)
Returns project type or null if Hilt Gradle Plugin is not applied.Note:This is for internal use only!
-
isAssistedInjectViewModelsEnabled
public static boolean isAssistedInjectViewModelsEnabled(androidx.room.compiler.processing.XTypeElement viewModelElement)
-
checkWrongAndDeprecatedOptions
public static void checkWrongAndDeprecatedOptions(androidx.room.compiler.processing.XProcessingEnv env)
-
getProcessorOptions
public static java.util.Set<java.lang.String> getProcessorOptions()
-
-