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(javax.annotation.processing.ProcessingEnvironment env)static GradleProjectTypegetGradleProjectType(javax.annotation.processing.ProcessingEnvironment env)Returns project type or null if Hilt Gradle Plugin is not applied.static java.util.Set<java.lang.String>getProcessorOptions()static booleanisAndroidSuperclassValidationDisabled(javax.lang.model.element.TypeElement element, javax.annotation.processing.ProcessingEnvironment env)Returnstrueif the superclass validation is disabled fordagger.hilt.android.AndroidEntryPoint-annotated classes.static booleanisCrossCompilationRootValidationDisabled(com.google.common.collect.ImmutableSet<javax.lang.model.element.TypeElement> rootElements, javax.annotation.processing.ProcessingEnvironment env)Returnstrueif cross-compilation root validation is disabled.static booleanisModuleInstallInCheckDisabled(javax.annotation.processing.ProcessingEnvironment env)Returnstrueif the check fordagger.hilt.InstallInis disabled.static booleanisSharedTestComponentsEnabled(javax.annotation.processing.ProcessingEnvironment env)Returnstrueof unit tests should try to share generated components, rather than using separate generated components per Hilt test root.static booleanuseAggregatingRootProcessor(javax.annotation.processing.ProcessingEnvironment env)Returnstrueif the aggregating processor is enabled (default istrue).
-
-
-
Method Detail
-
isAndroidSuperclassValidationDisabled
public static boolean isAndroidSuperclassValidationDisabled(javax.lang.model.element.TypeElement element, javax.annotation.processing.ProcessingEnvironment env)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<javax.lang.model.element.TypeElement> rootElements, javax.annotation.processing.ProcessingEnvironment 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(javax.annotation.processing.ProcessingEnvironment env)
Returnstrueif the check fordagger.hilt.InstallInis disabled.
-
isSharedTestComponentsEnabled
public static boolean isSharedTestComponentsEnabled(javax.annotation.processing.ProcessingEnvironment 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(javax.annotation.processing.ProcessingEnvironment env)
Returnstrueif the aggregating processor is enabled (default istrue).Note:This is for internal use only!
-
getGradleProjectType
public static GradleProjectType getGradleProjectType(javax.annotation.processing.ProcessingEnvironment env)
Returns project type or null if Hilt Gradle Plugin is not applied.Note:This is for internal use only!
-
checkWrongAndDeprecatedOptions
public static void checkWrongAndDeprecatedOptions(javax.annotation.processing.ProcessingEnvironment env)
-
getProcessorOptions
public static java.util.Set<java.lang.String> getProcessorOptions()
-
-