fix: Always make the generated patch depend on the source patch

This commit is contained in:
oSumAtrIX 2023-09-13 05:18:28 +02:00
parent a1fbb7990f
commit 8de30633ae
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -154,18 +154,18 @@ class PatchProcessor(
)
}
patchAnnotation.dependencies?.let { dependencies ->
addSuperclassConstructorParameter(
"dependencies = setOf(%L, %L)",
buildList {
addAll(dependencies)
}.joinToString(", ") { dependency ->
"${(dependencyResolutionMap[dependency] ?: dependency)}::class"
},
// Also add the source class of the generated class so that it is also executed.
"${patchDeclaration.toClassName()}::class"
)
}
// The generated patch always depends on the source patch.
addSuperclassConstructorParameter(
"dependencies = setOf(%L)",
buildList {
patchAnnotation.dependencies?.forEach { dependency ->
add("${(dependencyResolutionMap[dependency] ?: dependency)}::class")
}
add("${patchDeclaration.toClassName()}::class")
}.joinToString(", "),
)
addSuperclassConstructorParameter(
"use = %L", patchAnnotation.use
)