Difference between extra properties and variables in Gradle tasks?
gradle, properties, variables
Solution
The first snippet declares a local variable which is only visible within the enclosing block. The second snippet adds an extra property that extends Gradle's object model and is visible everywhere the task is visible. Unless you have a reason to extend the object model, use a local variable.
Problem
What exactly is difference between these two tasks in Gradle: ``` task sampleTask { String myFile = "sample.txt" delete myFile } task sampleTask { ext.myFile = "sample.txt" delete myFile } ``` Are they basically the same or do they differ somehow?