diff --git a/PennMobile/build.gradle b/PennMobile/build.gradle index cafd8feb7..d76d00a63 100644 --- a/PennMobile/build.gradle +++ b/PennMobile/build.gradle @@ -5,6 +5,8 @@ plugins { alias(libs.plugins.firebase.crashlytics) id 'jacoco' id 'kotlin-parcelize' + id 'com.google.dagger.hilt.android' + id 'kotlin-kapt' } android { @@ -31,6 +33,10 @@ android { kotlinOptions { jvmTarget = "1.8" } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } defaultConfig { minSdkVersion 26 targetSdkVersion 34 @@ -107,9 +113,16 @@ dependencies { implementation libs.bundles.ui implementation libs.bundles.google + implementation libs.hilt.android + kapt libs.hilt.compiler + testImplementation libs.junit } +kapt { + correctErrorTypes true +} + String getPlatformClientID() { def propFile = rootProject.file("./local.properties") def properties = new Properties() diff --git a/PennMobile/src/main/res/layout/activity_main.xml b/PennMobile/src/main/res/layout/activity_main.xml index 6c8ddfeae..542efa4bd 100644 --- a/PennMobile/src/main/res/layout/activity_main.xml +++ b/PennMobile/src/main/res/layout/activity_main.xml @@ -1,5 +1,6 @@ diff --git a/build.gradle b/build.gradle index 443c9864d..c996427ca 100644 --- a/build.gradle +++ b/build.gradle @@ -4,4 +4,6 @@ plugins { alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.google.services) apply false alias(libs.plugins.firebase.crashlytics) apply false + alias(libs.plugins.dagger.hilt) apply false + } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 214be2871..6cc99315b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -55,6 +55,9 @@ retrofit = "2.9.0" rxandroidVersion = "1.2.1" rxjava1 = "1.3.8" testng = "7.8.0" +hilt-android = "2.51.1" +hilt-compiler = "2.51.1" +dagger-hilt = "2.51.1" [libraries] @@ -123,12 +126,15 @@ reactivex-rxandroid = { module = "io.reactivex:rxandroid", version.ref = "rxandr retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } rxjava = { module = "io.reactivex:rxjava", version.ref = "rxjava1" } testng = { module = "org.testng:testng", version.ref = "testng" } +hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt-android"} +hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt-compiler"} [plugins] android-application = { id = "com.android.application", version.ref = "agp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } google-services = { id = "com.google.gms.google-services", version.ref = "googleServices"} firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebaseCrashalytics"} +dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger-hilt"} [bundles]