Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.35 stopped supporting an additional @HiltAndroidApp in /androidTest sources #2577

Closed
dandc87 opened this issue Apr 26, 2021 · 5 comments · Fixed by #2578
Closed

2.35 stopped supporting an additional @HiltAndroidApp in /androidTest sources #2577

dandc87 opened this issue Apr 26, 2021 · 5 comments · Fixed by #2578

Comments

@dandc87
Copy link

dandc87 commented Apr 26, 2021

This commit introduced validation that now disallows both /main and /androidTest from containing @HiltAndroidApp roots.

We currently have this configuration to support a large suite of pre-Hilt tests. We're working on migrating everything but the change in semantics is quite a hurdle for us.

Could we get an opt-out path? Either a compiler flag or annotation like @DisableInstallInCheck?

@bcorso
Copy link

bcorso commented Apr 26, 2021

Hey Adam,

Sorry about this (just realized we forgot to add this to the release notes too)!

Your use case sounds valid, and we can add a compiler flag to opt-out of this validation.

Just to make sure I understand your use case -- your /androidTest only contains @HiltAndroidApp and not both @HiltAndroidApp and @HiltAndroidTest usages, right?

@dandc87
Copy link
Author

dandc87 commented Apr 26, 2021

Correct. We are not mixing @HiltAndroidApp and @HiltAndroidTest (I believe there was already validation preventing it)

copybara-service bot pushed a commit that referenced this issue Apr 26, 2021
Fixes #2577

RELNOTES=Fixes #2577: Add flag to disable cross-compilation root validation.
PiperOrigin-RevId: 370510885
copybara-service bot pushed a commit that referenced this issue Apr 26, 2021
Fixes #2577

RELNOTES=Fixes #2577: Add flag to disable cross-compilation root validation.
PiperOrigin-RevId: 370510885
copybara-service bot pushed a commit that referenced this issue Apr 27, 2021
Fixes #2577

RELNOTES=Fixes #2577: Add flag to disable cross-compilation root validation.
PiperOrigin-RevId: 370573954
@CookieXie
Copy link

how do i add this flag.
i tried like these but dont work
image

@CookieXie
Copy link

image

@Chang-Eric
Copy link
Member

Try setting it via javacOptions. See #2684 (comment) for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants