[Gradle] Stop using flow control to locate Gradle task
^KT-57052 Fixed
This commit is contained in:
committed by
Space Team
parent
9a267176f5
commit
cc9325eb5b
+1
-6
@@ -65,12 +65,7 @@ internal inline fun <reified S : Task> TaskCollection<in S>.withType(): TaskColl
|
||||
/**
|
||||
* Locates a task by [name] and [type], without triggering its creation or configuration.
|
||||
*/
|
||||
internal inline fun <reified T : Task> Project.locateTask(name: String): TaskProvider<T>? =
|
||||
try {
|
||||
tasks.withType(T::class.java).named(name)
|
||||
} catch (e: UnknownTaskException) {
|
||||
null
|
||||
}
|
||||
internal inline fun <reified T : Task> Project.locateTask(name: String): TaskProvider<T>? = tasks.locateTask(name)
|
||||
|
||||
/**
|
||||
* Locates a task by [name] and [type], without triggering its creation or configuration.
|
||||
|
||||
Reference in New Issue
Block a user