Could not find method commandLine()
<p>I'm attempting to add a pre-pre-build shell script to my gradle/Android-Studio build. I've added the following to <code>app/build.gradle</code>:</p>

<pre class="lang-groovy prettyprint-override"><code>task prePreBuild &lt;&lt; {
  commandLine 'ls'
}
preBuild.dependsOn prePreBuild
</code></pre>

<p>When I invoke my build with <code>./gradlew assembleDebug</code> I get the following error:</p>

<pre class="lang-none prettyprint-override"><code>Could not find method commandLine() for arguments [ls] on project ':app'
</code></pre>

<p>If I replace the <code>commandLine</code> line with something like <code>println 'Hello'</code> then it works fine, and I can see the output from my new task.</p>

<p>I searched for other mentions of "Could not find method commandLine" and found nothing. What is the correct way to invoke a shell script from this gradle task?</p>