refactor: some tweaks in GradleProjectFactory

This commit is contained in:
2025-08-19 14:05:26 +08:00
parent 040f619413
commit b4b3511c16

View File

@@ -144,7 +144,7 @@ internal fun Project.waitForPluginAdded(id: String, action: (Plugin<*>) -> Unit)
*/
internal inline fun <reified T : BaseTask> Project.createTask(group: String, name: String) = runCatching {
T::class.java.getConstructor().newInstance().also { instance ->
task(name) {
tasks.register(name) {
this.group = group
outputs.upToDateWhen { false }
doFirst { instance.onTransaction() }