Skip to content

Commit

Permalink
Merge pull request #684 from igorescodro/cleanup/libs
Browse files Browse the repository at this point in the history
🧹 Clean up unused libraries and dependencies
  • Loading branch information
igorescodro authored May 20, 2024
2 parents 5f26d06 + d183bcc commit 86f9f31
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 230 deletions.
16 changes: 0 additions & 16 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,12 @@ dependencies {
implementation(projects.shared)
implementation(projects.libraries.navigation)

implementation(platform(libs.compose.bom))

implementation(libs.logcat)
implementation(libs.androidx.activity)
implementation(libs.androidx.appcompat)
implementation(libs.compose.activity)
implementation(libs.androidx.playcore)
implementation(libs.koin.core)

androidTestUtil(libs.test.orchestrator)

androidTestImplementation(projects.libraries.androidTest)
androidTestImplementation(libs.koin.test)
androidTestImplementation(libs.test.rules)
androidTestImplementation(libs.test.hamcrest)
androidTestImplementation(libs.bundles.composetest) {
exclude(group = "androidx.core", module = "core-ktx")
exclude(group = "androidx.fragment", module = "fragment")
exclude(group = "androidx.customview", module = "customview")
exclude(group = "androidx.activity", module = "activity")
exclude(group = "androidx.lifecycle", module = "lifecycle-runtime")
}
}

