I am trying to add a pre-pre-build script shell to my gradle / Android-Studio construct. I added the following to app/build.gradle :
task prePreBuild << { commandLine 'ls' } preBuild.dependsOn prePreBuild
When I call my assembly using ./gradlew assembleDebug , I get the following error:
Could not find method commandLine() for arguments [ls] on project ':app'
If I replaced the commandLine line commandLine something like println 'Hello' , then it works fine, and I can see the result from my new task.
I searched for other references to "Could not find commandLine method" and found nothing. What is the correct way to invoke a shell script from this gradle task?
android android-studio gradle
Laurence gonsalves
source share