diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2dacf4cc..0e09dac9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,8 +44,8 @@ jobs: key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: gradle-${{ runner.os }}- - - name: Build Android (composeApp) - run: ./gradlew :composeApp:assembleDebug + - name: Build Android (androidApp) + run: ./gradlew :androidApp:assembleDebug - name: Run Android/CommonMain unit tests run: ./gradlew testDebugUnitTest diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts new file mode 100644 index 00000000..2a5aea06 --- /dev/null +++ b/androidApp/build.gradle.kts @@ -0,0 +1,38 @@ +plugins { + id("com.android.application") + alias(libs.plugins.jetbrains.compose) + alias(libs.plugins.compose.compiler) + alias(libs.plugins.google.services) + alias(libs.plugins.firebase.crashlytics) +} + +android { + namespace = Config.applicationId + + defaultConfig { + applicationId = Config.applicationId + minSdk = Config.minSdkVersion + compileSdk = Config.compileSdkVersion + targetSdk = Config.targetSdkVersion + versionCode = Config.versionCode + versionName = Config.versionName + multiDexEnabled = true + } + + compileOptions { + sourceCompatibility = Config.javaVersion + targetCompatibility = Config.javaVersion + } +} + +dependencies { + implementation(libs.core.ktx) + implementation(projects.composeApp) + implementation(libs.koin.android) + implementation(libs.lottie) + implementation(project.dependencies.platform(libs.firebase.bom)) + implementation(libs.firebase.analytics) + implementation(libs.firebase.crashlytics) + implementation(libs.koin.core) + implementation(libs.activity.compose) +} diff --git a/composeApp/src/google-services.json b/androidApp/google-services.json similarity index 100% rename from composeApp/src/google-services.json rename to androidApp/google-services.json diff --git a/composeApp/src/androidMain/AndroidManifest.xml b/androidApp/src/main/AndroidManifest.xml similarity index 100% rename from composeApp/src/androidMain/AndroidManifest.xml rename to androidApp/src/main/AndroidManifest.xml diff --git a/composeApp/src/androidMain/kotlin/com.codandotv.streamplayerapp/presentation/CustomApplication.kt b/androidApp/src/main/kotlin/com/codandotv/streamplayerapp/presentation/CustomApplication.kt similarity index 81% rename from composeApp/src/androidMain/kotlin/com.codandotv.streamplayerapp/presentation/CustomApplication.kt rename to androidApp/src/main/kotlin/com/codandotv/streamplayerapp/presentation/CustomApplication.kt index 208a88c7..a5a52b6e 100644 --- a/composeApp/src/androidMain/kotlin/com.codandotv.streamplayerapp/presentation/CustomApplication.kt +++ b/androidApp/src/main/kotlin/com/codandotv/streamplayerapp/presentation/CustomApplication.kt @@ -3,23 +3,20 @@ package com.codandotv.streamplayerapp.presentation import android.app.Application import com.codandotv.streamplayerapp.core.shared.ui.R import com.codandotv.streamplayerapp.core_background_work.worker.WorkScheduler -import com.codandotv.streamplayerapp.di.AppModule +import com.codandotv.streamplayerapp.di.streamPlayerApplication import com.mmk.kmpnotifier.notification.NotifierManager import com.mmk.kmpnotifier.notification.configuration.NotificationPlatformConfiguration -import io.kotzilla.generated.monitoring import org.koin.android.ext.koin.androidContext -import org.koin.core.context.startKoin class CustomApplication : Application() { override fun onCreate() { super.onCreate() - startKoin { - androidContext(this@CustomApplication.applicationContext) - modules(AppModule.list) - monitoring() + streamPlayerApplication { + androidContext(this@CustomApplication.applicationContext) } + WorkScheduler.scheduleSync(this) initializeNotification() } diff --git a/composeApp/src/androidMain/kotlin/com.codandotv.streamplayerapp/presentation/MainActivity.kt b/androidApp/src/main/kotlin/com/codandotv/streamplayerapp/presentation/MainActivity.kt similarity index 95% rename from composeApp/src/androidMain/kotlin/com.codandotv.streamplayerapp/presentation/MainActivity.kt rename to androidApp/src/main/kotlin/com/codandotv/streamplayerapp/presentation/MainActivity.kt index 679bd2b6..8ceb3041 100644 --- a/composeApp/src/androidMain/kotlin/com.codandotv.streamplayerapp/presentation/MainActivity.kt +++ b/androidApp/src/main/kotlin/com/codandotv/streamplayerapp/presentation/MainActivity.kt @@ -3,7 +3,6 @@ package com.codandotv.streamplayerapp.presentation import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent -import androidx.core.view.WindowCompat import com.codandotv.streamplayerapp.StreamPlayerApp import com.google.firebase.Firebase import com.google.firebase.initialize diff --git a/build-logic/src/main/java/com.streamplayer.application.gradle.kts b/build-logic/src/main/java/com.streamplayer.application.gradle.kts deleted file mode 100644 index 2e948946..00000000 --- a/build-logic/src/main/java/com.streamplayer.application.gradle.kts +++ /dev/null @@ -1,54 +0,0 @@ -@file:Suppress("UnstableApiUsage") - -import extensions.iosTarget -import extensions.setupAndroidDefaultConfig -import extensions.setupCompileOptions -import extensions.setupPackingOptions -import org.gradle.accessors.dm.LibrariesForLibs - -val libs = the() - -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.multiplatform") - id("kotlin-parcelize") - id("com.streamplayer.dokka") - id("com.streamplayer.detekt") -} - -kotlin { - jvmToolchain(21) - - androidTarget { - compilerOptions { - jvmTarget.set(Config.jvmTarget) - } - } - - iosTarget() -} - -android { - namespace = Config.applicationId - - setupCompileOptions() - setupPackingOptions() - setupAndroidDefaultConfig() - - defaultConfig { - applicationId = Config.applicationId - minSdk = Config.minSdkVersion - targetSdk = Config.targetSdkVersion - versionCode = Config.versionCode - versionName = Config.versionName - multiDexEnabled = true - } -} - -dependencies { - add("dokkaPlugin", libs.dokka) -} - -tasks.register("coverageReport") { - dependsOn(":app:koverHtmlReportDebug") -} diff --git a/build-logic/src/main/java/com.streamplayer.kmp-library.gradle.kts b/build-logic/src/main/java/com.streamplayer.kmp-library.gradle.kts index 149a784b..ea8f4626 100644 --- a/build-logic/src/main/java/com.streamplayer.kmp-library.gradle.kts +++ b/build-logic/src/main/java/com.streamplayer.kmp-library.gradle.kts @@ -1,10 +1,6 @@ @file:Suppress("UnstableApiUsage") import extensions.iosTarget -import extensions.setupAndroidDefaultConfig -import extensions.setupCompileOptions -import extensions.setupNameSpace -import extensions.setupPackingOptions import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.kotlin.dsl.the @@ -12,7 +8,7 @@ val libs = the() plugins { id("org.jetbrains.kotlin.multiplatform") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") id("org.jetbrains.kotlin.plugin.serialization") id("kotlin-parcelize") id("com.streamplayer.dokka") @@ -20,44 +16,20 @@ plugins { } kotlin { - jvmToolchain(21) + android { + val moduleName = project.displayName + .removePrefix("project ") + .replace(":", ".") + .replace("'", "") + .replace("-", ".") - androidTarget { - compilerOptions { - jvmTarget.set(Config.jvmTarget) - freeCompilerArgs.add("-Xstring-concat=inline") - } - } - - iosTarget() -} - -android { - setupNameSpace(project) + namespace = "${Config.applicationId}$moduleName" - setupCompileOptions() + compileSdk = Config.compileSdkVersion + minSdk = Config.minSdkVersion - setupPackingOptions() - - setupAndroidDefaultConfig() - defaultConfig.targetSdk = Config.targetSdkVersion - - buildTypes { - getByName("release") { - isMinifyEnabled = true - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - consumerProguardFiles("proguard-rules.pro") - } - - getByName("debug") { - isMinifyEnabled = false - } + androidResources.enable = true } -} -dependencies { - add("dokkaPlugin", libs.dokka) + iosTarget() } diff --git a/build-logic/src/main/java/extensions/CommonExtensions.kt b/build-logic/src/main/java/extensions/CommonExtensions.kt deleted file mode 100644 index 9056fb14..00000000 --- a/build-logic/src/main/java/extensions/CommonExtensions.kt +++ /dev/null @@ -1,57 +0,0 @@ -package extensions - -import Config -import com.android.build.api.dsl.CommonExtension -import org.gradle.api.Project -import org.gradle.api.artifacts.VersionCatalog -import org.gradle.api.artifacts.VersionCatalogsExtension -import org.gradle.kotlin.dsl.getByType - -internal fun CommonExtension<*, *, *, *, *, *>.setupPackingOptions() { - packaging { - resources { - with(pickFirsts) { - add("META-INF/library_release.kotlin_module") - add("META-INF/LICENSE.md") - add("META-INF/LICENSE-notice.md") - } - with(excludes) { - add("META-INF/AL2.0") - add("META-INF/LGPL2.1") - } - } - } -} - -internal fun CommonExtension<*, *, *, *, *, *>.setupAndroidDefaultConfig() { - defaultConfig { - compileSdk = Config.compileSdkVersion - minSdk = Config.minSdkVersion - vectorDrawables.useSupportLibrary = true - - testInstrumentationRunner = Config.testInstrumentationRunner - } -} - -internal fun CommonExtension<*, *, *, *, *, *>.setupCompileOptions() { - compileOptions { - sourceCompatibility = Config.javaVersion - targetCompatibility = Config.javaVersion - } -} - -internal fun CommonExtension<*, *, *, *, *, *>.setupNameSpace(project: Project) { - val moduleName = project.displayName - .removePrefix("project ") - .replace(":", ".") - .replace("'", "") - .replace("-", ".") - - namespace = "${Config.applicationId}$moduleName" -} - -internal val Project.libs: VersionCatalog - get() { - return project.extensions.getByType() - .named("libs") - } diff --git a/build.gradle.kts b/build.gradle.kts index c3456e7b..962a7f6c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,6 @@ import java.net.URI plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false - alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.serialization) apply false alias(libs.plugins.kotlin.multiplatform) apply false alias(libs.plugins.jetbrains.compose) apply false diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 0337f0a5..9bc52423 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -1,16 +1,9 @@ @file:Suppress("UnstableApiUsage") plugins { - id("com.streamplayer.application") + id("com.streamplayer.kmp-library") alias(libs.plugins.jetbrains.compose) alias(libs.plugins.compose.compiler) - alias(libs.plugins.google.services) - alias(libs.plugins.firebase.crashlytics) - alias(libs.plugins.kotzilla) -} - -kotzilla { - versionName = Config.versionName } kotlin { @@ -29,12 +22,13 @@ kotlin { implementation(projects.featureProfile) implementation(projects.featureNews) implementation(projects.coreShared) - implementation(projects.coreSharedUi) + api(projects.coreSharedUi) + api(projects.coreCameraGallery) + api(projects.coreBackgroundWork) implementation(projects.corePermission) implementation(projects.coreNavigation) implementation(projects.coreNetworking) implementation(projects.coreLocalStorage) - implementation(projects.coreBackgroundWork) implementation(libs.bundles.compose) diff --git a/composeApp/kotzilla.json b/composeApp/kotzilla.json deleted file mode 100644 index 8ef542e0..00000000 --- a/composeApp/kotzilla.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "sdkVersion": "1.4.2", - "keys": [ - { - "appId": "019cca1a-c2ae-79d5-bf91-20316edd8f11", - "applicationPackageName": "com.codandotv.streamplayerapp", - "keyId": "019cca1b-46f0-7cb9-aa50-9ed092ed11fe", - "apiKey": "ktz-sdk-_sEL6C-eAYe1KiqBm1mOv1BoKAOtOFpeK40ADc49LaA" - } - ] -} diff --git a/composeApp/src/commonMain/kotlin/com.codandotv.streamplayerapp/di/AppModule.kt b/composeApp/src/commonMain/kotlin/com.codandotv.streamplayerapp/di/AppModule.kt index cdebe0ed..5da57d51 100644 --- a/composeApp/src/commonMain/kotlin/com.codandotv.streamplayerapp/di/AppModule.kt +++ b/composeApp/src/commonMain/kotlin/com.codandotv.streamplayerapp/di/AppModule.kt @@ -7,16 +7,21 @@ import com.codandotv.streamplayerapp.core_shared.qualifier.QualifierDispatcherIO import com.codandotv.streamplayerapp.feature_list_streams.list.di.ListStreamModule import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.IO +import org.koin.core.KoinApplication +import org.koin.core.context.startKoin import org.koin.dsl.module import org.koin.ksp.generated.module -object AppModule { - private val module = module { - single(QualifierDispatcherIO) { Dispatchers.IO } +fun streamPlayerApplication(platformBlock: KoinApplication.() -> Unit): KoinApplication { + return startKoin { + platformBlock() + modules( + module { single(QualifierDispatcherIO) { Dispatchers.IO } }, + NetworkModule().module, + LocalStorageModule.module, + SyncModule.module, + ListStreamModule.module, + ) } - val list = module + - NetworkModule().module + - LocalStorageModule.module + - SyncModule.module + - ListStreamModule.module } + diff --git a/composeApp/src/iosMain/kotlin/com.codandotv.streamplayerapp/di/KoinIosHelper.kt b/composeApp/src/iosMain/kotlin/com.codandotv.streamplayerapp/di/KoinIosHelper.kt index cfe2292a..c2de4634 100644 --- a/composeApp/src/iosMain/kotlin/com.codandotv.streamplayerapp/di/KoinIosHelper.kt +++ b/composeApp/src/iosMain/kotlin/com.codandotv.streamplayerapp/di/KoinIosHelper.kt @@ -1,22 +1,16 @@ package com.codandotv.streamplayerapp.di import com.codandotv.streamplayerapp.presentation.components.LottieViewProvider -import io.kotzilla.generated.monitoring -import org.koin.core.context.startKoin import org.koin.dsl.module class KoinIosHelper { fun initKoin(lottieViewProvider: LottieViewProvider) { - startKoin { - modules(AppModule.list + module { - single { - lottieViewProvider - } - }) - - monitoring( - onConfig = { - onConfig { useIosCrashReport = false } + streamPlayerApplication { + modules( + module { + single { + lottieViewProvider + } } ) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e75e8b2c..a39e80bc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] -kotlin = "2.3.10" -android_gradle_plugin = "8.9.1" +kotlin = "2.3.20" +android_gradle_plugin = "9.1.0" koin = "4.2.0" koin-annotations = "2.3.1" ksp = "2.3.5" @@ -169,7 +169,6 @@ kotzilla = { id = "io.kotzilla.kotzilla-plugin", version.ref = "kotzilla" } android_application = { id = "com.android.application", version.ref = "android_gradle_plugin" } android_library = { id = "com.android.library", version.ref = "android_gradle_plugin" } -kotlin_android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose_plugin_multiplataform" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f6742b47..d864d546 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,8 @@ -#Thu Mar 05 21:58:53 BRT 2026 +#Mon May 04 14:42:33 BRT 2026 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionSha256Sum=b266d5ff6b90eada6dc3b20cb090e3731302e553a27c5d3e4df1f0d76beaff06 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj index a23166b7..afe73fa0 100644 --- a/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -207,8 +207,7 @@ 7555FF77242A565900829871 /* Sources */, B92378962B6B1156000C7307 /* Frameworks */, 7555FF79242A565900829871 /* Resources */, - - E5F2457C9C6047898FF08BDA /* Kotzilla Dsym */,); + ); buildRules = ( ); dependencies = ( @@ -327,24 +326,6 @@ shellPath = /bin/sh; shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n"; }; - E5F2457C9C6047898FF08BDA /* Kotzilla Dsym */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Kotzilla Dsym"; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 1; - shellPath = /bin/sh; - shellScript = "# KOTZILLA_SCRIPT_VERSION=9\nset -e\nM=$BUILT_PRODUCTS_DIR/$PRODUCT_NAME.app/kotzilla-debug\n[ \"$CONFIGURATION\" = Release ] && rm -f \"$M\" 2>/dev/null || touch \"$M\" 2>/dev/null\n[ -z \"$DWARF_DSYM_FOLDER_PATH\" ] && exit 0\ncd \"$SRCROOT/..\"\n./gradlew ':composeApp:uploadDsymFile' --dsymPath=\"$DWARF_DSYM_FOLDER_PATH\"\n"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -388,7 +369,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = P8ZZXHC5BB; + DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; @@ -558,7 +539,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; - DEVELOPMENT_TEAM = P8ZZXHC5BB; + DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme b/iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme index e76a2fbd..54af452c 100644 --- a/iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme +++ b/iosApp/iosApp.xcodeproj/xcshareddata/xcschemes/iosApp.xcscheme @@ -43,7 +43,7 @@ + +