Skip to content

Commit

Permalink
fix android
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahriyar13 committed Nov 17, 2023
1 parent 8678936 commit 904d755
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
25 changes: 20 additions & 5 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,47 @@ android {
}
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = Versions.composeCompiler
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
pickFirsts.add(
"META-INF/INDEX.LIST"
)
excludes.addAll(
listOf(
"META-INF/AL2.0",
"META-INF/LGPL2.1",
),
)
}
}
buildTypes {

getByName("release") {
isMinifyEnabled = true
}

getByName("debug") {
isMinifyEnabled = false
}

}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "21"
jvmTarget = "11"
}
}

dependencies {
implementation(project(":shared"))
implementation("androidx.activity:activity-compose:1.8.0")
implementation(Deps.Androidx.Activity.activityCompose)

// Koin
with(Deps.Koin) {
Expand Down
6 changes: 6 additions & 0 deletions buildSrc/src/main/java/com/mocoding/pokedex/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ object Deps {
}
}

object Androidx {
object Activity {
const val activityCompose = "androidx.activity:activity-compose:${Versions.activityCompose}"
}
}

object Io {
object Ktor {
const val ktorClientCore = "io.ktor:ktor-client-core:${Versions.ktor}"
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/java/com/mocoding/pokedex/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.mocoding.pokedex
object Versions {
const val gradlePlugin = "8.1.3"
const val kotlin = "1.9.20"
const val activityCompose = "1.8.0"
const val compose = "1.5.10"
const val composeCompiler = "1.5.4"
const val coroutines = "1.7.3"
Expand All @@ -14,7 +15,7 @@ object Versions {
const val sqlDelight = "2.0.0"
const val koin = "3.5.2-RC1"
const val imageLoader = "1.7.1"
const val logbackClassic = "1.4.11"
const val logbackClassic = "1.2.11" // Do not update it unless you read documentation of change, then all okHttps not works in android
const val kotlinWrappersBom = "1.0.0-pre.641"
const val touchlab = "2.0.5"
}
2 changes: 1 addition & 1 deletion desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "1.0.0-SNAPSHOT"

kotlin {
jvm {
jvmToolchain(21)
jvmToolchain(11)
withJava()
}
sourceSets {
Expand Down
12 changes: 7 additions & 5 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ plugins {

@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
kotlin {
jvm("desktop")
jvm("desktop") {
jvmToolchain(11)
}

androidTarget{
compilations.all {
kotlinOptions {
jvmTarget = "21"
jvmTarget = "11"
}
}
}
Expand Down Expand Up @@ -166,7 +168,7 @@ kotlin {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "21"
kotlinOptions.jvmTarget = "11"
}
}

Expand All @@ -177,8 +179,8 @@ android {
minSdk = Configuration.minSdk
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

Expand Down

0 comments on commit 904d755

Please sign in to comment.