diff --git a/app/composeApp/build.gradle.kts b/app/composeApp/build.gradle.kts index 54a007d..b96ed0f 100644 --- a/app/composeApp/build.gradle.kts +++ b/app/composeApp/build.gradle.kts @@ -30,6 +30,7 @@ kotlin { implementation(libs.androidx.activity.compose) } commonMain.dependencies { + implementation(projects.features.common) implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) diff --git a/app/composeApp/src/androidMain/kotlin/dev/carlosmartino/triplogic/MainActivity.kt b/app/composeApp/src/androidMain/kotlin/dev/carlosmartino/template/MainActivity.kt similarity index 93% rename from app/composeApp/src/androidMain/kotlin/dev/carlosmartino/triplogic/MainActivity.kt rename to app/composeApp/src/androidMain/kotlin/dev/carlosmartino/template/MainActivity.kt index 1b912fe..e859643 100644 --- a/app/composeApp/src/androidMain/kotlin/dev/carlosmartino/triplogic/MainActivity.kt +++ b/app/composeApp/src/androidMain/kotlin/dev/carlosmartino/template/MainActivity.kt @@ -1,4 +1,4 @@ -package dev.carlosmartino.triplogic +package dev.carlosmartino.template import android.os.Bundle import androidx.activity.ComponentActivity diff --git a/app/composeApp/src/androidMain/kotlin/dev/carlosmartino/triplogic/Platform.android.kt b/app/composeApp/src/androidMain/kotlin/dev/carlosmartino/template/Platform.android.kt similarity index 83% rename from app/composeApp/src/androidMain/kotlin/dev/carlosmartino/triplogic/Platform.android.kt rename to app/composeApp/src/androidMain/kotlin/dev/carlosmartino/template/Platform.android.kt index 88ee662..40dd7f6 100644 --- a/app/composeApp/src/androidMain/kotlin/dev/carlosmartino/triplogic/Platform.android.kt +++ b/app/composeApp/src/androidMain/kotlin/dev/carlosmartino/template/Platform.android.kt @@ -1,4 +1,4 @@ -package dev.carlosmartino.triplogic +package dev.carlosmartino.template import android.os.Build diff --git a/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/App.kt b/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/App.kt similarity index 89% rename from app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/App.kt rename to app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/App.kt index bcfacec..50a7b51 100644 --- a/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/App.kt +++ b/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/App.kt @@ -1,7 +1,6 @@ -package dev.carlosmartino.triplogic +package dev.carlosmartino.template import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize @@ -17,7 +16,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import org.jetbrains.compose.resources.painterResource +import dev.carlosmartino.features.common.CommonGreetings import org.jetbrains.compose.ui.tooling.preview.Preview @Composable @@ -36,7 +35,7 @@ fun App() { Text("Click me!") } AnimatedVisibility(showContent) { - val greeting = remember { Greeting().greet() } + val greeting = remember { CommonGreetings().greet() } Column( modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally, diff --git a/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/Greeting.kt b/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/Greeting.kt similarity index 76% rename from app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/Greeting.kt rename to app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/Greeting.kt index 5b8bd81..cccda37 100644 --- a/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/Greeting.kt +++ b/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/Greeting.kt @@ -1,4 +1,4 @@ -package dev.carlosmartino.triplogic +package dev.carlosmartino.template class Greeting { private val platform = getPlatform() diff --git a/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/Platform.kt b/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/Platform.kt similarity index 69% rename from app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/Platform.kt rename to app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/Platform.kt index c41b0c0..b89573a 100644 --- a/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/triplogic/Platform.kt +++ b/app/composeApp/src/commonMain/kotlin/dev/carlosmartino/template/Platform.kt @@ -1,4 +1,4 @@ -package dev.carlosmartino.triplogic +package dev.carlosmartino.template interface Platform { val name: String diff --git a/app/composeApp/src/commonTest/kotlin/dev/carlosmartino/triplogic/ComposeAppCommonTest.kt b/app/composeApp/src/commonTest/kotlin/dev/carlosmartino/triplogic/ComposeAppCommonTest.kt deleted file mode 100644 index a28a11e..0000000 --- a/app/composeApp/src/commonTest/kotlin/dev/carlosmartino/triplogic/ComposeAppCommonTest.kt +++ /dev/null @@ -1,11 +0,0 @@ -package dev.carlosmartino.triplogic - -import kotlin.test.Test -import kotlin.test.assertEquals - -class ComposeAppCommonTest { - @Test - fun example() { - assertEquals(3, 1 + 2) - } -} diff --git a/app/composeApp/src/iosMain/kotlin/dev/carlosmartino/triplogic/MainViewController.kt b/app/composeApp/src/iosMain/kotlin/dev/carlosmartino/template/MainViewController.kt similarity index 77% rename from app/composeApp/src/iosMain/kotlin/dev/carlosmartino/triplogic/MainViewController.kt rename to app/composeApp/src/iosMain/kotlin/dev/carlosmartino/template/MainViewController.kt index 5c7131f..10ce5d6 100644 --- a/app/composeApp/src/iosMain/kotlin/dev/carlosmartino/triplogic/MainViewController.kt +++ b/app/composeApp/src/iosMain/kotlin/dev/carlosmartino/template/MainViewController.kt @@ -1,4 +1,4 @@ -package dev.carlosmartino.triplogic +package dev.carlosmartino.template import androidx.compose.ui.window.ComposeUIViewController diff --git a/app/composeApp/src/iosMain/kotlin/dev/carlosmartino/triplogic/Platform.ios.kt b/app/composeApp/src/iosMain/kotlin/dev/carlosmartino/template/Platform.ios.kt similarity index 86% rename from app/composeApp/src/iosMain/kotlin/dev/carlosmartino/triplogic/Platform.ios.kt rename to app/composeApp/src/iosMain/kotlin/dev/carlosmartino/template/Platform.ios.kt index c7f424e..5ca4608 100644 --- a/app/composeApp/src/iosMain/kotlin/dev/carlosmartino/triplogic/Platform.ios.kt +++ b/app/composeApp/src/iosMain/kotlin/dev/carlosmartino/template/Platform.ios.kt @@ -1,4 +1,4 @@ -package dev.carlosmartino.triplogic +package dev.carlosmartino.template import platform.UIKit.UIDevice diff --git a/app/iosApp/iosApp/iOSApp.swift b/app/iosApp/iosApp/iOSApp.swift index d83dca6..927e0b9 100644 --- a/app/iosApp/iosApp/iOSApp.swift +++ b/app/iosApp/iosApp/iOSApp.swift @@ -7,4 +7,4 @@ struct iOSApp: App { ContentView() } } -} \ No newline at end of file +} diff --git a/bedrock b/bedrock index 8c897f5..43c2d36 160000 --- a/bedrock +++ b/bedrock @@ -1 +1 @@ -Subproject commit 8c897f50fe5939004be4eeff557b0a429908926e +Subproject commit 43c2d3667654fc6045bced17d759d65ecfb30126 diff --git a/echo b/echo index b5936f2..6344767 160000 --- a/echo +++ b/echo @@ -1 +1 @@ -Subproject commit b5936f2b2f591d28f9ca994426ceff8be08f9bec +Subproject commit 63447674cbfe02d2914000d419ebffeb2d3a347c diff --git a/features/common/build.gradle.kts b/features/common/build.gradle.kts index acc77ed..eb79ed8 100644 --- a/features/common/build.gradle.kts +++ b/features/common/build.gradle.kts @@ -4,17 +4,6 @@ plugins { } kotlin { - androidLibrary { - withHostTestBuilder { - } - - withDeviceTestBuilder { - sourceSetTreeName = "test" - }.configure { - instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - } - } - sourceSets { commonMain { dependencies { diff --git a/features/common/src/androidDeviceTest/kotlin/dev/carlosmartino/common/ExampleInstrumentedTest.kt b/features/common/src/androidDeviceTest/kotlin/dev/carlosmartino/common/ExampleInstrumentedTest.kt deleted file mode 100644 index 16b299c..0000000 --- a/features/common/src/androidDeviceTest/kotlin/dev/carlosmartino/common/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,21 +0,0 @@ -package dev.carlosmartino.common - -import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.test.platform.app.InstrumentationRegistry -import org.junit.Test -import org.junit.runner.RunWith - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("dev.carlosmartino.common.test", appContext.packageName) - } -} diff --git a/features/common/src/androidHostTest/kotlin/dev/carlosmartino/common/ExampleUnitTest.kt b/features/common/src/androidHostTest/kotlin/dev/carlosmartino/common/ExampleUnitTest.kt deleted file mode 100644 index dc287e8..0000000 --- a/features/common/src/androidHostTest/kotlin/dev/carlosmartino/common/ExampleUnitTest.kt +++ /dev/null @@ -1,16 +0,0 @@ -package dev.carlosmartino.common - -import kotlin.test.Test -import kotlin.test.assertEquals - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} diff --git a/features/common/src/androidMain/kotlin/dev/carlosmartino/common/Platform.android.kt b/features/common/src/androidMain/kotlin/dev/carlosmartino/common/Platform.android.kt deleted file mode 100644 index 01840a1..0000000 --- a/features/common/src/androidMain/kotlin/dev/carlosmartino/common/Platform.android.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.carlosmartino.common - -actual fun platform() = "Android" diff --git a/features/common/src/androidMain/kotlin/dev/carlosmartino/features/common/Platform.android.kt b/features/common/src/androidMain/kotlin/dev/carlosmartino/features/common/Platform.android.kt new file mode 100644 index 0000000..315a63c --- /dev/null +++ b/features/common/src/androidMain/kotlin/dev/carlosmartino/features/common/Platform.android.kt @@ -0,0 +1,3 @@ +package dev.carlosmartino.features.common + +actual fun platform() = "Android" diff --git a/features/common/src/commonMain/kotlin/dev/carlosmartino/common/Platform.kt b/features/common/src/commonMain/kotlin/dev/carlosmartino/common/Platform.kt deleted file mode 100644 index 9ee9a40..0000000 --- a/features/common/src/commonMain/kotlin/dev/carlosmartino/common/Platform.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.carlosmartino.common - -expect fun platform(): String diff --git a/features/common/src/commonMain/kotlin/dev/carlosmartino/features/common/Platform.kt b/features/common/src/commonMain/kotlin/dev/carlosmartino/features/common/Platform.kt new file mode 100644 index 0000000..6642b0a --- /dev/null +++ b/features/common/src/commonMain/kotlin/dev/carlosmartino/features/common/Platform.kt @@ -0,0 +1,7 @@ +package dev.carlosmartino.features.common + +expect fun platform(): String + +class CommonGreetings { + fun greet(): String = "Hello, ${platform()}!" +} diff --git a/features/common/src/iosMain/kotlin/dev/carlosmartino/common/Platform.ios.kt b/features/common/src/iosMain/kotlin/dev/carlosmartino/common/Platform.ios.kt deleted file mode 100644 index 1ea00f7..0000000 --- a/features/common/src/iosMain/kotlin/dev/carlosmartino/common/Platform.ios.kt +++ /dev/null @@ -1,3 +0,0 @@ -package dev.carlosmartino.common - -actual fun platform() = "iOS" diff --git a/features/common/src/iosMain/kotlin/dev/carlosmartino/features/common/Platform.ios.kt b/features/common/src/iosMain/kotlin/dev/carlosmartino/features/common/Platform.ios.kt new file mode 100644 index 0000000..4a68321 --- /dev/null +++ b/features/common/src/iosMain/kotlin/dev/carlosmartino/features/common/Platform.ios.kt @@ -0,0 +1,3 @@ +package dev.carlosmartino.features.common + +actual fun platform() = "iOS" diff --git a/settings.gradle.kts b/settings.gradle.kts index b82ba5b..daa6b2a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -33,4 +33,4 @@ include(":app:composeApp") include(":bedrock:designsystem") include(":bedrock:common") include(":bedrock:navigation") -include(":common") +include(":features:common")