Skip to content

Commit

Permalink
apply default hierarchy template and bump gradle version
Browse files Browse the repository at this point in the history
  • Loading branch information
SEAbdulbasit committed Mar 20, 2024
1 parent 9882b16 commit d2e1bd3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 59 deletions.
5 changes: 4 additions & 1 deletion desktopApp/src/jvmMain/kotlin/DesktopApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.*
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.WindowPosition
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import com.arkivanov.decompose.DefaultComponentContext
import com.arkivanov.decompose.ExperimentalDecomposeApi
import com.arkivanov.decompose.extensions.compose.jetbrains.lifecycle.LifecycleController
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
95 changes: 38 additions & 57 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,32 @@ plugins {
val ktorVersion = extra["ktor.version"]

kotlin {
android {
androidTarget() {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}

ios()
iosSimulatorArm64()
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "ComposeApp"
isStatic = true
}
}

jvm("desktop")
js(IR) {
browser()
}

applyDefaultHierarchyTemplate()

macosX64 {
binaries {
executable {
Expand All @@ -49,65 +60,36 @@ kotlin {
}

sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.runtime)
val desktopMain by getting

implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-json:$ktorVersion")
implementation("io.ktor:ktor-client-logging:$ktorVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation("io.github.qdsfdhvh:image-loader:1.2.10")
api("com.arkivanov.decompose:decompose:2.2.2")
api("com.arkivanov.decompose:extensions-compose-jetbrains:2.2.2-compose-experimental")
implementation("com.arkivanov.essenty:lifecycle:1.3.0")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
commonMain.dependencies {
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.runtime)

val androidMain by getting
val androidUnitTest by getting
val iosMain by getting {
dependsOn(commonMain)
}
val iosSimulatorArm64Main by getting {
dependsOn(iosMain)
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-json:$ktorVersion")
implementation("io.ktor:ktor-client-logging:$ktorVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation("io.github.qdsfdhvh:image-loader:1.2.10")
api("com.arkivanov.decompose:decompose:2.2.2")
api("com.arkivanov.decompose:extensions-compose-jetbrains:2.2.2-compose-experimental")
implementation("com.arkivanov.essenty:lifecycle:1.3.0")
}

val desktopMain by getting {
dependencies {
implementation(compose.desktop.common)
implementation("uk.co.caprica:vlcj:4.8.2")
}
desktopMain.dependencies {
implementation(compose.desktop.common)
implementation("uk.co.caprica:vlcj:4.8.2")
}

val jsMain by getting {
dependsOn(commonMain)
dependencies {
implementation(compose.html.core)
implementation("io.ktor:ktor-client-js:2.3.8")
implementation("io.ktor:ktor-client-json-js:2.2.1")
}
}

val macosMain by creating {
dependsOn(commonMain)
}
val macosX64Main by getting {
dependsOn(macosMain)
}
val macosArm64Main by getting {
dependsOn(macosMain)
jsMain.dependencies {
implementation(compose.html.core)
implementation("io.ktor:ktor-client-js:2.3.8")
implementation("io.ktor:ktor-client-json-js:2.2.1")
}
}
}
Expand All @@ -117,6 +99,5 @@ android {
compileSdk = 33
defaultConfig {
minSdk = 24
targetSdk = 33
}
}

0 comments on commit d2e1bd3

Please sign in to comment.