Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

composeApp agora é um modulo library como outro qualquer

run: ./gradlew :androidApp:assembleDebug

- name: Run Android/CommonMain unit tests
run: ./gradlew testDebugUnitTest
Expand Down
38 changes: 38 additions & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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)
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

52 changes: 12 additions & 40 deletions build-logic/src/main/java/com.streamplayer.kmp-library.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,63 +1,35 @@
@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

val libs = the<LibrariesForLibs>()

plugins {
id("org.jetbrains.kotlin.multiplatform")
id("com.android.library")
id("com.android.kotlin.multiplatform.library")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

com.android.library não funciona mais, agora precisamos usar com.android.kotlin.multiplatform.library

id("org.jetbrains.kotlin.plugin.serialization")
id("kotlin-parcelize")
id("com.streamplayer.dokka")
id("com.streamplayer.detekt")
}

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()
}
57 changes: 0 additions & 57 deletions build-logic/src/main/java/extensions/CommonExtensions.kt

This file was deleted.

1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 4 additions & 10 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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)

Expand Down
11 changes: 0 additions & 11 deletions composeApp/kotzilla.json
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kotzilla voltará aqui #88

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Original file line number Diff line number Diff line change
@@ -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> {
lottieViewProvider
}
})

monitoring(
onConfig = {
onConfig { useIosCrashReport = false }
streamPlayerApplication {
modules(
module {
single<LottieViewProvider> {
lottieViewProvider
}
}
)
}
Expand Down
Loading
Loading