From c21cc85035a086c20a53c2853ac77ec910448a8f Mon Sep 17 00:00:00 2001 From: stslex Date: Sun, 17 Dec 2023 16:22:34 +0300 Subject: [PATCH] init core auth --- core/auth/build.gradle.kts | 47 +++++++++++++++++++ .../network/api/base/BaseNetworkClient.kt | 2 +- gradle/libs.versions.toml | 8 ++++ iosApp/CoreAuthPodfile | 5 ++ settings.gradle.kts | 1 + 5 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 core/auth/build.gradle.kts create mode 100644 iosApp/CoreAuthPodfile diff --git a/core/auth/build.gradle.kts b/core/auth/build.gradle.kts new file mode 100644 index 00000000..b729443d --- /dev/null +++ b/core/auth/build.gradle.kts @@ -0,0 +1,47 @@ +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.androidLibrary) + alias(libs.plugins.kotlinCocoapods) +} + +kotlin { + androidTarget { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + jvm("desktop") + + iosX64() + iosArm64() + iosSimulatorArm64() + cocoapods { + summary = "Some description for the Shared Module" + homepage = "Link to the Shared Module homepage" + version = "1.0" + ios.deploymentTarget = "16.0" + podfile = project.file(project.rootProject.projectDir.path + "/iosApp/CoreAuthPodfile") + framework { + baseName = "coreAuth" + } + } + + sourceSets { + commonMain.dependencies { + implementation(project(":core:core")) + implementation(project(":core:database")) + implementation(project(":core:network")) + } + } +} + +android { + namespace = "com.stslex.core.auth" + compileSdk = libs.versions.android.compileSdk.get().toInt() + defaultConfig { + minSdk = libs.versions.android.minSdk.get().toInt() + } +} \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/core/network/api/base/BaseNetworkClient.kt b/core/network/src/commonMain/kotlin/com/stslex/core/network/api/base/BaseNetworkClient.kt index 1d5eea25..91f2ce1a 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/core/network/api/base/BaseNetworkClient.kt +++ b/core/network/src/commonMain/kotlin/com/stslex/core/network/api/base/BaseNetworkClient.kt @@ -1,10 +1,10 @@ package com.stslex.core.network.api.base import com.stslex.core.core.AppDispatcher -import com.stslex.core.network.api.base.model.DefaultRequest import com.stslex.core.network.api.base.NetworkClientBuilder.setupDefaultRequest import com.stslex.core.network.api.base.NetworkClientBuilder.setupLogging import com.stslex.core.network.api.base.NetworkClientBuilder.setupNegotiation +import com.stslex.core.network.api.base.model.DefaultRequest import io.ktor.client.HttpClient import io.ktor.client.engine.cio.CIO import io.ktor.client.plugins.cache.HttpCache diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5c23105c..a66a8444 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -30,6 +30,8 @@ kamel = "0.9.0" coil = "2.5.0" buildConfig = "4.2.0" +lifecycleRuntimeKtx = "2.6.2" +composeBom = "2023.08.00" [libraries] kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } @@ -79,6 +81,12 @@ coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", ve coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" } +androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" } +androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } +androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" } +androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } +androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } +androidx-material3 = { group = "androidx.compose.material3", name = "material3" } [plugins] kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } diff --git a/iosApp/CoreAuthPodfile b/iosApp/CoreAuthPodfile new file mode 100644 index 00000000..49fd65ce --- /dev/null +++ b/iosApp/CoreAuthPodfile @@ -0,0 +1,5 @@ +target 'test' do + use_frameworks! + platform :ios, '16.0' + pod 'auth', :path => '../core/auth' +end \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index a5d0437c..60641b83 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,3 +29,4 @@ include(":feature:film") include(":feature:profile") include(":feature:match_feed") include(":feature:auth") +include(":core:auth")