Initial commit

This commit is contained in:
2025-09-26 13:49:11 -03:00
parent c6f1764a9d
commit a67ea33a9c
22 changed files with 27 additions and 82 deletions

View File

@@ -30,6 +30,7 @@ kotlin {
implementation(libs.androidx.activity.compose) implementation(libs.androidx.activity.compose)
} }
commonMain.dependencies { commonMain.dependencies {
implementation(projects.features.common)
implementation(compose.runtime) implementation(compose.runtime)
implementation(compose.foundation) implementation(compose.foundation)
implementation(compose.material3) implementation(compose.material3)

View File

@@ -1,4 +1,4 @@
package dev.carlosmartino.triplogic package dev.carlosmartino.template
import android.os.Bundle import android.os.Bundle
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity

View File

@@ -1,4 +1,4 @@
package dev.carlosmartino.triplogic package dev.carlosmartino.template
import android.os.Build import android.os.Build

View File

@@ -1,7 +1,6 @@
package dev.carlosmartino.triplogic package dev.carlosmartino.template
import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.Image
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@@ -17,7 +16,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier 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 import org.jetbrains.compose.ui.tooling.preview.Preview
@Composable @Composable
@@ -36,7 +35,7 @@ fun App() {
Text("Click me!") Text("Click me!")
} }
AnimatedVisibility(showContent) { AnimatedVisibility(showContent) {
val greeting = remember { Greeting().greet() } val greeting = remember { CommonGreetings().greet() }
Column( Column(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,

View File

@@ -1,4 +1,4 @@
package dev.carlosmartino.triplogic package dev.carlosmartino.template
class Greeting { class Greeting {
private val platform = getPlatform() private val platform = getPlatform()

View File

@@ -1,4 +1,4 @@
package dev.carlosmartino.triplogic package dev.carlosmartino.template
interface Platform { interface Platform {
val name: String val name: String

View File

@@ -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)
}
}

View File

@@ -1,4 +1,4 @@
package dev.carlosmartino.triplogic package dev.carlosmartino.template
import androidx.compose.ui.window.ComposeUIViewController import androidx.compose.ui.window.ComposeUIViewController

View File

@@ -1,4 +1,4 @@
package dev.carlosmartino.triplogic package dev.carlosmartino.template
import platform.UIKit.UIDevice import platform.UIKit.UIDevice

View File

@@ -7,4 +7,4 @@ struct iOSApp: App {
ContentView() ContentView()
} }
} }
} }

Submodule bedrock updated: 8c897f50fe...43c2d36676

2
echo

Submodule echo updated: b5936f2b2f...63447674cb

View File

@@ -4,17 +4,6 @@ plugins {
} }
kotlin { kotlin {
androidLibrary {
withHostTestBuilder {
}
withDeviceTestBuilder {
sourceSetTreeName = "test"
}.configure {
instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
}
sourceSets { sourceSets {
commonMain { commonMain {
dependencies { dependencies {

View File

@@ -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)
}
}

View File

@@ -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)
}
}

View File

@@ -1,3 +0,0 @@
package dev.carlosmartino.common
actual fun platform() = "Android"

View File

@@ -0,0 +1,3 @@
package dev.carlosmartino.features.common
actual fun platform() = "Android"

View File

@@ -1,3 +0,0 @@
package dev.carlosmartino.common
expect fun platform(): String

View File

@@ -0,0 +1,7 @@
package dev.carlosmartino.features.common
expect fun platform(): String
class CommonGreetings {
fun greet(): String = "Hello, ${platform()}!"
}

View File

@@ -1,3 +0,0 @@
package dev.carlosmartino.common
actual fun platform() = "iOS"

View File

@@ -0,0 +1,3 @@
package dev.carlosmartino.features.common
actual fun platform() = "iOS"

View File

@@ -33,4 +33,4 @@ include(":app:composeApp")
include(":bedrock:designsystem") include(":bedrock:designsystem")
include(":bedrock:common") include(":bedrock:common")
include(":bedrock:navigation") include(":bedrock:navigation")
include(":common") include(":features:common")