-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
a2f95ab
commit e769262
Showing
22 changed files
with
356 additions
and
94 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
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,42 @@ | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
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,36 @@ | ||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat | ||
|
||
plugins { | ||
kotlin("multiplatform") | ||
id("org.jetbrains.compose") | ||
} | ||
|
||
group = "com.mocoding" | ||
version = "1.0-SNAPSHOT" | ||
|
||
kotlin { | ||
jvm { | ||
jvmToolchain(11) | ||
withJava() | ||
} | ||
sourceSets { | ||
val jvmMain by getting { | ||
dependencies { | ||
implementation(project(":shared")) | ||
implementation(compose.desktop.currentOs) | ||
} | ||
} | ||
val jvmTest by getting | ||
} | ||
} | ||
|
||
compose.desktop { | ||
application { | ||
mainClass = "MainKt" | ||
nativeDistributions { | ||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) | ||
packageName = "desktop" | ||
packageVersion = "1.0.0" | ||
} | ||
} | ||
} |
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,48 @@ | ||
import androidx.compose.ui.window.Window | ||
import androidx.compose.ui.window.application | ||
import com.arkivanov.decompose.DefaultComponentContext | ||
import com.arkivanov.essenty.lifecycle.LifecycleRegistry | ||
import com.arkivanov.essenty.lifecycle.resume | ||
import com.arkivanov.mvikotlin.core.utils.setMainThreadId | ||
import com.arkivanov.mvikotlin.main.store.DefaultStoreFactory | ||
import com.mocoding.pokedex.core.di.initKoin | ||
import com.mocoding.pokedex.ui.ContentView | ||
import com.mocoding.pokedex.ui.root.RootComponent | ||
import javax.swing.SwingUtilities | ||
|
||
fun main() { | ||
initKoin(enableNetworkLogs = false) | ||
|
||
// overrideSchedulers(main = Dispatchers.Main::asScheduler) | ||
|
||
val rootComponent = invokeOnAwtSync { | ||
setMainThreadId(Thread.currentThread().id) | ||
|
||
val lifecycle = LifecycleRegistry() | ||
|
||
val rootComponent = RootComponent( | ||
componentContext = DefaultComponentContext(lifecycle = lifecycle), | ||
storeFactory = DefaultStoreFactory(), | ||
) | ||
|
||
lifecycle.resume() | ||
|
||
rootComponent | ||
} | ||
|
||
application { | ||
Window(onCloseRequest = ::exitApplication) { | ||
ContentView( | ||
component = rootComponent | ||
) | ||
} | ||
} | ||
} | ||
|
||
fun <T> invokeOnAwtSync(block: () -> T): T { | ||
var result: T? = null | ||
SwingUtilities.invokeAndWait { result = block() } | ||
|
||
@Suppress("UNCHECKED_CAST") | ||
return result as T | ||
} |
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
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
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
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
Oops, something went wrong.