title: Pass properties to custom gradle task
body: <p>How can I pass properties to gradle custom task? In ant It will look like this:</p>
  
  <pre><code>public class MyCustomTask extends Task {
  
      private String name;
      private String version;
  
      @Override
      public void execute() throws BuildException {
          // do the job
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public void setVersion(String version) {
          this.version = version;
      }
  
  }
  </code></pre>
  
  <p>How to do it in gradle?</p>
  
  <pre><code>class MyCustomTask extends DefaultTask {
  
      private String name
      private String version
  
      @TaskAction
      def build() {
          // do the job
      }
  
  }
  </code></pre>
  
  <p>Properties name and version are required and user needs to pass them to task.</p>