fun readProperties(propertiesFile: File) = Properties().apply {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.mpp.stability.nowarn=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
moko.resources.disableStaticFrameworkWarning=true

# Ignore AtomicFU warnings - will be fixed in Kotlin 2.0
# (https://github.com/Kotlin/kotlinx-atomicfu/issues/376
Expand Down
19 changes: 3 additions & 16 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ annotation = "1.8.0"
# Compose
compose_bom = "2024.05.00"
compose_activity = "1.9.0"
jb_compose_compiler = "1.6.10-rc03"
compose_compiler = "1.6.10-rc03"
compose_windowsizeclass = "0.5.0"

# Koin
Expand All @@ -63,10 +63,6 @@ voyager = "1.1.0-alpha04"
# Test
test_junit = "4.13.2"
test_uiautomator = "2.3.0"
test_barista = "4.3.0"
test_orchestrator = "1.4.2"
test_rules = "1.5.0"
test_hamcrest = "2.2"
test_junit4_android = "1.6.7"
test_manifest = "1.6.7"

Expand Down Expand Up @@ -111,12 +107,8 @@ androidx_annotation = { module = "androidx.annotation:annotation", version.ref =

compose_bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose_bom" }
compose_ui = { module = "androidx.compose.ui:ui" }
compose_toolingpreview = { module = "androidx.compose.ui:ui-tooling-preview" }
compose_icons = { module = "androidx.compose.material:material-icons-extended" }
compose_material3 = { module = "androidx.compose.material3:material3" }
compose_uitest = { module = "androidx.compose.ui:ui-test" }
compose_junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
compose_manifest = { module = "androidx.compose.ui:ui-test-manifest" }
compose_windowsizeclass = { module = "dev.chrisbanes.material3:material3-window-size-class-multiplatform", version.ref = "compose_windowsizeclass" }

# Dynamic Feature don't recognize BOM
Expand Down Expand Up @@ -148,10 +140,6 @@ voyager_bottomsheet = { module = "cafe.adriel.voyager:voyager-bottom-sheet-navig
# Test
test_junit = { module = "junit:junit", version.ref = "test_junit" }
test_uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "test_uiautomator" }
test_barista = { module = "com.adevinta.android:barista", version.ref = "test_barista" }
test_orchestrator = { module = "androidx.test:orchestrator", version.ref = "test_orchestrator" }
test_rules = { module = "androidx.test:rules", version.ref = "test_rules" }
test_hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "test_hamcrest" }

test-junit4-android = { module = "androidx.compose.ui:ui-test-junit4-android", version.ref = "test_junit4_android" }
test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "test_manifest" }
Expand All @@ -166,14 +154,13 @@ aboutlibraries_plugin = { module = "com.mikepenz.aboutlibraries.plugin:aboutlibr
aboutlibraries_ui = { module = "com.mikepenz:aboutlibraries-compose", version.ref = "aboutlibraries" }

[bundles]
compose = ["compose.ui", "compose.toolingpreview", "compose.icons", "compose.material3"]
composetest = ["compose.uitest", "compose.junit4", "compose.manifest"]
compose = ["compose.ui", "compose.icons", "compose.material3"]

[plugins]
kotlin_serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
dependencyanalysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyanalysis" }
sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" }
compose = { id = "org.jetbrains.compose", version.ref = "jb_compose_compiler" }
compose = { id = "org.jetbrains.compose", version.ref = "compose_compiler" }
moko_multiplatform_resources = { id = "dev.icerock.mobile.multiplatform-resources" }

compose_compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Expand Down
1 change: 0 additions & 1 deletion libraries/android-test/.gitignore

This file was deleted.

27 changes: 0 additions & 27 deletions libraries/android-test/build.gradle.kts

This file was deleted.

Empty file.
21 changes: 0 additions & 21 deletions libraries/android-test/proguard-rules.pro

This file was deleted.

1 change: 0 additions & 1 deletion libraries/android-test/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

15 changes: 2 additions & 13 deletions plugins/src/main/java/com.escodro.android-compose.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import extension.androidConfig
import extension.composeBundle
import extension.composeConfig
import extension.composeTestBundle
import extension.proguardConfig

plugins {
Expand All @@ -15,13 +14,11 @@ val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().name
android {
androidConfig(libs)
proguardConfig()
composeConfig(libs)
composeConfig()

kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf(
"-Xstring-concat=inline"
)
freeCompilerArgs = listOf("-Xstring-concat=inline")
}
}

Expand All @@ -30,12 +27,4 @@ dependencies {
implementation(libs.composeBundle)
implementation(platform(libs.composeBom))
implementation(libs.kotlinxCollectionsImmutable)

androidTestImplementation(libs.composeTestBundle) {
exclude(group = "androidx.core", module = "core-ktx")
exclude(group = "androidx.fragment", module = "fragment")
exclude(group = "androidx.customview", module = "customview")
exclude(group = "androidx.activity", module = "activity")
exclude(group = "androidx.lifecycle", module = "lifecycle-runtime")
}
}
15 changes: 6 additions & 9 deletions plugins/src/main/java/com.escodro.android-dynamic.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import extension.androidDependencies
import extension.sdkCompile
import extension.sdkMin
import extension.androidDependencies
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
kotlin("multiplatform")
id("com.android.dynamic-feature")
id("com.escodro.kotlin-quality")
}

val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
kotlin {
applyDefaultHierarchyTemplate()

val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")

androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_2_0)
}
}

Expand All @@ -28,8 +27,6 @@ kotlin {
}
}

val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")

android {
compileSdk = Integer.parseInt(libs.sdkCompile)
defaultConfig {
Expand Down
11 changes: 5 additions & 6 deletions plugins/src/main/java/com.escodro.multiplatform.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import extension.sdkCompile
import extension.sdkMin
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
kotlin("multiplatform")
id("com.android.library")
id("com.escodro.kotlin-quality")
}

val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
kotlin {
applyDefaultHierarchyTemplate()

androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_2_0)
}
}
}

val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")

android {
compileSdk = Integer.parseInt(libs.sdkCompile)
defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion plugins/src/main/java/extension/CommonExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fun CommonExtension<*, *, *, *, *, *>.androidConfig(libs: VersionCatalog) {
}
}

fun CommonExtension<*, *, *, *, *, *>.composeConfig(libs: VersionCatalog) {
fun CommonExtension<*, *, *, *, *, *>.composeConfig() {
buildFeatures {
compose = true
}
Expand Down
Loading

0 comments on commit 86f9f31

Please sign in to comment.