Skip to content

Commit d81654a

Browse files
java-team-github-botDagger Team
authored andcommitted
Automatically configure HiltTestApplication in manifest for Hilt Android tests.
RELNOTES=Automatically configure HiltTestApplication in manifest for Hilt Android tests. This will also modify the application:label, so tests depending on a specific application:label might need adjustment PiperOrigin-RevId: 928679999
1 parent 5988296 commit d81654a

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2026 The Dagger Authors.
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<!-- Manifest that sets the application class to HiltTestApplication. -->
18+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
19+
package="dagger.hilt.android.testing" >
20+
21+
<application
22+
android:name="dagger.hilt.android.testing.HiltTestApplication" />
23+
24+
</manifest>

hilt-android-testing/main/java/dagger/hilt/android/testing/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ android_library(
111111
srcs = [
112112
"HiltTestApplication.java",
113113
],
114+
exports_manifest = 1,
115+
manifest = "AndroidManifest_hilttestapplication.xml",
114116
deps = [
115117
":on_component_ready_runner",
116118
":package_info",

0 commit comments

Comments
 (0)