Skip to content

Commit

Permalink
Desktop and Android Working!
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Jun 27, 2024
1 parent 207c6d9 commit bfddb1c
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 120 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ dependencies {
// AndroidX Libraries
implementation(libs.androidx.appcompat.v7)
implementation(libs.androidx.material)
implementation(libs.androidx.material3)
implementation(libs.androidx.lifecycle.runtime.ktx)

// Networking)
Expand Down
114 changes: 65 additions & 49 deletions app/dependencies/debugRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,79 @@
:models
:networking
:shopping-cart
androidx.activity:activity-compose:1.7.2
androidx.activity:activity-ktx:1.7.2
androidx.activity:activity:1.7.2
androidx.activity:activity-compose:1.9.0
androidx.activity:activity-ktx:1.9.0
androidx.activity:activity:1.9.0
androidx.annotation:annotation-experimental:1.4.0
androidx.annotation:annotation-jvm:1.7.0
androidx.annotation:annotation:1.7.0
androidx.appcompat:appcompat-resources:1.6.1
androidx.appcompat:appcompat:1.6.1
androidx.appcompat:appcompat-resources:1.7.0
androidx.appcompat:appcompat:1.7.0
androidx.arch.core:core-common:2.2.0
androidx.arch.core:core-runtime:2.2.0
androidx.autofill:autofill:1.0.0
androidx.cardview:cardview:1.0.0
androidx.collection:collection-jvm:1.4.0
androidx.collection:collection-ktx:1.4.0
androidx.collection:collection:1.4.0
androidx.compose.animation:animation-android:1.6.8
androidx.compose.animation:animation-core-android:1.6.8
androidx.compose.animation:animation-core:1.6.8
androidx.compose.animation:animation:1.6.8
androidx.compose.foundation:foundation-android:1.6.8
androidx.compose.foundation:foundation-layout-android:1.6.8
androidx.compose.foundation:foundation-layout:1.6.8
androidx.compose.foundation:foundation:1.6.8
androidx.compose.animation:animation-android:1.6.7
androidx.compose.animation:animation-core-android:1.6.7
androidx.compose.animation:animation-core:1.6.7
androidx.compose.animation:animation:1.6.7
androidx.compose.foundation:foundation-android:1.6.7
androidx.compose.foundation:foundation-layout-android:1.6.7
androidx.compose.foundation:foundation-layout:1.6.7
androidx.compose.foundation:foundation:1.6.7
androidx.compose.material3:material3-android:1.2.1
androidx.compose.material3:material3:1.2.1
androidx.compose.material:material-android:1.6.8
androidx.compose.material:material-icons-core-android:1.6.8
androidx.compose.material:material-icons-core:1.6.8
androidx.compose.material:material-icons-extended-android:1.6.8
androidx.compose.material:material-icons-extended:1.6.8
androidx.compose.material:material-ripple-android:1.6.8
androidx.compose.material:material-ripple:1.6.8
androidx.compose.material:material:1.6.8
androidx.compose.runtime:runtime-android:1.6.8
androidx.compose.runtime:runtime-saveable-android:1.6.8
androidx.compose.runtime:runtime-saveable:1.6.8
androidx.compose.runtime:runtime:1.6.8
androidx.compose.ui:ui-android:1.6.8
androidx.compose.ui:ui-geometry-android:1.6.8
androidx.compose.ui:ui-geometry:1.6.8
androidx.compose.ui:ui-graphics-android:1.6.8
androidx.compose.ui:ui-graphics:1.6.8
androidx.compose.ui:ui-text-android:1.6.8
androidx.compose.ui:ui-text:1.6.8
androidx.compose.ui:ui-tooling-android:1.6.8
androidx.compose.ui:ui-tooling-data-android:1.6.8
androidx.compose.ui:ui-tooling-data:1.6.8
androidx.compose.ui:ui-tooling-preview-android:1.6.8
androidx.compose.ui:ui-tooling-preview:1.6.8
androidx.compose.ui:ui-tooling:1.6.8
androidx.compose.ui:ui-unit-android:1.6.8
androidx.compose.ui:ui-unit:1.6.8
androidx.compose.ui:ui-util-android:1.6.8
androidx.compose.ui:ui-util:1.6.8
androidx.compose.ui:ui:1.6.8
androidx.compose.material:material-android:1.6.7
androidx.compose.material:material-icons-core-android:1.6.7
androidx.compose.material:material-icons-core:1.6.7
androidx.compose.material:material-icons-extended-android:1.6.7
androidx.compose.material:material-icons-extended:1.6.7
androidx.compose.material:material-ripple-android:1.6.7
androidx.compose.material:material-ripple:1.6.7
androidx.compose.material:material:1.6.7
androidx.compose.runtime:runtime-android:1.6.7
androidx.compose.runtime:runtime-saveable-android:1.6.7
androidx.compose.runtime:runtime-saveable:1.6.7
androidx.compose.runtime:runtime:1.6.7
androidx.compose.ui:ui-android:1.6.7
androidx.compose.ui:ui-geometry-android:1.6.7
androidx.compose.ui:ui-geometry:1.6.7
androidx.compose.ui:ui-graphics-android:1.6.7
androidx.compose.ui:ui-graphics:1.6.7
androidx.compose.ui:ui-text-android:1.6.7
androidx.compose.ui:ui-text:1.6.7
androidx.compose.ui:ui-tooling-android:1.6.7
androidx.compose.ui:ui-tooling-data-android:1.6.7
androidx.compose.ui:ui-tooling-data:1.6.7
androidx.compose.ui:ui-tooling-preview-android:1.6.7
androidx.compose.ui:ui-tooling-preview:1.6.7
androidx.compose.ui:ui-tooling:1.6.7
androidx.compose.ui:ui-unit-android:1.6.7
androidx.compose.ui:ui-unit:1.6.7
androidx.compose.ui:ui-util-android:1.6.7
androidx.compose.ui:ui-util:1.6.7
androidx.compose.ui:ui:1.6.7
androidx.concurrent:concurrent-futures:1.1.0
androidx.core:core-ktx:1.12.0
androidx.core:core:1.12.0
androidx.constraintlayout:constraintlayout-solver:2.0.1
androidx.constraintlayout:constraintlayout:2.0.1
androidx.coordinatorlayout:coordinatorlayout:1.1.0
androidx.core:core-ktx:1.13.0
androidx.core:core:1.13.0
androidx.cursoradapter:cursoradapter:1.0.0
androidx.customview:customview-poolingcontainer:1.0.0
androidx.customview:customview:1.0.0
androidx.drawerlayout:drawerlayout:1.0.0
androidx.customview:customview:1.1.0
androidx.documentfile:documentfile:1.0.0
androidx.drawerlayout:drawerlayout:1.1.1
androidx.dynamicanimation:dynamicanimation:1.0.0
androidx.emoji2:emoji2-views-helper:1.3.0
androidx.emoji2:emoji2:1.3.0
androidx.exifinterface:exifinterface:1.3.3
androidx.fragment:fragment:1.3.6
androidx.fragment:fragment:1.5.4
androidx.interpolator:interpolator:1.0.0
androidx.legacy:legacy-support-core-utils:1.0.0
androidx.lifecycle:lifecycle-common-java8:2.6.2
androidx.lifecycle:lifecycle-common:2.6.2
androidx.lifecycle:lifecycle-livedata-core:2.6.2
Expand All @@ -81,15 +88,20 @@ androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2
androidx.lifecycle:lifecycle-viewmodel-savedstate:2.6.2
androidx.lifecycle:lifecycle-viewmodel:2.6.2
androidx.loader:loader:1.0.0
androidx.profileinstaller:profileinstaller:1.3.0
androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
androidx.print:print:1.0.0
androidx.profileinstaller:profileinstaller:1.3.1
androidx.recyclerview:recyclerview:1.1.0
androidx.resourceinspection:resourceinspection-annotation:1.0.1
androidx.savedstate:savedstate-ktx:1.2.1
androidx.savedstate:savedstate:1.2.1
androidx.startup:startup-runtime:1.1.1
androidx.tracing:tracing:1.0.0
androidx.transition:transition:1.2.0
androidx.vectordrawable:vectordrawable-animated:1.1.0
androidx.vectordrawable:vectordrawable:1.1.0
androidx.versionedparcelable:versionedparcelable:1.1.1
androidx.viewpager2:viewpager2:1.0.0
androidx.viewpager:viewpager:1.0.0
com.github.bumptech.glide:annotations:4.11.0
com.github.bumptech.glide:disklrucache:4.11.0
Expand All @@ -100,6 +112,8 @@ com.github.skydoves:landscapist:1.3.0
com.google.accompanist:accompanist-coil:0.15.0
com.google.accompanist:accompanist-drawablepainter:0.25.1
com.google.accompanist:accompanist-imageloading-core:0.15.0
com.google.android.material:material:1.9.0
com.google.errorprone:error_prone_annotations:2.15.0
com.google.guava:listenablefuture:1.0
com.jakewharton.timber:timber:4.5.1
com.squareup.okhttp3:logging-interceptor:4.11.0
Expand Down Expand Up @@ -134,6 +148,8 @@ io.ktor:ktor-websocket-serialization-jvm:2.1.0
io.ktor:ktor-websocket-serialization:2.1.0
io.ktor:ktor-websockets-jvm:2.1.0
io.ktor:ktor-websockets:2.1.0
org.jetbrains.compose.foundation:foundation:1.6.11
org.jetbrains.compose.material3:material3:1.6.11
org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.7.10
org.jetbrains.kotlin:kotlin-parcelize-runtime:1.7.10
org.jetbrains.kotlin:kotlin-stdlib-common:2.0.0
Expand Down
27 changes: 16 additions & 11 deletions compose-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,28 @@
plugins {
alias(libs.plugins.kotlin.multiplatform) // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.jetbrains.compose)
}

kotlin {
jvm {
withJava()
}
val jvmMain by sourceSets.getting {
dependencies {
api(libs.androidx.material3)
api(libs.androidx.compose.foundation)
api(libs.androidx.compose.ui)

implementation(project(":models"))
implementation(project(":mock-data"))
implementation(project(":shopping-cart"))
implementation(project(":networking"))
implementation(libs.kotlin.coroutines)
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.foundation)
implementation(compose.material3)
}
}
val jvmMain by getting {
dependencies {
api(project(":models"))
api(project(":mock-data"))
api(project(":shopping-cart"))
api(project(":networking"))
api(libs.kotlin.coroutines)
}
}
}
}
59 changes: 39 additions & 20 deletions desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,56 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
// alias(libs.plugins.kotlin.multiplatform)
kotlin("jvm")
kotlin("multiplatform")
alias(libs.plugins.compose.compiler)
alias(libs.plugins.jetbrains.compose)
alias(libs.plugins.dependency.guard)
application
}

dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":compose-ui"))
implementation(project(":mock-data"))
implementation(project(":models"))
implementation(project(":networking"))
implementation(project(":shopping-cart"))
}

dependencyGuard {
configuration("runtimeClasspath")
configuration("desktopRuntimeClasspath")
}

//compose.desktop {
//}
kotlin {
jvm("desktop")
sourceSets {
val commonMain by getting {
dependencies {
implementation(compose.foundation)
implementation(compose.material3)
implementation(project(":mock-data"))
implementation(project(":models"))
implementation(project(":networking"))
implementation(project(":shopping-cart"))
}
}

val desktopMain by getting {
dependsOn(commonMain)
dependencies {
implementation(compose.desktop.currentOs)


// implementation(compose.desktop.currentOs)
implementation(project(":compose-ui"))
// implementation("androidx.compose.ui:ui-desktop-:1.7.0-beta02")
// implementation("androidx.compose.material3:material3-window-size-class:1.3.0-beta04")
// implementation("org.jetbrains.compose.desktop:desktop-jvm-macos-arm64:1.6.11")
// implementation("androidx.compose.material3:material3:1.3.0-beta04")
// implementation("androidx.compose.material:material:1.3.0-beta04")
// implementation("androidx.compose.material3:material3-window-size-class:1.3.0-beta04")
// api(libs.androidx.material3.desktop)
}
}
}
}
compose.desktop {


application {
mainClass = "com.handstandsam.shoppingapp.compose.MainKt"
application {
mainClass = "com.handstandsam.shoppingapp.compose.MainKt"

// nativeDistributions {
// targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
// packageName = "ShoppingApp Desktop"
// packageVersion = "1.0.0"
// }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,6 @@ androidx.annotation:annotation:1.8.0
androidx.arch.core:core-common:2.2.0
androidx.collection:collection-jvm:1.4.0
androidx.collection:collection:1.4.0
androidx.compose.animation:animation-core-desktop:1.6.8
androidx.compose.animation:animation-core:1.6.8
androidx.compose.animation:animation-desktop:1.6.8
androidx.compose.animation:animation:1.6.8
androidx.compose.foundation:foundation-desktop:1.6.8
androidx.compose.foundation:foundation-layout-desktop:1.6.8
androidx.compose.foundation:foundation-layout:1.6.8
androidx.compose.foundation:foundation:1.6.8
androidx.compose.material:material-desktop:1.6.8
androidx.compose.material:material-icons-core-desktop:1.6.8
androidx.compose.material:material-icons-core:1.6.8
androidx.compose.material:material-ripple-desktop:1.6.8
androidx.compose.material:material-ripple:1.6.8
androidx.compose.material:material:1.6.8
androidx.compose.runtime:runtime-desktop:1.6.8
androidx.compose.runtime:runtime-saveable-desktop:1.6.8
androidx.compose.runtime:runtime-saveable:1.6.8
androidx.compose.runtime:runtime:1.6.8
androidx.compose.ui:ui-desktop:1.6.8
androidx.compose.ui:ui-geometry-desktop:1.6.8
androidx.compose.ui:ui-geometry:1.6.8
androidx.compose.ui:ui-graphics-desktop:1.6.8
androidx.compose.ui:ui-graphics:1.6.8
androidx.compose.ui:ui-text-desktop:1.6.8
androidx.compose.ui:ui-text:1.6.8
androidx.compose.ui:ui-unit-desktop:1.6.8
androidx.compose.ui:ui-unit:1.6.8
androidx.compose.ui:ui-util-desktop:1.6.8
androidx.compose.ui:ui-util:1.6.8
androidx.compose.ui:ui:1.6.8
androidx.lifecycle:lifecycle-common-jvm:2.8.0
androidx.lifecycle:lifecycle-common:2.8.0
androidx.lifecycle:lifecycle-runtime-desktop:2.8.0
Expand Down Expand Up @@ -81,6 +51,8 @@ org.jetbrains.compose.foundation:foundation-desktop:1.6.11
org.jetbrains.compose.foundation:foundation-layout-desktop:1.6.11
org.jetbrains.compose.foundation:foundation-layout:1.6.11
org.jetbrains.compose.foundation:foundation:1.6.11
org.jetbrains.compose.material3:material3-desktop:1.6.11
org.jetbrains.compose.material3:material3:1.6.11
org.jetbrains.compose.material:material-desktop:1.6.11
org.jetbrains.compose.material:material-icons-core-desktop:1.6.11
org.jetbrains.compose.material:material-icons-core:1.6.11
Expand All @@ -105,7 +77,6 @@ org.jetbrains.compose.ui:ui-unit:1.6.11
org.jetbrains.compose.ui:ui-util-desktop:1.6.11
org.jetbrains.compose.ui:ui-util:1.6.11
org.jetbrains.compose.ui:ui:1.6.11
org.jetbrains.kotlin:kotlin-stdlib-common:2.0.0
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.23
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.23
org.jetbrains.kotlin:kotlin-stdlib:2.0.0
Expand All @@ -116,7 +87,8 @@ org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.1
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1
org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.8.1
org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.8.1
org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.1
org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.6.0
org.jetbrains.kotlinx:kotlinx-datetime:0.6.0
org.jetbrains.kotlinx:kotlinx-serialization-bom:1.7.1
org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.7.1
org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ val itemRepo = DesktopAppGraph.networkGraph.itemRepo

val basicNav = MutableStateFlow(ScreenType.Home)

fun main1() = application {
fun main() = application {

Window(
onCloseRequest = ::exitApplication,
Expand All @@ -127,7 +127,7 @@ fun main1() = application {
}
}

fun main() = application {
fun main2() = application {
Window(
onCloseRequest = ::exitApplication,
title = "Compose for Desktop",
Expand Down
Loading

0 comments on commit bfddb1c

Please sign in to comment.