diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 7e74ae51..c29fb014 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -45,7 +45,6 @@ kotlin { implementation(project(":core:ui")) implementation(project(":feature:home")) - implementation(projects.shared) implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) diff --git a/core/core/build.gradle.kts b/core/core/build.gradle.kts index aef9daf8..f0bfa61d 100644 --- a/core/core/build.gradle.kts +++ b/core/core/build.gradle.kts @@ -14,7 +14,7 @@ kotlin { } jvm("desktop") - + listOf( iosX64(), iosArm64(), @@ -27,20 +27,14 @@ kotlin { } sourceSets { - val desktopMain by getting - commonMain.dependencies { implementation(libs.kermit) - implementation(projects.shared) implementation(compose.runtime) implementation(compose.foundation) } commonTest.dependencies { implementation(libs.kotlin.test) } - desktopMain.dependencies { - implementation(compose.desktop.currentOs) - } } } diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index 184ee588..c4d71f5b 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -29,12 +29,9 @@ kotlin { } sourceSets { - val desktopMain by getting - commonMain.dependencies { implementation(project(":core:core")) - implementation(projects.shared) implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) @@ -44,9 +41,6 @@ kotlin { commonTest.dependencies { implementation(libs.kotlin.test) } - desktopMain.dependencies { - implementation(compose.desktop.currentOs) - } } } diff --git a/feature/home/build.gradle.kts b/feature/home/build.gradle.kts index f2be90b6..976105fa 100644 --- a/feature/home/build.gradle.kts +++ b/feature/home/build.gradle.kts @@ -29,13 +29,10 @@ kotlin { } sourceSets { - val desktopMain by getting - commonMain.dependencies { implementation(project(":core:core")) implementation(project(":core:ui")) - implementation(projects.shared) implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) @@ -45,9 +42,6 @@ kotlin { commonTest.dependencies { implementation(libs.kotlin.test) } - desktopMain.dependencies { - implementation(compose.desktop.currentOs) - } } } diff --git a/feature/home/src/commonMain/kotlin/com/stslex/feature/home/HomeScreen.kt b/feature/home/src/commonMain/kotlin/com/stslex/feature/home/HomeScreen.kt index c38fc7b6..52be83bb 100644 --- a/feature/home/src/commonMain/kotlin/com/stslex/feature/home/HomeScreen.kt +++ b/feature/home/src/commonMain/kotlin/com/stslex/feature/home/HomeScreen.kt @@ -1,16 +1,17 @@ package com.stslex.feature.home -import Greeting import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.material.Button +import androidx.compose.material.Icon import androidx.compose.material.MaterialTheme import androidx.compose.material.Text +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Home import androidx.compose.runtime.Composable import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue @@ -20,7 +21,6 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import org.jetbrains.compose.resources.ExperimentalResourceApi -import org.jetbrains.compose.resources.painterResource @OptIn(ExperimentalResourceApi::class) @Composable @@ -33,7 +33,7 @@ fun HomeScreen( .background(MaterialTheme.colors.background) ) { val defaultGreetState = "Hello World!" - val clickedGreetState = "Compose: ${Greeting().greet()}" + val clickedGreetState = "Compose: Greeting" var isClicked by remember { mutableStateOf(false) } val greetingText by remember { derivedStateOf { @@ -56,9 +56,10 @@ fun HomeScreen( Text(greetingText) } AnimatedVisibility(isClicked) { - Image( - painterResource("compose-multiplatform.xml"), - null + Icon( + imageVector = Icons.Default.Home, + contentDescription = null, + tint = MaterialTheme.colors.primary ) } } diff --git a/feature/home/src/commonMain/resources/compose-multiplatform.xml b/feature/home/src/commonMain/resources/compose-multiplatform.xml deleted file mode 100644 index d7bf7955..00000000 --- a/feature/home/src/commonMain/resources/compose-multiplatform.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 33eb1987..bfc43670 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,5 @@ [versions] kermit = "2.0.2" -ktor = "2.3.6" logback = "1.4.11" compose = "1.5.4" compose-plugin = "1.5.10" @@ -24,10 +23,6 @@ kermit = { module = "co.touchlab:kermit", version.ref = "kermit" } kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } junit = { group = "junit", name = "junit", version.ref = "junit" } -logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } -ktor-server-core = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" } -ktor-server-netty = { module = "io.ktor:ktor-server-netty-jvm", version.ref = "ktor" } -ktor-server-tests = { module = "io.ktor:ktor-server-tests-jvm", version.ref = "ktor" } 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" } @@ -41,9 +36,10 @@ androidx-material = { group = "com.google.android.material", name = "material", androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" } androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } +#todo check if this is needed +logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } [plugins] kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -ktor = { id = "io.ktor.plugin", version.ref = "ktor" } jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } androidApplication = { id = "com.android.application", version.ref = "agp" } androidLibrary = { id = "com.android.library", version.ref = "agp" } diff --git a/server/build.gradle.kts b/server/build.gradle.kts deleted file mode 100644 index 1453aaed..00000000 --- a/server/build.gradle.kts +++ /dev/null @@ -1,21 +0,0 @@ -plugins { - alias(libs.plugins.kotlinJvm) - alias(libs.plugins.ktor) - application -} - -group = "com.stslex.wizard" -version = "1.0.0" -application { - mainClass.set("com.stslex.wizard.ApplicationKt") - applicationDefaultJvmArgs = listOf("-Dio.ktor.development=${extra["development"] ?: "false"}") -} - -dependencies { - implementation(projects.shared) - implementation(libs.logback) - implementation(libs.ktor.server.core) - implementation(libs.ktor.server.netty) - testImplementation(libs.ktor.server.tests) - testImplementation(libs.kotlin.test.junit) -} \ No newline at end of file diff --git a/server/src/main/kotlin/com/stslex/wizard/Application.kt b/server/src/main/kotlin/com/stslex/wizard/Application.kt deleted file mode 100644 index 21ce3989..00000000 --- a/server/src/main/kotlin/com/stslex/wizard/Application.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.stslex.wizard - -import Greeting -import SERVER_PORT -import io.ktor.server.application.* -import io.ktor.server.engine.* -import io.ktor.server.netty.* -import io.ktor.server.response.* -import io.ktor.server.routing.* - -fun main() { - embeddedServer(Netty, port = SERVER_PORT, host = "0.0.0.0", module = Application::module) - .start(wait = true) -} - -fun Application.module() { - routing { - get("/") { - call.respondText("Ktor: ${Greeting().greet()}") - } - } -} diff --git a/server/src/main/resources/logback.xml b/server/src/main/resources/logback.xml deleted file mode 100644 index bdbb64ec..00000000 --- a/server/src/main/resources/logback.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - diff --git a/settings.gradle.kts b/settings.gradle.kts index 239c3fa5..d52ab9c3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,8 +18,6 @@ dependencyResolutionManagement { } } -include(":server") -include(":shared") include(":composeApp") include(":core:core") include(":core:ui") diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts deleted file mode 100644 index 75231443..00000000 --- a/shared/build.gradle.kts +++ /dev/null @@ -1,34 +0,0 @@ -plugins { - alias(libs.plugins.kotlinMultiplatform) - alias(libs.plugins.androidLibrary) -} - -kotlin { - iosX64() - iosArm64() - iosSimulatorArm64() - - androidTarget { - compilations.all { - kotlinOptions { - jvmTarget = "1.8" - } - } - } - - jvm() - - sourceSets { - commonMain.dependencies { - // put your Multiplatform dependencies here - } - } -} - -android { - namespace = "com.stslex.wizard.shared" - compileSdk = libs.versions.android.compileSdk.get().toInt() - defaultConfig { - minSdk = libs.versions.android.minSdk.get().toInt() - } -} diff --git a/shared/src/androidMain/kotlin/Platform.android.kt b/shared/src/androidMain/kotlin/Platform.android.kt deleted file mode 100644 index 4f3ea051..00000000 --- a/shared/src/androidMain/kotlin/Platform.android.kt +++ /dev/null @@ -1,7 +0,0 @@ -import android.os.Build - -class AndroidPlatform : Platform { - override val name: String = "Android ${Build.VERSION.SDK_INT}" -} - -actual fun getPlatform(): Platform = AndroidPlatform() \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/Constants.kt b/shared/src/commonMain/kotlin/Constants.kt deleted file mode 100644 index e88a3e6c..00000000 --- a/shared/src/commonMain/kotlin/Constants.kt +++ /dev/null @@ -1 +0,0 @@ -const val SERVER_PORT = 8080 diff --git a/shared/src/commonMain/kotlin/Greeting.kt b/shared/src/commonMain/kotlin/Greeting.kt deleted file mode 100644 index 887d8350..00000000 --- a/shared/src/commonMain/kotlin/Greeting.kt +++ /dev/null @@ -1,7 +0,0 @@ -class Greeting { - private val platform = getPlatform() - - fun greet(): String { - return "Hello, ${platform.name}!" - } -} \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/Platform.kt b/shared/src/commonMain/kotlin/Platform.kt deleted file mode 100644 index 87ca3fff..00000000 --- a/shared/src/commonMain/kotlin/Platform.kt +++ /dev/null @@ -1,5 +0,0 @@ -interface Platform { - val name: String -} - -expect fun getPlatform(): Platform \ No newline at end of file diff --git a/shared/src/iosMain/kotlin/Platform.ios.kt b/shared/src/iosMain/kotlin/Platform.ios.kt deleted file mode 100644 index 5cef987c..00000000 --- a/shared/src/iosMain/kotlin/Platform.ios.kt +++ /dev/null @@ -1,7 +0,0 @@ -import platform.UIKit.UIDevice - -class IOSPlatform: Platform { - override val name: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion -} - -actual fun getPlatform(): Platform = IOSPlatform() \ No newline at end of file diff --git a/shared/src/jvmMain/kotlin/Platform.jvm.kt b/shared/src/jvmMain/kotlin/Platform.jvm.kt deleted file mode 100644 index f5e7e494..00000000 --- a/shared/src/jvmMain/kotlin/Platform.jvm.kt +++ /dev/null @@ -1,5 +0,0 @@ -class JVMPlatform: Platform { - override val name: String = "Java ${System.getProperty("java.version")}" -} - -actual fun getPlatform(): Platform = JVMPlatform() \ No newline at end of file