title: How to run a command line command with Kotlin DSL in Gradle 6.1.1?
body: <p>I am trying to run the code block below, after reading multiple posts on the topic and the Gradle manual. I run the below and get the following error: execCommand == null!</p>
  <p>Any ideas on what I am doing wrong with the below code block?</p>
  <pre class="lang-kotlin prettyprint-override"><code>open class BuildDataClassFromAvro : org.gradle.api.tasks.Exec() {
  
      @TaskAction
      fun build() {
          println(&quot;Building data classes.....&quot;)
          commandLine(&quot;date&quot;)
      }
  }
  
  tasks.register&lt;BuildDataClassFromAvro&gt;(&quot;buildFromAvro&quot;) {
      description = &quot;Do stuff&quot;
  }
  </code></pre>