Reputation: 23873
I am migrating from Eclipse to Android Studio. In my Eclipse implementation I used ant from the command line to run a very customised build.xml. I would like to reproduce the same functionality with Android Studio and have a build process which I could run from the command line.
I have learned that gradle can be run from the command line and find that if I type
./gradlew assembleRelease
, an apk will be produced but only if a source file has changed.
How can I make it produce the apk even when no sources have changed?
Upvotes: 0
Views: 658
Reputation: 6610
To achieve that, or rather force the regeneration of intermediary files, you should first clean the project.
The catch is, as per my comment, that intermediary objects are regenerated only when source files have been changed. The APK is regenerated only when there have been changes in the intermediary files.
Thus, the proper although workaround way to do it would be to
1) clean the project first
2) and then run the build from command line
Since the intermediary files will be deleted and regenerated, the APK should be produced every time.
The comment I was reffering to is:
Make it clean the project first. That will force rebuilding the intermediates, and will produce an APK. It really has nothing to do with source files changed but rather intermediary objects changed, and those get re-generated only when source files changed if you understand what I'm saying :)
Upvotes: 1