diff --git a/README.md b/README.md index 0e51670..da934be 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,11 @@ After using this repo as a template you have to do the following changes so you - Change `rootProject.name` to your projects name -## iOS +## Android +### [Build.gradle.kts](app/composeApp/build.gradle.kts)] +- Change `namespace` and `applicationId` to your projects name +## iOS ### [Config.xcconfig](app/iosApp/Configuration/Config.xcconfig) - Change `PRODUCT_NAME` and `PRODUCT_BUNDLE_IDENTIFIER` to your projects name diff --git a/app/composeApp/build.gradle.kts b/app/composeApp/build.gradle.kts index 42dbcc6..54a007d 100644 --- a/app/composeApp/build.gradle.kts +++ b/app/composeApp/build.gradle.kts @@ -1,16 +1,16 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { - alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidApplication) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) + alias(libs.plugins.kotlinMultiplatform) } kotlin { androidTarget { compilerOptions { - jvmTarget.set(JvmTarget.JVM_11) + jvmTarget.set(JvmTarget.JVM_17) } } @@ -46,13 +46,13 @@ kotlin { } android { - namespace = "dev.carlosmartino.triplogic" + namespace = "dev.carlosmartino.template" compileSdk = libs.versions.android.compileSdk .get() .toInt() defaultConfig { - applicationId = "dev.carlosmartino.triplogic" + applicationId = "dev.carlosmartino.template" minSdk = libs.versions.android.minSdk .get() .toInt() @@ -73,8 +73,8 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } } diff --git a/buildlogic/convention/src/main/kotlin/ComposeMultiplatformConventionPlugin.kt b/buildlogic/convention/src/main/kotlin/ComposeMultiplatformConventionPlugin.kt index ff09f55..eaae597 100644 --- a/buildlogic/convention/src/main/kotlin/ComposeMultiplatformConventionPlugin.kt +++ b/buildlogic/convention/src/main/kotlin/ComposeMultiplatformConventionPlugin.kt @@ -2,6 +2,7 @@ import dev.carlosmartino.plugins.libs import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.getByType import org.jetbrains.compose.ComposeExtension import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension @@ -18,6 +19,12 @@ class ComposeMultiplatformConventionPlugin : Plugin { extensions.configure { sourceSets.apply { + androidMain { + dependencies { + implementation(composeDeps.preview) + implementation(libs.findLibrary("libs.androidx.activity.compose").get()) + } + } commonMain { dependencies { implementation(composeDeps.runtime) @@ -28,9 +35,13 @@ class ComposeMultiplatformConventionPlugin : Plugin { implementation(composeDeps.animation) implementation(composeDeps.animationGraphics) implementation(composeDeps.components.resources) + implementation(composeDeps.components.uiToolingPreview) } } } } + + dependencies { + } } } diff --git a/buildlogic/convention/src/main/kotlin/dev/carlosmartino/plugins/KotlinAndroid.kt b/buildlogic/convention/src/main/kotlin/dev/carlosmartino/plugins/KotlinAndroid.kt index cd118f5..b74e2e1 100644 --- a/buildlogic/convention/src/main/kotlin/dev/carlosmartino/plugins/KotlinAndroid.kt +++ b/buildlogic/convention/src/main/kotlin/dev/carlosmartino/plugins/KotlinAndroid.kt @@ -9,7 +9,7 @@ internal fun Project.configureKotlinAndroid( extension: LibraryExtension, ) = extension.apply { val moduleName = path.split(":").drop(2).joinToString(".") - namespace = if (moduleName.isNotEmpty()) "dev.carlosmartino.platform.$moduleName" else "dev.carlosmartino.platform" + namespace = if (moduleName.isNotEmpty()) "dev.carlosmartino.$moduleName" else "dev.carlosmartino.platform" compileSdk = libs .findVersion("android.compileSdk")