Skip to content

Commit

Permalink
[#31] Re-organise TOML and gradle files (#32)
Browse files Browse the repository at this point in the history
* [#29] Create buildScr module for ProjectSettings

* [#31] Re-organise TOML and gradle files
  • Loading branch information
mustafaozhan authored Nov 5, 2023
1 parent e317f21 commit 9c8943f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 32 deletions.
20 changes: 12 additions & 8 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
libs.plugins.apply {
alias(kotlinMultiplatform)
alias(androidApplication)
alias(jetbrainsCompose)
}
}

kotlin {
Expand Down Expand Up @@ -33,9 +35,11 @@ kotlin {
sourceSets {
val androidMain by getting {
dependencies {
implementation(libs.compose.ui)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.androidx.activity.compose)
libs.android.apply {
implementation(composeUi)
implementation(composeUiToolingPreview)
implementation(activityCompose)
}
}
}
val commonMain by getting {
Expand Down Expand Up @@ -76,7 +80,7 @@ android {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
packaging {
resources {
Expand All @@ -90,7 +94,7 @@ android {
}

dependencies {
debugImplementation(libs.compose.ui.tooling)
debugImplementation(libs.android.composeUiTooling)
}
}

40 changes: 16 additions & 24 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
[versions]
compose = "1.5.4"
compose-plugin = "1.5.3"
compose-compiler = "1.5.3"
agp = "8.1.2"
androidx-activityCompose = "1.8.0"
androidx-core-ktx = "1.12.0"
androidx-appcompat = "1.6.1"
androidx-material = "1.10.0"
androidx-constraintlayout = "2.1.4"
androidx-espresso-core = "3.5.1"
kotlin = "1.9.10"
atomicfu = "0.17.3"
kover = "0.6.1"
compose = "1.5.4"
jetbrainsCompose = "1.5.3"
composeCompiler = "1.5.3"
androidGradlePlugin = "8.1.2"
androidx-activityCompose = "1.8.0"

[libraries]
# COMMON
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
compose-material = { module = "androidx.compose.material:material", version.ref = "compose" }
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core-ktx" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidx-appcompat" }
androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
common-ComposeCompiler = { module = "androidx.compose.compiler:compiler", version.ref = "composeCompiler" } # Workaround for compose compiler update

# ANDROID
android-activityCompose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
android-composeUi = { module = "androidx.compose.ui:ui", version.ref = "compose" }
android-composeUiTooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
android-composeUiToolingPreview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }

# Classpaths
# CLASSPATHS
classpaths-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }

[plugins]
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
androidApplication = { id = "com.android.application", version.ref = "agp" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "jetbrainsCompose" }
androidApplication = { id = "com.android.application", version.ref = "androidGradlePlugin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
atomicfu = { id = "kotlinx-atomicfu" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }

0 comments on commit 9c8943f

Please sign in to comment.