From 53bc7286ce55bd81aa0a087a0f5938eef4d33749 Mon Sep 17 00:00:00 2001 From: Maciej Procyk Date: Sat, 23 Dec 2023 17:13:15 +0100 Subject: [PATCH] update dependencies versions --- Dockerfile | 4 +- android-app/build.gradle.kts | 30 +- .../kotlin/minigames/activity/MainActivity.kt | 9 +- .../src/androidMain/res/values/themes.xml | 15 +- build-src/gradle.properties | 2 +- build-src/src/main/kotlin/BuildSrcPlugin.kt | 7 - build-src/src/main/kotlin/Constants.kt | 6 +- build-src/src/main/kotlin/Dependencies.kt | 28 +- desktop-app/build.gradle.kts | 22 +- .../ml/dev/kotlin/minigames/app/MainApp.kt | 0 .../resources/ic_launcher.icns | Bin .../resources/ic_launcher.ico | Bin .../resources/ic_launcher.png | Bin gradle.properties | 15 +- gradle/wrapper/gradle-wrapper.jar | Bin 61574 -> 63375 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 16 +- server/build.gradle.kts | 59 +- .../ml/dev/kotlin/minigames/db/DbSettings.kt | 7 +- .../dev/kotlin/minigames/db/model/BaseUUID.kt | 31 + .../ml/dev/kotlin/minigames/db/model/User.kt | 31 + .../kotlin/minigames/db/model/UserEntity.kt | 20 - .../ml/dev/kotlin/minigames/server/Server.kt | 4 +- .../minigames/server/routes/GameRoutes.kt | 2 +- .../kotlin/minigames/service/GameService.kt | 11 +- .../kotlin/minigames/service/UserService.kt | 39 +- .../dev/kotlin/minigames/util/RoutesUtil.kt | 6 +- settings.gradle.kts | 5 + shared-client/build.gradle.kts | 120 ++- .../MiniGamesAppComponentContext.kt} | 13 +- .../kotlin/minigames/shared/main.android.kt | 14 +- .../shared/ui/component/DropdownMenuParts.kt | 10 +- .../shared/viewmodel/ViewModelSettings.kt | 5 +- .../kotlin/minigames/shared/MiniGamesApp.kt | 62 +- .../shared/component/AbstractComponent.kt | 105 +++ .../shared/component/BirdComponent.kt | 39 + .../shared/component/ChatComponent.kt | 69 ++ .../shared/component/CountingComponent.kt | 32 + .../shared/component/GameComponent.kt | 112 +++ .../shared/component/LogInComponent.kt | 189 ++++ .../shared/component/MiniGamesAppComponent.kt | 148 +++ .../component/MiniGamesAppComponentContext.kt | 10 + .../component/NotificationsComponent.kt | 33 + .../shared/component/RegisterComponent.kt | 135 +++ .../shared/component/SetComponent.kt | 47 + .../shared/component/SnakeComponent.kt | 49 + .../shared/rest/client/RestApiClient.kt | 4 +- .../dev/kotlin/minigames/shared/ui/Routes.kt | 99 -- .../minigames/shared/ui/component/Aligned.kt | 13 - .../minigames/shared/ui/component/Button.kt | 10 +- .../minigames/shared/ui/component/Chat.kt | 94 +- .../shared/ui/component/DropdownMenu.kt | 27 +- .../ui/component/DropdownMenuInternal.kt | 4 +- .../shared/ui/component/FormField.kt | 16 +- .../shared/ui/component/GameTopBar.kt | 11 +- .../minigames/shared/ui/component/Icon.kt | 4 +- .../minigames/shared/ui/component/Loading.kt | 4 +- .../shared/ui/component/Notifications.kt | 28 +- .../minigames/shared/ui/component/Players.kt | 32 +- .../shared/ui/component/ProportionKeeper.kt | 2 +- .../ui/component/RecompositionHighlighter.kt | 99 ++ .../shared/ui/component/ScrollScreen.kt | 45 +- .../shared/ui/component/Swipeable.kt | 879 ++++++++++++++++++ .../shared/ui/component/ToastOverlay.kt | 63 -- .../shared/ui/component/UserDataRow.kt | 33 +- .../shared/ui/component/bird/Bird.kt | 14 +- .../shared/ui/component/bird/BirdGamePlay.kt | 21 +- .../shared/ui/component/bird/Positioned.kt | 2 +- .../shared/ui/component/bird/Spike.kt | 6 +- .../shared/ui/component/set/SetCard.kt | 8 +- .../shared/ui/component/set/SetGamePlay.kt | 20 +- .../ui/component/snake/SnakeBackground.kt | 10 +- .../ui/component/snake/SnakeGamePlay.kt | 25 +- .../minigames/shared/ui/screen/GameScreen.kt | 78 +- .../shared/ui/screen/LoadingScreen.kt | 10 +- .../minigames/shared/ui/screen/LogInScreen.kt | 100 +- .../shared/ui/screen/RegisterScreen.kt | 152 +-- .../minigames/shared/ui/screen/ToastScreen.kt | 23 - .../kotlin/minigames/shared/ui/theme/Shape.kt | 2 +- .../kotlin/minigames/shared/ui/theme/Theme.kt | 12 +- .../minigames/shared/ui/theme/Typography.kt | 28 +- .../shared/ui/util/ChildrenRouterUtil.kt | 227 ----- .../minigames/shared/ui/util/DecomposeUtil.kt | 63 ++ .../minigames/shared/ui/util/NavigatorUtil.kt | 92 -- .../minigames/shared/ui/util/StateUtil.kt | 5 + .../shared/viewmodel/BirdGameViewModel.kt | 27 - .../shared/viewmodel/ChatViewModel.kt | 44 - .../shared/viewmodel/GameViewModel.kt | 52 -- .../shared/viewmodel/LogInViewModel.kt | 94 -- .../viewmodel/NotificationsViewModel.kt | 34 - .../shared/viewmodel/RegisterViewModel.kt | 35 - .../shared/viewmodel/SetGameViewModel.kt | 30 - .../shared/viewmodel/SnakeGameViewModel.kt | 34 - .../minigames/shared/viewmodel/ViewModel.kt | 28 - .../shared/viewmodel/ViewModelContext.kt | 10 - .../shared/viewmodel/ViewModelSettings.kt | 3 +- .../shared/websocket/client/GameClient.kt | 8 +- .../websocket/client/WebsocketApiClient.kt | 13 +- .../kotlin/minigames/shared/main.desktop.kt | 24 - .../shared/viewmodel/ViewModelContext.kt | 11 - shared-client/src/iosMain/kotlin/main.ios.kt | 9 +- .../component/MiniGamesAppComponentContext.kt | 9 + .../shared/ui/component/DropdownMenuParts.kt | 4 +- .../shared/viewmodel/ViewModelContext.kt | 11 - .../shared/viewmodel/ViewModelSettings.kt | 3 +- .../component/MiniGamesAppComponentContext.kt | 9 + .../kotlin/minigames/shared/main.desktop.kt | 47 + .../minigames/shared/rest/RestApiConfig.kt | 0 .../shared/rest/client/RestJsonApiClient.kt | 0 .../shared/ui/component/DropdownMenuParts.kt | 4 +- .../shared/ui/component/FormFieldParts.kt | 0 .../kotlin/minigames/shared/ui/theme/Fonts.kt | 0 .../kotlin/minigames/shared/util/SwingUtil.kt | 25 + .../shared/viewmodel/ViewModelSettings.kt | 3 +- .../shared/websocket/WebsocketApiConfig.kt | 0 .../websocket/client/WebsocketApiClient.kt | 0 shared/build.gradle.kts | 28 +- .../minigames/shared/model/BirdGameModel.kt | 2 +- .../shared/model/GameMessageModel.kt | 2 +- .../minigames/shared/model/MessageModel.kt | 2 +- .../minigames/shared/model/SetGameModel.kt | 2 +- .../minigames/shared/model/UserModel.kt | 14 +- .../minigames/shared/util/CollectionUtil.kt | 2 +- system.properties | 2 +- 124 files changed, 2866 insertions(+), 1688 deletions(-) rename desktop-app/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/app/MainApp.kt (100%) rename desktop-app/src/{desktopMain => jvmMain}/resources/ic_launcher.icns (100%) rename desktop-app/src/{desktopMain => jvmMain}/resources/ic_launcher.ico (100%) rename desktop-app/src/{desktopMain => jvmMain}/resources/ic_launcher.png (100%) create mode 100644 server/src/jvmMain/kotlin/ml/dev/kotlin/minigames/db/model/BaseUUID.kt create mode 100644 server/src/jvmMain/kotlin/ml/dev/kotlin/minigames/db/model/User.kt delete mode 100644 server/src/jvmMain/kotlin/ml/dev/kotlin/minigames/db/model/UserEntity.kt rename shared-client/src/androidMain/kotlin/ml/dev/kotlin/minigames/shared/{viewmodel/ViewModelContext.kt => component/MiniGamesAppComponentContext.kt} (61%) create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/AbstractComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/BirdComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/ChatComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/CountingComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/GameComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/LogInComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/MiniGamesAppComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/MiniGamesAppComponentContext.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/NotificationsComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/RegisterComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/SetComponent.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/component/SnakeComponent.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/Routes.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/component/Aligned.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/component/RecompositionHighlighter.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/component/Swipeable.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/component/ToastOverlay.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/screen/ToastScreen.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/util/ChildrenRouterUtil.kt create mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/util/DecomposeUtil.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/ui/util/NavigatorUtil.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/BirdGameViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/ChatViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/GameViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/LogInViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/NotificationsViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/RegisterViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/SetGameViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/SnakeGameViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/ViewModel.kt delete mode 100644 shared-client/src/commonMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/ViewModelContext.kt delete mode 100644 shared-client/src/desktopMain/kotlin/ml/dev/kotlin/minigames/shared/main.desktop.kt delete mode 100644 shared-client/src/desktopMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/ViewModelContext.kt create mode 100644 shared-client/src/iosMain/kotlin/ml/dev/kotlin/minigames/shared/component/MiniGamesAppComponentContext.kt delete mode 100644 shared-client/src/iosMain/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/ViewModelContext.kt create mode 100644 shared-client/src/jvmMain/kotlin/ml/dev/kotlin/minigames/shared/component/MiniGamesAppComponentContext.kt create mode 100644 shared-client/src/jvmMain/kotlin/ml/dev/kotlin/minigames/shared/main.desktop.kt rename shared-client/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/shared/rest/RestApiConfig.kt (100%) rename shared-client/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/shared/rest/client/RestJsonApiClient.kt (100%) rename shared-client/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/shared/ui/component/DropdownMenuParts.kt (88%) rename shared-client/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/shared/ui/component/FormFieldParts.kt (100%) rename shared-client/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/shared/ui/theme/Fonts.kt (100%) create mode 100644 shared-client/src/jvmMain/kotlin/ml/dev/kotlin/minigames/shared/util/SwingUtil.kt rename shared-client/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/shared/viewmodel/ViewModelSettings.kt (70%) rename shared-client/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/shared/websocket/WebsocketApiConfig.kt (100%) rename shared-client/src/{desktopMain => jvmMain}/kotlin/ml/dev/kotlin/minigames/shared/websocket/client/WebsocketApiClient.kt (100%) diff --git a/Dockerfile b/Dockerfile index 0e3f3ca6..3d4861c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM openjdk:11-jdk-slim AS build +FROM openjdk:17-jdk-slim AS build COPY . . RUN chmod +x ./gradlew RUN ./gradlew server:shadowJar -FROM openjdk:11-jdk-slim +FROM openjdk:17-jdk-slim ARG POSTGRES_PORT ARG POSTGRES_DB diff --git a/android-app/build.gradle.kts b/android-app/build.gradle.kts index 6db6d261..15725d51 100644 --- a/android-app/build.gradle.kts +++ b/android-app/build.gradle.kts @@ -22,35 +22,35 @@ android { } buildTypes { getByName("release") { - signingConfig isMinifyEnabled = true proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } tasks.withType { kotlinOptions { - jvmTarget = "11" + jvmTarget = "17" } } } kotlin { - android() + jvmToolchain(17) + + androidTarget() + sourceSets { - named("androidMain") { - dependencies { - implementation(project(":shared")) - implementation(project(":shared-client")) - implementation(Dependencies.androidXActivity) - implementation(Dependencies.androidXActivityCompose) - implementation(Dependencies.androidGoogleMaterial) - implementation(Dependencies.essentyInstanceKeeper) - implementation(Dependencies.decompose) - } + androidMain.dependencies { + implementation(project(":shared")) + implementation(project(":shared-client")) + implementation(Dependencies.androidXActivity) + implementation(Dependencies.androidXActivityCompose) + implementation(Dependencies.decompose) + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("androidx.appcompat:appcompat-resources:1.6.1") } } } diff --git a/android-app/src/androidMain/kotlin/ml/dev/kotlin/minigames/activity/MainActivity.kt b/android-app/src/androidMain/kotlin/ml/dev/kotlin/minigames/activity/MainActivity.kt index 4026602f..699680b2 100644 --- a/android-app/src/androidMain/kotlin/ml/dev/kotlin/minigames/activity/MainActivity.kt +++ b/android-app/src/androidMain/kotlin/ml/dev/kotlin/minigames/activity/MainActivity.kt @@ -2,14 +2,17 @@ package ml.dev.kotlin.minigames.activity import android.os.Bundle import androidx.activity.ComponentActivity -import com.arkivanov.essenty.backpressed.BackPressedHandler +import com.arkivanov.decompose.defaultComponentContext +import ml.dev.kotlin.minigames.shared.component.MiniGamesAppComponentContext +import ml.dev.kotlin.minigames.shared.component.MiniGamesAppComponentImpl import ml.dev.kotlin.minigames.shared.setMainAndroidApp class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - val backPressedHandler = BackPressedHandler(onBackPressedDispatcher) - setMainAndroidApp(backPressedHandler) + val appContext = MiniGamesAppComponentContext(applicationContext, window) + val component = MiniGamesAppComponentImpl(appContext, defaultComponentContext()) + setMainAndroidApp(component) } } diff --git a/android-app/src/androidMain/res/values/themes.xml b/android-app/src/androidMain/res/values/themes.xml index b5d6ced8..6ed03479 100644 --- a/android-app/src/androidMain/res/values/themes.xml +++ b/android-app/src/androidMain/res/values/themes.xml @@ -1,17 +1,8 @@ - + -