Skip to content

Commit

Permalink
Add flag to disable cross-compilation root validation.
Browse files Browse the repository at this point in the history
Fixes #2577

RELNOTES=Fixes #2577: Add flag to disable cross-compilation root validation.
PiperOrigin-RevId: 370573954
  • Loading branch information
bcorso authored and Dagger Team committed Apr 27, 2021
1 parent 2767538 commit 194ec84
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions hilt/compiler-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,18 @@ option.
Because the shared components must include entry points from every test class,
explicit `@EntryPoint` methods may not clash. Test `@EntryPoint` methods must
either be uniquely named across test classes, or must return the same type.

## Turning off the cross compilation root validation {#disable-cross-compilation-root-validation}

By default, Hilt checks that:

* If there are `@HiltAndroidTest` or `@HiltAndroidApp` usages in the current
compilation unit, then there cannot be `@HiltAndroidTest` usages in any
previous compilation units.
* If there are `@HiltAndroidApp` usages in the current compilation unit, then
there cannot be `@HiltAndroidApp` usages in any previous compilation units.

This check can sometimes be overly broad though, especially if in the middle of
a migration. To turn off this check, this flag can be used:

`-Adagger.hilt.disableCrossCompilationRootValidation=true`.

0 comments on commit 194ec84

Please sign in to comment.