Skip to content
This repository was archived by the owner on Sep 3, 2023. It is now read-only.

Commit 6d6823d

Browse files
committed
0.6.0
1 parent 7aa36f5 commit 6d6823d

File tree

6 files changed

+15
-20
lines changed

6 files changed

+15
-20
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ code generation, so you *don't* need to write boilerplate and you *don't* need t
5656

5757
```gradle
5858
dependencies {
59-
implementation "com.afollestad:ulfberht:0.5.0"
60-
kapt "com.afollestad:ulfbert-processor:0.5.0"
59+
implementation "com.afollestad:ulfberht:0.6.0"
60+
kapt "com.afollestad:ulfbert-processor:0.6.0"
6161
}
6262
```
6363

RELEASE_NOTES.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
0.5.0
1+
0.6.0
22

3-
* Instead of setting `parent` in the `Component` annotation, you assign a component `children`. See
4-
the updated README.
5-
* Internal cleanup.
3+
* Qualifiers are annotation-based instead of string-based.

core/src/test/kotlin/com/afollestad/ulfberht/TestComponents.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ComponentParent_Component() : ComponentParent, TestBaseComponent {
4444
override val originalType: KClass<*> = ComponentParent::class
4545
override val children: MutableSet<BaseComponent> = mutableSetOf()
4646
override val modules: Set<BaseModule> = setOf(Module1_Module(this))
47-
override var runtimeDependencies: Map<String?, Any>? = null
47+
override var runtimeDependencies: Map<String, Any>? = null
4848

4949
override fun <T : Any> getProvider(
5050
wantedType: KClass<*>,
@@ -68,7 +68,7 @@ class ComponentChild1_Component() : ComponentChild1, TestBaseComponent {
6868
override val originalType: KClass<*> = ComponentParent::class
6969
override val children: MutableSet<BaseComponent> = mutableSetOf()
7070
override val modules: Set<BaseModule> = setOf(Module2_Module(this))
71-
override var runtimeDependencies: Map<String?, Any>? = null
71+
override var runtimeDependencies: Map<String, Any>? = null
7272

7373
override fun <T : Any> getProvider(
7474
wantedType: KClass<*>,
@@ -89,7 +89,7 @@ class ComponentChild2_Component() : ComponentChild2, TestBaseComponent {
8989
override val originalType: KClass<*> = ComponentParent::class
9090
override val children: MutableSet<BaseComponent> = mutableSetOf()
9191
override val modules: Set<BaseModule> = setOf(Module3_Module(this))
92-
override var runtimeDependencies: Map<String?, Any>? = null
92+
override var runtimeDependencies: Map<String, Any>? = null
9393

9494
override fun <T : Any> getProvider(
9595
wantedType: KClass<*>,

dependencies.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ ext.versions = [
22
minSdk : 19,
33
compileSdk : 29,
44
buildTools : '29.0.0',
5-
publishVersion : '0.5.0',
6-
publishVersionCode: 11,
5+
publishVersion : '0.6.0',
6+
publishVersionCode: 12,
77

88
gradlePlugin : '3.4.2',
99
spotlessPlugin : '3.24.0',

processor/src/main/kotlin/com/afollestad/ulfberht/components/ComponentBuilder.kt

+3-5
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,9 @@ internal class ComponentBuilder(
275275
"""
276276
if ($PARENT_NAME != null && $CALLED_BY === $PARENT_NAME) return null
277277
val runtimeProvider = $GET_RUNTIME_DEP_NAME<%T>($QUALIFIER)
278-
?.run { $FACTORY_EXTENSION_NAME { this } }
279-
return runtimeProvider ?: $PARENT_NAME?.let {
280-
it.$RUNTIME_DEPS_NAME = $RUNTIME_DEPS_NAME
281-
it.$GET_PROVIDER_NAME<%T>($WANTED_TYPE, $GENERIC_ARGS, $QUALIFIER, $CALLED_BY)
282-
}
278+
?.run { $FACTORY_EXTENSION_NAME { this } }
279+
return runtimeProvider ?: $PARENT_NAME
280+
?.$GET_PROVIDER_NAME<%T>($WANTED_TYPE, $GENERIC_ARGS, $QUALIFIER, $CALLED_BY)
283281
""".trimIndent() + "\n",
284282
TYPE_VARIABLE_T,
285283
TYPE_VARIABLE_T

sample-android/src/main/kotlin/com/afollestad/ulfberhtsample/app/App.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ class App : Application() {
2525

2626
override fun onCreate() {
2727
super.onCreate()
28+
if (DEBUG) {
29+
Logger.install { Log.d("Ulfberht", it) }
30+
}
2831

2932
component<AppComponent>(
3033
AppContext::class to this
3134
).inject(this)
32-
33-
if (DEBUG) {
34-
Logger.install { Log.d("Ulfberht", it) }
35-
}
3635
}
3736
}

0 commit comments

Comments
 (0)