Skip to content

Commit 1432c37

Browse files
danysantiagoDagger Team
authored and
Dagger Team
committed
Add hilt-android to the Gradle projects
Also consolodiate and move proguard files to resources directories. RELNOTES=N/A PiperOrigin-RevId: 761944231
1 parent f284b86 commit 1432c37

File tree

22 files changed

+887
-42
lines changed

22 files changed

+887
-42
lines changed

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ kotlin.stdlib.default.dependency=false
2323
# Required by AGP for androidx dependency usages
2424
android.useAndroidX=true
2525

26+
# Required to be disabled by KAPT since the option is deprecated
27+
kapt.include.compile.classpath=false
28+
2629
# Publish version
2730
# TODO(danysantiago): Find a configurable location for the publishing version.
2831
PUBLISH_VERSION=LOCAL-SNAPSHOT

gradle/libs.versions.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ androidMinSdk = "21"
55
autoFactory = "1.0"
66
autoService = "1.0"
77
autoValue = "1.9"
8+
lifecycle = "2.5.1"
89
lint = "30.3.1"
910
guava = "33.0.0-jre"
1011
gradleIncap = "0.2"
@@ -24,6 +25,9 @@ androidx-annotations = { module = "androidx.annotation:annotation", version = "1
2425
androidx-activity = { module = "androidx.activity:activity", version = "1.5.1" }
2526
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.3.1" }
2627
androidx-fragment = { module = "androidx.fragment:fragment", version = "1.5.1" }
28+
androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle" }
29+
androidx-lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "lifecycle" }
30+
androidx-savedstate = { module = "androidx.savedstate:savedstate", version = "1.2.0" }
2731
androidx-lint = { module = "androidx.lint:lint-gradle", version = "1.0.0-alpha04" }
2832
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version = "1.2.1" }
2933
auto-common = { module = "com.google.auto:auto-common", version = "1.2.1" }
@@ -37,15 +41,12 @@ binaryCompatibilityValidatorPlugin = { module = "org.jetbrains.kotlinx:binary-co
3741
checkerFramework = { module = "org.checkerframework:checker-compat-qual", version = "2.5.3" }
3842
errorprone-annotations = { module = "com.google.errorprone:error_prone_annotations", version = "2.23.0" }
3943
findBugs = { module = "com.google.code.findbugs:jsr305", version = "3.0.1" }
40-
javaFormatter = { module = "com.google.googlejavaformat:google-java-format", version = "1.5" }
41-
javaCompileTesting = { module = "com.google.testing.compile:compile-testing", version = "0.18" }
42-
lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "lint" }
43-
lint-checks = { module = "com.android.tools.lint:lint-checks", version.ref = "lint" }
44-
lint-tests = { module = "com.android.tools.lint:lint-tests", version.ref = "lint" }
4544
guava-jre = { module = "com.google.guava:guava", version.ref = "guava" }
4645
guava-failureAccess = { module = "com.google.guava:failureaccess", version = "1.0.1" }
4746
gradleIncap-annotations = { module = "net.ltgt.gradle.incap:incap", version.ref = "gradleIncap" }
4847
gradleIncap-compiler = { module = "net.ltgt.gradle.incap:incap-processor", version.ref = "gradleIncap" }
48+
javaFormatter = { module = "com.google.googlejavaformat:google-java-format", version = "1.5" }
49+
javaCompileTesting = { module = "com.google.testing.compile:compile-testing", version = "0.18" }
4950
jakarta-inject = { module = "jakarta.inject:jakarta.inject-api", version = "2.0.1" }
5051
javaPoet = { module = "com.squareup:javapoet", version = "1.13.0" }
5152
javax-inject = { module = "javax.inject:javax.inject", version = "1" }
@@ -62,6 +63,9 @@ ksp = { module = "com.google.devtools.ksp:symbol-processing", version.ref = "ksp
6263
ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
6364
ksp-common = { module = "com.google.devtools.ksp:symbol-processing-common-deps", version.ref = "ksp" }
6465
ksp-embeddable = { module = "com.google.devtools.ksp:symbol-processing-aa-embeddable", version.ref = "ksp" }
66+
lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "lint" }
67+
lint-checks = { module = "com.android.tools.lint:lint-checks", version.ref = "lint" }
68+
lint-tests = { module = "com.android.tools.lint:lint-tests", version.ref = "lint" }
6569
publishPlugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "publish" }
6670
robolectric = { module = "org.robolectric:robolectric", version = "4.14.1" }
6771
truth = { module = "com.google.truth:truth", version.ref = "truth" }

hilt-android/BUILD

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ gen_maven_artifact(
139139
manifest = "AndroidManifest.xml",
140140
packaging = "aar",
141141
proguard_and_r8_specs = [
142-
"//hilt-core/main/java/dagger/hilt:proguard-rules.pro",
143-
"//hilt-android/main/java/dagger/hilt/android:proguard-rules.pro",
144-
"//hilt-android/main/java/dagger/hilt/internal:proguard-rules.pro",
142+
"//hilt-core/main/main/resources:proguard",
143+
"//hilt-android/main/resources:proguard",
145144
],
146145
)

0 commit comments

Comments
 (0)