Revert "fix: configure Dagger Hilt for DI"

This reverts commit 874d32bc4c.
This commit is contained in:
Akash Yadav
2024-06-19 09:07:30 +05:30
parent c806ece666
commit 788ae2dfaf
12 changed files with 16 additions and 153 deletions
@@ -37,7 +37,6 @@ dependencies {
implementation(projects.buildLogic.propertiesParser)
implementation("com.android.tools.build:gradle:${libs.versions.agp.asProvider().get()}")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.asProvider().get()}")
implementation(libs.maven.publish)
implementation(libs.common.jkotlin)
@@ -40,10 +40,7 @@ class AndroidIDEPlugin : Plugin<Project> {
return@run
}
// Apply dependency injection for all modules
plugins.apply(DIConfigPlugin::class.java)
if (this.isAndroidModule && !isFDroidBuild) {
if (isAndroidModule && !isFDroidBuild) {
// setup signing configuration
plugins.apply(SigningConfigPlugin::class.java)
}
@@ -58,7 +55,7 @@ class AndroidIDEPlugin : Plugin<Project> {
}
val taskName = when {
this.isAndroidModule -> "testDebugUnitTest"
isAndroidModule -> "testDebugUnitTest"
else -> "test"
}
@@ -1,42 +0,0 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide.plugins
import com.itsaky.androidide.plugins.util.isAndroidModule
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
/**
* Configures dependency injection in a module.
*
* @author Akash Yadav
*/
class DIConfigPlugin : Plugin<Project> {
override fun apply(target: Project) = target.run {
dependencies.add("implementation", "javax.inject:javax.inject:1")
if (isAndroidModule) {
val libs =
rootProject.extensions.getByType(VersionCatalogsExtension::class.java).named("libs")
val hiltAndroid = libs.findLibrary("hilt-android").get().get()
dependencies.add("implementation", hiltAndroid)
}
Unit
}
}