Initial commit
This commit is contained in:
1
features/common/.gitignore
vendored
Normal file
1
features/common/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
37
features/common/build.gradle.kts
Normal file
37
features/common/build.gradle.kts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
plugins {
|
||||||
|
alias(libs.plugins.kotlinDevKit)
|
||||||
|
alias(libs.plugins.composeDevKit)
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
androidLibrary {
|
||||||
|
withHostTestBuilder {
|
||||||
|
}
|
||||||
|
|
||||||
|
withDeviceTestBuilder {
|
||||||
|
sourceSetTreeName = "test"
|
||||||
|
}.configure {
|
||||||
|
instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
// Add KMP-specific dependencies here.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
androidMain {
|
||||||
|
dependencies {
|
||||||
|
// Add Android-specific dependencies here.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
iosMain {
|
||||||
|
dependencies {
|
||||||
|
// Add iOS-specific dependencies here.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
4
features/common/src/androidMain/AndroidManifest.xml
Normal file
4
features/common/src/androidMain/AndroidManifest.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
</manifest>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package dev.carlosmartino.common
|
||||||
|
|
||||||
|
actual fun platform() = "Android"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package dev.carlosmartino.common
|
||||||
|
|
||||||
|
expect fun platform(): String
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package dev.carlosmartino.common
|
||||||
|
|
||||||
|
actual fun platform() = "iOS"
|
||||||
@@ -28,6 +28,8 @@ multiplatform-settings = "1.3.0"
|
|||||||
moko-permissions = "0.20.1"
|
moko-permissions = "0.20.1"
|
||||||
# Testing
|
# Testing
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
|
runner = "1.5.2"
|
||||||
|
core = "1.5.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
# Platform specific libraries
|
# Platform specific libraries
|
||||||
@@ -43,6 +45,7 @@ kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serializa
|
|||||||
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
|
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
|
||||||
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
|
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
|
||||||
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime"}
|
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime"}
|
||||||
|
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
|
||||||
compose-multiplatform-navigation = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "compose-multiplatform-navigation" }
|
compose-multiplatform-navigation = { module = "org.jetbrains.androidx.navigation:navigation-compose", version.ref = "compose-multiplatform-navigation" }
|
||||||
|
|
||||||
# Koin - Dependency Injection
|
# Koin - Dependency Injection
|
||||||
@@ -83,6 +86,8 @@ kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotl
|
|||||||
kotlin-testJunit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
|
kotlin-testJunit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
|
||||||
androidx-testExt-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-testExt" }
|
androidx-testExt-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-testExt" }
|
||||||
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso" }
|
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso" }
|
||||||
|
androidx-runner = { group = "androidx.test", name = "runner", version.ref = "runner" }
|
||||||
|
androidx-core = { group = "androidx.test", name = "core", version.ref = "core" }
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
androidApplication = { id = "com.android.application", version.ref = "agp" }
|
androidApplication = { id = "com.android.application", version.ref = "agp" }
|
||||||
|
|||||||
@@ -33,3 +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")
|
||||||
|
|||||||
Reference in New Issue
Block a user