-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b105696
commit 8fccb04
Showing
5 changed files
with
153 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,124 @@ | ||
import com.google.devtools.ksp.gradle.KspTask | ||
|
||
plugins { | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidApplication) | ||
alias(libs.plugins.composeMultiplatform) | ||
alias(libs.plugins.composeCompiler) | ||
alias(libs.plugins.ksp) | ||
idea | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidApplication) | ||
alias(libs.plugins.composeMultiplatform) | ||
alias(libs.plugins.composeCompiler) | ||
alias(libs.plugins.ksp) | ||
idea | ||
} | ||
|
||
kotlin { | ||
js(IR) { | ||
browser() | ||
binaries.executable() | ||
} | ||
js(IR) { | ||
browser() | ||
binaries.executable() | ||
} | ||
|
||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
} | ||
|
||
jvm("desktop") | ||
jvm("desktop") | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { iosTarget -> | ||
iosTarget.binaries.framework { | ||
baseName = "ComposeApp" | ||
isStatic = true | ||
} | ||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { iosTarget -> | ||
iosTarget.binaries.framework { | ||
baseName = "ComposeApp" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain { | ||
kotlin.srcDirs("build/generated/ksp/commonMain/kotlin") | ||
} | ||
sourceSets { | ||
commonMain { | ||
kotlin.srcDirs("build/generated/ksp/commonMain/kotlin") | ||
} | ||
commonTest { | ||
kotlin.srcDir("build/generated/ksp/test/kotlin") | ||
} | ||
dependencies { | ||
ksp(libs.arrow.optics.ksp) | ||
} | ||
|
||
val desktopMain by getting | ||
val desktopMain by getting | ||
|
||
androidMain.dependencies { | ||
implementation(compose.preview) | ||
implementation(libs.androidx.activity.compose) | ||
} | ||
commonMain.dependencies { | ||
implementation(projects.shared) | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation(compose.ui) | ||
implementation(compose.components.resources) | ||
implementation(compose.components.uiToolingPreview) | ||
implementation(libs.kotlin.immutableCollections) | ||
implementation(libs.thirdparty.lottieMultiplatform) | ||
implementation(libs.thirdparty.kamel) | ||
implementation(libs.bundles.arrow) | ||
} | ||
desktopMain.dependencies { | ||
implementation(compose.desktop.currentOs) | ||
} | ||
androidMain.dependencies { | ||
implementation(compose.preview) | ||
implementation(libs.androidx.activity.compose) | ||
} | ||
} | ||
|
||
dependencies { | ||
ksp(libs.arrow.optics.ksp) | ||
commonMain.dependencies { | ||
implementation(projects.shared) | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation(compose.ui) | ||
implementation(compose.components.resources) | ||
implementation(compose.components.uiToolingPreview) | ||
implementation(libs.kotlin.immutableCollections) | ||
implementation(libs.thirdparty.lottieMultiplatform) | ||
implementation(libs.thirdparty.kamel) | ||
implementation(libs.bundles.arrow) | ||
} | ||
commonTest.dependencies { | ||
implementation(libs.bundles.test.kmp) | ||
} | ||
desktopMain.dependencies { | ||
implementation(compose.desktop.currentOs) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "ivy.learn" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
namespace = "ivy.learn" | ||
compileSdk = libs.versions.android.compileSdk.get().toInt() | ||
|
||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") | ||
sourceSets["main"].res.srcDirs("src/androidMain/res") | ||
sourceSets["main"].resources.srcDirs("src/commonMain/resources") | ||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") | ||
sourceSets["main"].res.srcDirs("src/androidMain/res") | ||
sourceSets["main"].resources.srcDirs("src/commonMain/resources") | ||
|
||
defaultConfig { | ||
applicationId = "ivy.learn" | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
targetSdk = libs.versions.android.targetSdk.get().toInt() | ||
versionCode = 1 | ||
versionName = "1.0" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
buildTypes { | ||
getByName("release") { | ||
isMinifyEnabled = false | ||
} | ||
defaultConfig { | ||
applicationId = "ivy.learn" | ||
minSdk = libs.versions.android.minSdk.get().toInt() | ||
targetSdk = libs.versions.android.targetSdk.get().toInt() | ||
versionCode = 1 | ||
versionName = "1.0" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
buildTypes { | ||
getByName("release") { | ||
isMinifyEnabled = false | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
} | ||
|
||
compose.experimental { | ||
web.application {} | ||
web.application {} | ||
} | ||
|
||
// Configure KSP to output to the commonMain directory | ||
tasks.withType<KspTask> { | ||
doLast { | ||
copy { | ||
from("build/generated/ksp/js/jsMain/kotlin") | ||
into("build/generated/ksp/commonMain/kotlin") | ||
include("**/*.kt") | ||
} | ||
delete("build/generated/ksp/js/jsMain/kotlin") | ||
doLast { | ||
copy { | ||
from("build/generated/ksp/js/jsMain/kotlin") | ||
into("build/generated/ksp/commonMain/kotlin") | ||
include("**/*.kt") | ||
} | ||
delete("build/generated/ksp/js/jsMain/kotlin") | ||
delete("build/generated/ksp/desktop/desktopMain/kotlin") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import di.AppModule | ||
import io.kotest.matchers.shouldBe | ||
import ivy.di.Di | ||
import kotlin.test.BeforeTest | ||
import kotlin.test.Test | ||
|
||
class AppConfigurationTest { | ||
@BeforeTest | ||
fun setup() { | ||
Di.reset() | ||
Di.init(AppModule) | ||
} | ||
|
||
@Test | ||
fun fakes_should_be_disabled() { | ||
// Given | ||
val appConfiguration = Di.get<AppConfiguration>() | ||
|
||
// When | ||
val fakesEnabled = appConfiguration.fakesEnabled | ||
|
||
// Then | ||
fakesEnabled shouldBe false | ||
} | ||
|
||
@Test | ||
fun should_not_use_local_server() { | ||
// Given | ||
val appConfiguration = Di.get<AppConfiguration>() | ||
|
||
// When | ||
val userLocalServer = appConfiguration.useLocalServer | ||
|
||
// Then | ||
userLocalServer shouldBe false | ||
} | ||
} |
15 changes: 13 additions & 2 deletions
15
composeApp/src/desktopMain/kotlin/navigation/SystemNavigation.desktop.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
package navigation | ||
|
||
import kotlinx.coroutines.flow.StateFlow | ||
|
||
class DesktopSystemNavigation : SystemNavigation { | ||
override val currentRoute: StateFlow<Route> | ||
get() = TODO("Not yet implemented") | ||
|
||
override fun navigateTo(screen: Screen) {} | ||
override fun navigateBack() {} | ||
override fun setupUrlChangeListener(onUrlChange: (String, Map<String, String>) -> Unit) {} | ||
override fun replaceWith(screen: Screen) { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override fun navigateBack(): Boolean { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
} | ||
|
||
actual fun systemNavigation(): SystemNavigation = DesktopSystemNavigation() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters