Class HiltCompilerOptions
- java.lang.Object
-
- dagger.hilt.processor.internal.HiltCompilerOptions
-
public final class HiltCompilerOptions extends java.lang.Object
Hilt annotation processor options.
-
-
Constructor Summary
Constructors Constructor Description HiltCompilerOptions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkWrongAndDeprecatedOptions(androidx.room.compiler.processing.XProcessingEnv env)
static GradleProjectType
getGradleProjectType(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 boolean
isAndroidSuperClassValidationDisabled(androidx.room.compiler.processing.XTypeElement element)
Returnstrue
if the superclass validation is disabled fordagger.hilt.android.AndroidEntryPoint
-annotated classes.static boolean
isAssistedInjectViewModelsEnabled(androidx.room.compiler.processing.XTypeElement viewModelElement)
static boolean
isCrossCompilationRootValidationDisabled(com.google.common.collect.ImmutableSet<androidx.room.compiler.processing.XTypeElement> rootElements, androidx.room.compiler.processing.XProcessingEnv env)
Returnstrue
if cross-compilation root validation is disabled.static boolean
isModuleInstallInCheckDisabled(androidx.room.compiler.processing.XProcessingEnv env)
Returnstrue
if the check fordagger.hilt.InstallIn
is disabled.static boolean
isSharedTestComponentsEnabled(androidx.room.compiler.processing.XProcessingEnv env)
Returnstrue
of unit tests should try to share generated components, rather than using separate generated components per Hilt test root.static boolean
useAggregatingRootProcessor(androidx.room.compiler.processing.XProcessingEnv env)
Returnstrue
if the aggregating processor is enabled (default istrue
).
-
-
-
Method Detail
-
isAndroidSuperClassValidationDisabled
public static boolean isAndroidSuperClassValidationDisabled(androidx.room.compiler.processing.XTypeElement element)
Returnstrue
if 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)
Returnstrue
if 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.HiltAndroidApp
rather thandagger.hilt.android.testing.HiltAndroidTest
.Note that Hilt still does validation within a single compilation unit. In particular, a compilation unit that contains a
HiltAndroidApp
usage cannot have otherHiltAndroidApp
orHiltAndroidTest
usages in the same compilation unit.
-
isModuleInstallInCheckDisabled
public static boolean isModuleInstallInCheckDisabled(androidx.room.compiler.processing.XProcessingEnv env)
Returnstrue
if the check fordagger.hilt.InstallIn
is disabled.
-
isSharedTestComponentsEnabled
public static boolean isSharedTestComponentsEnabled(androidx.room.compiler.processing.XProcessingEnv env)
Returnstrue
of 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.BindValue
or 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)
Returnstrue
if 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()
-
-