Skip to content

Commit 92e6f17

Browse files
committed
Workaround for gradle plugin task dependency.
1 parent 0e4d134 commit 92e6f17

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

client-sqldelight-gradle-plugin/src/main/kotlin/app/cash/backfila/client/sqldelight/plugin/BackfilaSqlDelightGradlePlugin.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package app.cash.backfila.client.sqldelight.plugin
22

3+
import app.cash.sqldelight.gradle.GenerateMigrationOutputTask
34
import app.cash.sqldelight.gradle.SqlDelightExtension
5+
import app.cash.sqldelight.gradle.SqlDelightTask
46
import java.io.Serializable
57
import org.gradle.api.NamedDomainObjectContainer
68
import org.gradle.api.Plugin
@@ -48,6 +50,16 @@ class BackfilaSqlDelightGradlePlugin : Plugin<Project> {
4850
)
4951
}
5052

53+
// This is to unblock usage. We need these dependencies so that gradle understands that sqldelight
54+
// components need these. But that with take SQLDelight changes to its plugin.
55+
// TODO: Remove these and replace with proper source sets to the correct SQLDelight tasks.
56+
target.tasks.withType(SqlDelightTask::class.java) { t ->
57+
t.dependsOn(sqlTask)
58+
}
59+
target.tasks.withType(GenerateMigrationOutputTask::class.java) { t ->
60+
t.dependsOn(sqlTask)
61+
}
62+
5163
val kotlinTask = target.tasks.register(
5264
"generateBackfilaRecordSourceQueries${backfill.name.replaceFirstChar { it.uppercase() }}",
5365
GenerateBackfilaRecordSourceQueriesTask::class.java,

service/src/main/kotlin/app/cash/backfila/ui/pages/BackfillShowAction.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,15 @@ class BackfillShowAction @Inject constructor(
332332
description = "",
333333
),
334334
) +
335-
parameters.map { (key, value) ->
336-
DescriptionListRow(
337-
label = key.removePrefix(CUSTOM_PARAMETER_PREFIX.fieldId),
338-
description = value,
339-
)
340-
}
341-
} else listOf()
335+
parameters.map { (key, value) ->
336+
DescriptionListRow(
337+
label = key.removePrefix(CUSTOM_PARAMETER_PREFIX.fieldId),
338+
description = value,
339+
)
340+
}
341+
} else {
342+
listOf()
343+
}
342344

343345
private fun TagConsumer<*>.Card(block: TagConsumer<*>.() -> Unit) {
344346
div("-mx-4 mb-8 px-4 py-8 overflow-x-auto shadow-sm ring-1 ring-gray-900/5 sm:mx-0 sm:rounded-lg sm:px-8 lg:col-span-2 lg:row-span-2 lg:row-end-2") {

0 commit comments

Comments
 (0)