I'm automating the publication of my Android app and I'm using Gradle, great utility!
Just a problem, consider this .bat file (under Windows 7):
:: assemble the project
gradle assemble -Pprofile_name=%profile_name% -p%destination_dir%
::copy apk to repository
copy "D:\compile\myapp\build\apk\*.apk" "d:\build_repository"
Well the copy command is never executed, never. It seems that the execution stops after calling gradle utility. Any idea?
The build within Gradle has ends with success and no error at all...
I ran into this very same problem, but for a webapp. Gradle isn't necessarily the issue, but how you are invoking it. As explained in this post,
How to execute more than one maven command in bat file?
because gradle is a batch file itself, it completes execution and doesn't return control back to your batch file. Use the same 'call' strategy and everything should work. Like so for your original post,
call gradle assemble -Pprofile_name=%profile_name% -p%destination_dir%
::copy apk to repository
copy "D:\compile\myapp\build\apk\*.apk" "d:\build_repository"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With