I’m trying to write kotlin script gradle configuration file, and click with ctrl to jar task, this code opens:
val TaskContainer.`jar`: TaskProvider<org.gradle.api.tasks.bundling.Jar>
get() = named<org.gradle.api.tasks.bundling.Jar>(“jar”)
What means TaskContainer.`jar`?
TaskContainer interface is not interested for me. I’m not understand what this construct syntax means
A TaskContainer
is responsible for managing a set of Task
instances.
You can obtain a TaskContainer
instance by calling Project.getTasks()
, or using the tasks
property in your build script.
Those are the first lines of the first result of the search I linked to you.
Also the docs says that it extends Collection<Task>
, if you are not familiar with collections in Java, Google it! If you are not familiar with Gradle’s Task
class, Google it! If you are not familiar with Gradle’s Jar
task that extends Task
, Google it!
For the syntax, backticks allows you to use some ASCII symbols inside function/variable name, such as space. Since the Kotlin Gradle DSL is mostly generated, Gradle Devs decided to use really often backticks for synthetic function/variable names to be sure that if any Groovy source had those prohibited characters, the code generated in Kotlin could handle them.
Ok, I don’t know about backticks before. Thanks!