-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.0.0' into feat-component-scan-glob
# Conflicts: # projects/koin-ksp-compiler/src/jvmMain/kotlin/org/koin/compiler/scanner/KoinMetaDataScanner.kt
- Loading branch information
Showing
46 changed files
with
974 additions
and
430 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
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
18 changes: 18 additions & 0 deletions
18
.../android-coffee-maker/src/main/java/org/koin/sample/androidx/app/scope/ScopeComponents.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,18 @@ | ||
package org.koin.sample.androidx.app.scope | ||
|
||
import androidx.lifecycle.ViewModel | ||
import org.koin.android.annotation.KoinViewModel | ||
import org.koin.core.annotation.Scope | ||
import org.koin.core.annotation.Scoped | ||
import org.koin.sample.androidx.MainActivity | ||
import java.util.UUID | ||
|
||
@Scoped | ||
@Scope(MainActivity::class) | ||
class ScopedData { | ||
val id = UUID.randomUUID().toString() | ||
} | ||
|
||
@KoinViewModel | ||
@Scope(MainActivity::class) | ||
class ScopeViewModel(val data : ScopedData) : ViewModel() |
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
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
26 changes: 26 additions & 0 deletions
26
examples/android-library/src/main/java/org/koin/sample/clients/ClientModule.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,26 @@ | ||
package org.koin.sample.clients | ||
|
||
import io.ktor.client.HttpClient | ||
import io.ktor.client.engine.cio.CIO | ||
import org.koin.core.annotation.Module | ||
import org.koin.core.annotation.Named | ||
import org.koin.core.annotation.Single | ||
|
||
@Module(includes = [ClientModuleA::class, ClientModuleB::class]) | ||
class ClientModule | ||
|
||
@Module | ||
class ClientModuleA { | ||
|
||
@Single | ||
@Named("clientA") | ||
fun createClient() = HttpClient(CIO) {} | ||
} | ||
|
||
@Module | ||
class ClientModuleB { | ||
|
||
@Single | ||
@Named("clientB") | ||
fun createClient() = HttpClient(CIO) {} | ||
} |
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
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
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 |
---|---|---|
|
@@ -32,5 +32,6 @@ dependencies { | |
|
||
ksp { | ||
arg("KOIN_CONFIG_CHECK","true") | ||
arg("KOIN_LOG_TIMES","true") | ||
} | ||
|
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
12 changes: 12 additions & 0 deletions
12
examples/other-ksp/src/main/kotlin/org/koin/example/by/example/ByExampleSingle.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,12 @@ | ||
package org.koin.example.by.example | ||
|
||
import org.koin.core.annotation.ComponentScan | ||
import org.koin.core.annotation.Module | ||
import org.koin.core.annotation.Single | ||
|
||
@Module | ||
@ComponentScan | ||
public class ByModule | ||
|
||
@Single | ||
public class ByExampleSingle |
16 changes: 16 additions & 0 deletions
16
examples/other-ksp/src/main/kotlin/org/koin/example/defaultparam/DefaultParam.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,16 @@ | ||
package org.koin.example.defaultparam | ||
|
||
import org.koin.core.annotation.ComponentScan | ||
import org.koin.core.annotation.Factory | ||
import org.koin.core.annotation.InjectedParam | ||
import org.koin.core.annotation.Module | ||
|
||
@Module | ||
@ComponentScan | ||
public class MyModule | ||
|
||
public const val COMPONENT_DEFAULT: String = "default" | ||
|
||
@Factory | ||
public class Component(@InjectedParam public val param: String = COMPONENT_DEFAULT) | ||
|
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
18 changes: 18 additions & 0 deletions
18
examples/other-ksp/src/main/kotlin/org/koin/example/supertype/Types.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,18 @@ | ||
package org.koin.example.supertype | ||
|
||
import org.koin.core.annotation.ComponentScan | ||
import org.koin.core.annotation.Module | ||
import org.koin.core.annotation.Single | ||
|
||
@Module | ||
@ComponentScan | ||
public class SuperTypesModule | ||
|
||
public interface A | ||
|
||
public open class B : A | ||
|
||
public interface D | ||
|
||
@Single | ||
public class C : B(),D |
Oops, something went wrong.