Skip to content

Commit

Permalink
Merge pull request #83 from wordpress-mobile/build/remove-unused-depe…
Browse files Browse the repository at this point in the history
…ndencies

[Dependency Analysis] Remove Unused Dependencies
  • Loading branch information
ParaskP7 authored Aug 21, 2024
2 parents 0af39de + 918006e commit f74713d
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 8 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ ext {
wordpressUtilsVersion = "2.6.0"

// main
androidxAnnotationVersion = '1.6.0'
androidxAppcompatVersion = '1.4.2'
androidxCoreVersion = '1.12.0'
androidxDatastoreVersion = '1.0.0'
androidxConstraintlayoutVersion = '2.1.4'
androidxLifecycleVersion = '2.6.2'
androidxNavigationVersion = '2.5.3'
androidxFragmentVersion = '1.5.4'
androidxSwipeToRefreshVersion = '1.1.0'
chrisbanesPhotoviewVersion = '2.3.0'
glideVersion = '4.13.2'
Expand Down
2 changes: 1 addition & 1 deletion mediapicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion"

implementation "androidx.navigation:navigation-fragment-ktx:$androidxNavigationVersion"
implementation "androidx.fragment:fragment-ktx:$androidxFragmentVersion"
implementation "androidx.core:core-ktx:$androidxCoreVersion"
implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion"
implementation "androidx.constraintlayout:constraintlayout:$androidxConstraintlayoutVersion"
Expand Down
3 changes: 1 addition & 2 deletions mediapicker/domain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.plugin.parcelize'
id 'org.jetbrains.kotlin.kapt'
id 'maven-publish'
id "com.automattic.android.publish-to-s3"
}
Expand All @@ -28,7 +27,7 @@ android {
}

dependencies {
implementation "androidx.core:core-ktx:$androidxCoreVersion"
implementation "androidx.annotation:annotation:$androidxAnnotationVersion"

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion"
}
Expand Down
9 changes: 9 additions & 0 deletions mediapicker/source-camera/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ dependencies {
implementation "androidx.core:core-ktx:$androidxCoreVersion"
}

dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is actually needed because of 'androidx.core.content.FileProvider' on 'AndroidManifest.xml'.
exclude("androidx.core:core-ktx")
}
}
}

project.afterEvaluate {
publishing {
publications {
Expand Down
2 changes: 1 addition & 1 deletion mediapicker/source-device/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {

implementation "com.google.dagger:hilt-android:$gradle.ext.daggerVersion"
implementation "com.google.dagger:hilt-android-compiler:$gradle.ext.daggerVersion"
kapt "com.google.dagger:hilt-compiler:$gradle.ext.daggerVersion"
kapt "com.google.dagger:dagger-compiler:$gradle.ext.daggerVersion"
}

project.afterEvaluate {
Expand Down
9 changes: 9 additions & 0 deletions mediapicker/source-gif/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ dependencies {
implementation "org.wordpress:utils:$wordpressUtilsVersion"
}

dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is actually needed otherwise 'tenor' fails with 'NoClassDefFoundError' on 'GsonConverterFactory'.
exclude("com.squareup.retrofit2:converter-gson")
}
}
}

project.afterEvaluate {
publishing {
publications {
Expand Down
2 changes: 1 addition & 1 deletion mediapicker/source-wordpress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {

implementation "com.google.dagger:hilt-android:$gradle.ext.daggerVersion"
implementation "com.google.dagger:hilt-android-compiler:$gradle.ext.daggerVersion"
kapt "com.google.dagger:hilt-compiler:$gradle.ext.daggerVersion"
kapt "com.google.dagger:dagger-compiler:$gradle.ext.daggerVersion"

implementation "org.wordpress:utils:$wordpressUtilsVersion"

Expand Down
10 changes: 9 additions & 1 deletion sampleapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,18 @@ dependencies {

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion"

implementation "androidx.core:core-ktx:$androidxCoreVersion"
implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion"
implementation "com.google.android.material:material:$googleMaterialVersion"

implementation "com.google.dagger:hilt-android:$gradle.ext.daggerVersion"
kapt "com.google.dagger:hilt-compiler:$gradle.ext.daggerVersion"
}

dependencyAnalysis {
issues {
onUnusedDependencies {
// This dependency is not needed but it is kept to preserve the module's default configuration.
exclude(":mediapicker:source-wordpress")
}
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginManagement {
gradle.ext.agpVersion = '8.1.0'
gradle.ext.detektVersion = '1.19.0'
gradle.ext.automatticPublishToS3Version = '0.8.0'
gradle.ext.dependencyAnalysisVersion = '1.28.0'
gradle.ext.dependencyAnalysisVersion = '1.33.0'

plugins {
id 'io.gitlab.arturbosch.detekt' version gradle.ext.detektVersion
Expand Down

0 comments on commit f74713d

Please sign in to comment.