Skip to content

Commit

Permalink
[feature/hilt-ksp] Apply ksp on hilt (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
l2hyunwoo authored Sep 9, 2023
1 parent 7ffc045 commit b4cc8fc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 17 deletions.
3 changes: 0 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ dependencies {

implementation(libs.bundles.mavericks)

implementation(libs.hilt)
kapt(libs.hilt.kapt)

implementation(platform(libs.firebase))
implementation(libs.bundles.firebase)
implementation(libs.sentry.compose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ import org.gradle.kotlin.dsl.getByType
class AndroidHiltPlugin : Plugin<Project> {
override fun apply(target: Project) = with(target) {
with(plugins) {
apply("com.google.devtools.ksp")
apply("com.google.dagger.hilt.android")
}

val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
dependencies {
"implementation"(libs.findLibrary("hilt").get())
"kapt"(libs.findLibrary("hilt.kapt").get())
"ksp"(libs.findLibrary("hilt.ksp").get())
"testImplementation"(libs.findLibrary("hilt.testing").get())
"kaptTest"(libs.findLibrary("hilt.testing.compiler").get())
"kspTest"(libs.findLibrary("hilt.testing.compiler").get())
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import org.sopt.official.stamp.BuildConfig
import org.sopt.official.stamp.di.constant.Soptamp
import org.sopt.stamp.di.constant.Constant
import org.sopt.stamp.di.constant.Strings
import org.sopt.official.stamp.di.constant.Constant
import org.sopt.official.stamp.di.constant.Strings
import timber.log.Timber
import java.security.KeyStore
import javax.inject.Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,15 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.sopt.official.stamp.BuildConfig
import org.sopt.stamp.di.constant.Constant
import org.sopt.stamp.di.constant.Strings
import org.sopt.official.stamp.di.constant.Constant
import org.sopt.official.stamp.di.constant.Strings
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
object ConstantModule {
@Provides
@Singleton
@Strings(Constant.SOPTAMP_API_KEY)
fun provideBaseUrl() = BuildConfig.SOPTAMP_API_KEY

@Provides
@Singleton
@Strings(Constant.SOPTAMP_DATA_STORE)
fun provideSoptampDataStoreKey() = BuildConfig.SOPTAMP_DATA_STORE_KEY
fun provideSoptampDataStoreKey(): String = BuildConfig.SOPTAMP_DATA_STORE_KEY
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sopt.stamp.di.constant
package org.sopt.official.stamp.di.constant

import javax.inject.Qualifier

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ mavericks-navigation = { module = "com.airbnb.android:mavericks-navigation", ver
mavericks-mockable = { module = "com.airbnb.android:mavericks-mocking", version.ref = "mavericks" }

hilt = { module = "com.google.dagger:hilt-android", version.ref = "dagger-hilt" }
hilt-kapt = { module = "com.google.dagger:hilt-compiler", version.ref = "dagger-hilt" }
hilt-ksp = { module = "com.google.dagger:hilt-compiler", version.ref = "dagger-hilt" }
hilt-plugin = { group = "com.google.dagger", name = "hilt-android-gradle-plugin", version.ref = "dagger-hilt" }
hilt-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "dagger-hilt" }
hilt-testing-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "dagger-hilt" }
Expand Down

0 comments on commit b4cc8fc

Please sign in to comment.