Single-quoted strings are a series of characters surrounded by single quotes.
like :
def str='a single quoted string'
println str
Ouput :
a single quoted string
Whereas Double-quoted strings allow us the String interpolation
Here, we have a string with a placeholder referencing a local variable:
def name = 'Guillaume' // a plain string
def greeting = "Hello ${name}"
Output : Hello Guillaume
In your code,If you want to print the task name. So in that case, you need to use Double-quotes:
defaultTasks 'clean', 'run'
task clean << {
println 'Default Cleaning!'
}
task run << {
println "Default Running $run.name!"
// here Double Quotes are required to interpolate task-name
}
task other << {
println "I'm not a default task!"
}