title: Gradle exec task with doLast fails
body: <p>I'm trying to run an exec task only if a file has been updated since the last build. My initial attempt looked like this:</p>
  
  <pre><code>task generateLocalizedStrings(type:Exec) {
      ext.srcFile = file('../../../localization/language-files/en_US/wdmobilestringres.properties')
      ext.destDir = new File("src/main/res")
      inputs.file srcFile
      outputs.dir destDir
  
      doLast {
          println "Executing localization script"
          workingDir '../../../localization/'
          commandLine 'python', 'localizationScript.py'
      }
  }
  </code></pre>
  
  <p>However, this fails with "execCommand == null!"</p>
  
  <p>I found a workaround but I'd really prefer a proper solution. </p>
  
  <pre><code>task generateLocalizedStrings(type:Exec) {
      ext.srcFile = file('../../../localization/language-files/en_US/wdmobilestringres.properties')
      ext.destDir = new File("src/main/res")
      inputs.file srcFile
      outputs.dir destDir
  
      workingDir '../../../localization/'
      commandLine 'python', 'dummyScript.py'
  
      doLast {
          println "Executing localization script"
          workingDir '../../../localization/'
          commandLine 'python', 'localizationScript.py'
      }
  }
  </code></pre>