Nightly build for android project using gradle

折月煮酒 提交于 2020-01-17 05:20:07

问题


I have an android project which I'm developing in windows environment. Also a remote git repository exist which I push my project to it daily. My requirement is to have a mechanism to automate daily(or nightly) builds. I know that I can build my project in command line by aid of "gardlew.bat". This wrapper is special to my environment (windows) and I need to build the project on remote git repository which is on a linux machine. How can i build my project on a linux machine using command line?


回答1:


As part of your project's root files, you can find "gradlew.bat" that is meant to run on windows machines, and a "gradlew" file that is meant to run on a unix based system.

To build from unix command line, clone your entire project into the linux based machine and run the following command:

./gradlew assembleRelease

You need to make sure that your environment is set up correctly (JDK is installed and JAVA_HOME is configured correctly).

For detailed explanation, please refer to the Android Studio developers site for more information.




回答2:


You can install Jenkins and configure a job for building (and testing, if you have some tests) your application. Configure this job to run periodically (via embedded cron).

Jenkins can

  • clone source code from the repo
  • run gradle with the task(s) specified
  • save *.apk (save artifacts in Jenkins terminology)
  • run tests
  • and many other useful things you may be interested in

Consult https://jenkins.io/index.html



来源:https://stackoverflow.com/questions/39847688/nightly-build-for-android-project-using-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!