Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cleanup and resolve app module startup crash #251

Merged
merged 1 commit into from
Oct 7, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.MainScope
import org.koin.android.scope.AndroidScopeComponent
import org.koin.androidx.fragment.android.setupKoinFragmentFactory
import org.koin.androidx.scope.activityRetainedScope
import org.koin.core.component.KoinScopeComponent

abstract class AbstractActivity<B: ViewBinding> : AppCompatActivity(),
CoroutineScope by MainScope(), KoinScopeComponent {
CoroutineScope by MainScope(), AndroidScopeComponent {

override val scope by activityRetainedScope()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import org.koin.android.scope.AndroidScopeComponent
import org.koin.androidx.scope.fragmentScope
import org.koin.core.component.KoinScopeComponent

abstract class AbstractFragment<B: ViewBinding>(@LayoutRes layoutId: Int) : Fragment(layoutId),
CoroutineScope by MainScope(), KoinScopeComponent {
CoroutineScope by MainScope(), AndroidScopeComponent {

override val scope by fragmentScope()

Expand Down
3 changes: 0 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import org.gradle.accessors.dm.LibrariesForLibs
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile

plugins {
`kotlin-dsl`
`maven-publish`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ open class CorePlugin : Plugin<Project> {
* Inspecting available extensions
*/
private fun Project.availableExtensions() {
val extensionSchema = project.extensions.extensionsSchema
extensionSchema.forEach {
println("Available extension for module ${project.path}: ${it.name} -> ${it.publicType}")
extensions.extensionsSchema.forEach {
logger.lifecycle("Available extension for module ${project.path}: ${it.name} -> ${it.publicType}")
}
}

/**
* Inspecting available components
*/
private fun Project.availableComponents() {
val collectionSchema = project.components.asMap
collectionSchema.forEach {
println("Available component for module ${project.path}: ${it.key} -> ${it.value}")
components.forEach {
logger.lifecycle("Available component for module ${project.path}: ${it.name} -> ${it}")
}
}

Expand Down
Loading