每晚为使用gradle的android项目构建 [英] Nightly build for android project using gradle

查看:138
本文介绍了每晚为使用gradle的android项目构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我在Windows环境下开发的android项目。
还有一个远程git存储库,我每天都把它推到我的项目上。
我的要求是有一个机制来自动化每日(或夜间)构建。
我知道我可以借助gardlew.bat在命令行中构建我的项目。这个包装对我的环境来说是特殊的(windows),我需要在linux机器上的远程git存储库上构建项目。
如何使用命令行在Linux机器上构建项目?

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?

推荐答案

作为项目根文件的一部分,你可以在windows机器上找到gradlew.bat,以及一个可以在基于Unix系统上运行的文件。

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.

要从unix命令行构建,请将整个项目克隆到基于Linux的计算机并运行以下命令:

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

./gradlew assembleRelease

您需要确保您的环境设置正确(JDK已安装并正确配置JAVA_HOME)。

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

有关详细说明,请参阅 Android Studio developers site 获取更多信息。

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

这篇关于每晚为使用gradle的android项目构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