File tree Expand file tree Collapse file tree 7 files changed +10
-9
lines changed
main/kotlin/org/koin/example/qualifier
test/kotlin/org.koin.example
koin-ksp-compiler/src/jvmMain/kotlin/org/koin/compiler/generator Expand file tree Collapse file tree 7 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ lifecycleCompose = "2.9.2"
1212coil = " 3.2.0"
1313
1414koin = " 4.1.1"
15- koin-annotations = " 2.2.0 "
15+ koin-annotations = " 2.2.1-alpha-316 "
1616kotzilla = " 1.2.2"
1717ksp = " 2.1.21-2.0.2"
1818
Original file line number Diff line number Diff line change 55# Core
66kotlin = " 2.1.21"
77koin = " 4.1.0"
8- koinAnnotations = " 2.2.0 "
8+ koinAnnotations = " 2.2.1-alpha-316 "
99ksp = " 2.1.21-2.0.2"
1010junit = " 4.13.2"
1111# Android
Original file line number Diff line number Diff line change @@ -37,5 +37,6 @@ public class QualifierModule {
3737 public fun anotherList (): StuffList = StuffList (listOf (Stuff (" 1" ),Stuff (" 2" )))
3838
3939 @Single
40+ @Named(" another-counter" )
4041 public fun anotherCounter (@Named(" another-counter" ) stuffs : StuffList ): StuffCounter = StuffCounter (stuffs.list," another-counter" )
4142}
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ class TestModule {
113113 assertEquals(ints,koin.get<MyInjectFactory >{ parametersOf(ints) }.ints)
114114
115115 assertEquals(2 ,koin.get<StuffList >(named(" another-counter" )).list.size)
116- assertEquals(" another-counter" ,koin.get<StuffCounter >().name)
116+ assertEquals(" another-counter" ,koin.get<StuffCounter >(named( " another-counter " ) ).name)
117117
118118 assertNotNull(koin.getOrNull<MyType .MyChildType >())
119119
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ org.gradle.parallel=true
77# Kotlin
88kotlin.code.style =official
99# Koin
10- koinAnnotationsVersion =2.2.0
10+ koinAnnotationsVersion =2.2.1-alpha-316
1111# Android
1212android.useAndroidX =true
1313androidMinSDK =14
Original file line number Diff line number Diff line change @@ -35,12 +35,12 @@ class ApplicationClassWriter(
3535 }
3636
3737 private fun writeConfigurationMap () {
38- val configurationListString = application.configurations?.flatMap { configuration -> configuration.modules }?.distinct()?.let { generateIncludes(it) }
38+ val configurationListString = application.configurations?.flatMap { configuration -> configuration.modules }?.distinct()?.let { generateIncludes(it.sortedBy { it.packageName + " . " + it.className } ) }
3939 writeln(" $visibility val $extensionBase .configurationModules : List<Module> get() = listOf($configurationListString )" )
4040 }
4141
4242 private fun writeKoinConfigurationField () {
43- val moduleIncludes = application.moduleIncludes?.let { " + listOf(${generateIncludes(it)} )" } ? : " "
43+ val moduleIncludes = application.moduleIncludes?.let { " + listOf(${generateIncludes(it.sortedBy { it.packageName + " . " + it.className } )} )" } ? : " "
4444 val configString = """
4545 $visibility fun $extensionBase .koinConfiguration(config : KoinAppDeclaration?=null) : KoinAppDeclaration = {
4646 includes(config)
Original file line number Diff line number Diff line change @@ -161,12 +161,12 @@ abstract class ModuleWriter(
161161
162162 open fun writeModuleIncludes () {
163163 if (module.includes?.isNotEmpty() == true ){
164- writeln(" ${TAB } includes(${generateIncludes(module.includes)} )" )
164+ writeln(" ${TAB } includes(${generateIncludes(module.includes.sortedBy { it.packageName + " . " + it.className } )} )" )
165165 }
166166 }
167167
168168 open fun writeDefinitions () {
169- val (standardDefinitions, scopeDefinitions) = module.definitions.partition { it.isNotScoped() }
169+ val (standardDefinitions, scopeDefinitions) = module.definitions.sortedBy { it.packageName + " " + it.label } . partition { it.isNotScoped() }
170170
171171 standardDefinitions.forEach { definitionFactory.writeDefinition(it, module) }
172172
@@ -207,7 +207,7 @@ abstract class ModuleWriter(
207207 private fun generateScopeFooter (): String = " ${TAB } }"
208208
209209 open fun writeExternalDefinitionCalls () {
210- if (module.externalDefinitions.isNotEmpty()){
210+ if (module.externalDefinitions.sortedBy { it.name } . isNotEmpty()){
211211 writeln(TAB + generateExternalDefinitionCalls())
212212 }
213213 }
You can’t perform that action at this time.
0 commit comments