-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrating android source to platform specific
- Loading branch information
1 parent
866c017
commit 80563ba
Showing
43 changed files
with
263 additions
and
149 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,46 @@ | ||
@file:OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
|
||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi | ||
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
||
plugins { | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsKotlinAndroid) | ||
alias(libs.plugins.kotlinMultiplatform) | ||
} | ||
|
||
kotlin { | ||
explicitApi = ExplicitApiMode.Strict | ||
|
||
androidTarget { | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_1_8) | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
api(libs.kotlinx.coroutines.core) | ||
api(libs.kotlinx.immutable) | ||
} | ||
|
||
androidMain.dependencies { | ||
implementation(libs.androidx.core.ktx) | ||
api(libs.kotlinx.coroutines.android) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "dev.androidbroadcast.news.common" | ||
compileSdk = 34 | ||
compileSdk = libs.versions.androidSdk.min.get().toInt() | ||
|
||
defaultConfig { | ||
minSdk = 24 | ||
compileSdk = libs.versions.androidSdk.compile.get().toInt() | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.kotlinx.coroutines.core) | ||
api(libs.kotlinx.immutable) | ||
} |
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
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
core/common/src/commonMain/kotlin/dev/androidbroadcast/common/Logger.kt
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,13 @@ | ||
package dev.androidbroadcast.common | ||
|
||
public interface Logger { | ||
public fun d( | ||
tag: String, | ||
message: String | ||
) | ||
|
||
public fun e( | ||
tag: String, | ||
message: String | ||
) | ||
} |
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 |
---|---|---|
@@ -1,39 +1,49 @@ | ||
@file:OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
|
||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi | ||
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
||
plugins { | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsKotlinAndroid) | ||
alias(libs.plugins.kotlinMultiplatform) | ||
} | ||
|
||
kotlin { | ||
explicitApi = ExplicitApiMode.Strict | ||
|
||
androidTarget { | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_1_8) | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(projects.core.common) | ||
implementation(projects.core.database) | ||
implementation(projects.core.opennewsApi) | ||
} | ||
|
||
androidMain.dependencies { | ||
implementation(libs.kotlinx.coroutines.android) | ||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.javax.inject) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "dev.androidbroadcast.news.data" | ||
compileSdk = 34 | ||
compileSdk = libs.versions.androidSdk.min.get().toInt() | ||
|
||
defaultConfig { | ||
minSdk = 24 | ||
compileSdk = libs.versions.androidSdk.compile.get().toInt() | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.kotlinx.coroutines.android) | ||
|
||
implementation(projects.core.database) | ||
implementation(projects.core.opennewsApi) | ||
implementation(projects.core.common) | ||
|
||
implementation(libs.javax.inject) | ||
} |
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -21,7 +21,3 @@ public data class Article( | |
} | ||
} | ||
|
||
public data class Source( | ||
val id: String, | ||
val name: String | ||
) |
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
core/data/src/commonMain/kotlin/dev/androidbroadcast/news/data/model/Source.kt
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,6 @@ | ||
package dev.androidbroadcast.news.data.model | ||
|
||
public data class Source( | ||
val id: String, | ||
val name: String | ||
) |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,21 +1,44 @@ | ||
plugins { | ||
alias(libs.plugins.jetbrainsKotlinJvm) | ||
alias(libs.plugins.kotlinSerialization) | ||
alias(libs.plugins.kapt) | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.androidLibrary) | ||
// KAPT не поддерживает KMP | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
kotlin { | ||
androidTarget() | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
implementation(libs.kotlinx.coroutines.core) | ||
api(libs.kotlinx.serialization.json) | ||
} | ||
|
||
androidMain.dependencies { | ||
implementation(libs.retrofit) | ||
implementation(libs.androidx.annotation) | ||
implementation(libs.retrofit.converter.kotlinx.serialization) | ||
implementation(libs.retrofit.adapters.result) | ||
api(libs.okhttp) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(libs.retrofit) | ||
implementation(libs.kotlinx.coroutines.core) | ||
api(libs.kotlinx.serialization.json) | ||
implementation(libs.androidx.annotation) | ||
implementation(libs.retrofit.converter.kotlinx.serialization) | ||
implementation(libs.retrofit.adapters.result) | ||
api(libs.okhttp) | ||
kapt(libs.retrofit.responseTypeKeeper) | ||
android { | ||
namespace = "dev.androidbroadcast.news.database" | ||
compileSdk = libs.versions.androidSdk.min.get().toInt() | ||
|
||
defaultConfig { | ||
compileSdk = libs.versions.androidSdk.compile.get().toInt() | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,35 +1,53 @@ | ||
@file:OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
|
||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
||
plugins { | ||
alias(libs.plugins.androidLibrary) | ||
alias(libs.plugins.jetbrainsKotlinAndroid) | ||
alias(libs.plugins.kotlinMultiplatform) | ||
alias(libs.plugins.compose.compiler) | ||
alias(libs.plugins.jetbrainsCompose) | ||
alias(libs.plugins.detekt) | ||
} | ||
|
||
kotlin { | ||
androidTarget { | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_1_8) | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
api(compose.ui) | ||
api(compose.runtime) | ||
api(compose.foundation) | ||
api(compose.material3) | ||
implementation(compose.components.uiToolingPreview) | ||
} | ||
|
||
androidMain.dependencies { | ||
implementation(libs.androidx.core.ktx) | ||
// Need only for debug | ||
implementation(libs.androidx.compose.ui.tooling) | ||
// Need only for debug | ||
implementation(libs.androidx.compose.ui.test.manifest) | ||
implementation(project.dependencies.platform(libs.androidx.compose.bom)) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "dev.androidbroadcast.news.uikit" | ||
compileSdk = 34 | ||
compileSdk = libs.versions.androidSdk.min.get().toInt() | ||
|
||
defaultConfig { | ||
minSdk = 24 | ||
compileSdk = libs.versions.androidSdk.compile.get().toInt() | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(libs.androidx.core.ktx) | ||
implementation(platform(libs.androidx.compose.bom)) | ||
api(libs.androidx.compose.ui) | ||
api(libs.androidx.compose.ui.graphics) | ||
api(libs.androidx.compose.ui.tooling.preview) | ||
api(libs.androidx.compose.runtime) | ||
api(libs.androidx.material3) | ||
debugApi(libs.androidx.compose.ui.tooling) | ||
debugApi(libs.androidx.compose.ui.test.manifest) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.