From 37143c72429130723e52925eef352712bc512f97 Mon Sep 17 00:00:00 2001 From: LTFan Date: Thu, 2 May 2024 18:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=A6=BB=20py=20=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client-py/build.gradle.kts | 5 +- compose-app/build.gradle.kts | 2 + gradle/libs.versions.toml | 4 +- {py => py-common}/build.gradle.kts | 3 ++ .../src/commonMain/kotlin/Message.kt | 0 py-internal/build.gradle.kts | 48 +++++++++++++++++++ .../src/commonMain/kotlin/Constants.kt | 0 server/build.gradle.kts | 3 +- settings.gradle.kts | 3 +- 9 files changed, 63 insertions(+), 5 deletions(-) rename {py => py-common}/build.gradle.kts (91%) rename {py => py-common}/src/commonMain/kotlin/Message.kt (100%) create mode 100644 py-internal/build.gradle.kts rename {py => py-internal}/src/commonMain/kotlin/Constants.kt (100%) diff --git a/client-py/build.gradle.kts b/client-py/build.gradle.kts index 3e7e360..ea4fcb6 100644 --- a/client-py/build.gradle.kts +++ b/client-py/build.gradle.kts @@ -30,7 +30,7 @@ project.version = projectVersion kotlin { val defaultSharedLibConfigure: SharedLibrary.() -> Unit = { - export(project(":py")) + export(project(":py-common")) } linuxArm64 { @@ -68,7 +68,8 @@ kotlin { sourceSets { val nativeMain by getting { dependencies { - api(project(":py")) + api(projects.pyCommon) + api(projects.pyInternal) implementation(libs.kotlinx.datetime) implementation(libs.ktor.client.core) implementation(libs.ktor.client.websockets) diff --git a/compose-app/build.gradle.kts b/compose-app/build.gradle.kts index 26a1195..0e092ad 100644 --- a/compose-app/build.gradle.kts +++ b/compose-app/build.gradle.kts @@ -67,6 +67,7 @@ kotlin { val commonMain by getting { dependencies { implementation(projects.shared) + implementation(projects.pyCommon) implementation(compose.runtime) implementation(compose.foundation) implementation(compose.animation) @@ -107,6 +108,7 @@ kotlin { dependencies { implementation(libs.kotlin.reflect) implementation(libs.kotlinx.coroutines.android) + implementation(libs.androidx.camera) implementation(libs.androidx.core.splashscreen) implementation(libs.androidx.window) implementation(libs.androidx.activity.compose) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a375a02..d5366fb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,13 +5,14 @@ kotlinx-coroutines = "1.8.0" kotlinx-datetime = "0.5.0" kotlinx-serilization = "1.6.3" agp = "8.2.2" +androidx-camera = "1.3.3" androidx-core-splashscreen = "1.0.1" androidx-window = "1.2.0" androidx-activity-compose = "1.9.0" androidx-browser = "1.8.0" androidx-datastore = "1.1.0" compose = "1.6.10-beta01" -decompose = "3.0.0-beta01" +decompose = "3.0.0" javaCv = "1.5.10" ktor = "3.0.0-beta-2-eap-930" ktor-plugin = "3.0.0-beta-1" @@ -33,6 +34,7 @@ kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutine kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" } kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" } kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serilization" } +androidx-camera = { module = "androidx.camera:camera-camera2", version.ref = "androidx-camera" } androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-core-splashscreen" } androidx-window = { module = "androidx.window:window", version.ref = "androidx-window" } androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" } diff --git a/py/build.gradle.kts b/py-common/build.gradle.kts similarity index 91% rename from py/build.gradle.kts rename to py-common/build.gradle.kts index 28da710..fccdff5 100644 --- a/py/build.gradle.kts +++ b/py-common/build.gradle.kts @@ -16,6 +16,7 @@ * with Fhraise. If not, see . */ +import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl import xyz.xfqlittlefan.fhraise.buildsrc.projectVersion plugins { @@ -33,6 +34,8 @@ kotlin { linuxX64() mingwX64() + @OptIn(ExperimentalWasmDsl::class) wasmJs() + applyDefaultHierarchyTemplate() sourceSets { diff --git a/py/src/commonMain/kotlin/Message.kt b/py-common/src/commonMain/kotlin/Message.kt similarity index 100% rename from py/src/commonMain/kotlin/Message.kt rename to py-common/src/commonMain/kotlin/Message.kt diff --git a/py-internal/build.gradle.kts b/py-internal/build.gradle.kts new file mode 100644 index 0000000..fccdff5 --- /dev/null +++ b/py-internal/build.gradle.kts @@ -0,0 +1,48 @@ +/* + * This file is part of Fhraise. + * Copyright (c) 2024 HSAS Foodies. All Rights Reserved. + * + * Fhraise is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * Fhraise is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with Fhraise. If not, see . + */ + +import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl +import xyz.xfqlittlefan.fhraise.buildsrc.projectVersion + +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.kotlinSerialization) +} + +group = "xyz.xfqlittlefan.fhraise" +project.version = projectVersion + +kotlin { + jvm() + + linuxArm64() + linuxX64() + mingwX64() + + @OptIn(ExperimentalWasmDsl::class) wasmJs() + + applyDefaultHierarchyTemplate() + + sourceSets { + val commonMain by getting { + dependencies { + implementation(libs.kotlinx.serialization.core) + } + } + } +} diff --git a/py/src/commonMain/kotlin/Constants.kt b/py-internal/src/commonMain/kotlin/Constants.kt similarity index 100% rename from py/src/commonMain/kotlin/Constants.kt rename to py-internal/src/commonMain/kotlin/Constants.kt diff --git a/server/build.gradle.kts b/server/build.gradle.kts index ece21b1..9a6d7dd 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -34,8 +34,9 @@ application { } dependencies { - implementation(project(":py")) implementation(projects.shared) + implementation(projects.pyCommon) + implementation(projects.pyInternal) implementation(libs.kotlinx.coroutines.core) implementation(libs.ktor.server.core) implementation(libs.ktor.server.cio) diff --git a/settings.gradle.kts b/settings.gradle.kts index 2d6b78f..108188e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -39,7 +39,8 @@ include(":shared") include(":compose-app") include(":server") -include(":py") +include(":py-common") +include(":py-internal") include(":client-py") include(":keycloak-spi")