So Im mostly new to gradle and Im trying to convert an old android ant build to gradle. I think I have most of it figured out but one of the last things Im trying to accomplish is using the Exec task to zipalign my apk. My dev machine runs windows so I have my task set like this
task(zipAlign, dependsOn: runApkSigTool, type: Exec) { taskGraph ->
workingDir ‘C:/studiobuild/myapp/app/apk’
commandLine ‘cmd’, ‘/c’, ‘C:/software_downloads/android_sdk/sdk/sdk/build-tools/19.1.0/zipalign -f -v 4 V2.5-10-debug-20140924.apk V2.5-10-debug-20140924.apk’
//executable ‘C:/software_downloads/android_sdk/sdk/sdk/build-tools/19.1.0/zipalign -c -v 4 V2.5-10-debug-20140924.apk’
println commandLine
System.out.println("---------------------zipAlign ran for debug------------------");
}
When the command line prints I just see all the text that I tried to run as a command. I know Im missing something but its not very apparent from reading the documentation. Do I need to make a .bat file or something or is gradle capable of running input commands like how Im trying to use it.