简体   繁体   English

使用Jenkins&Gradle构建Android应用

[英]Building Android app with Jenkins & Gradle

I'm a devops engineer, and my company is building their first Android app. 我是一名devops工程师,我的公司正在构建他们的第一个Android应用程序。 For all of our other projects, we've used Jenkins to handle builds. 对于我们所有其他项目,我们使用Jenkins来处理构建。

I've read quite a few tutorials on getting android building on Jenkins and they all seem to rely on Gradle. 我已经阅读了很多有关在Jenkins上构建android的教程,它们似乎都依赖于Gradle。 I'd like to get out in front of the devs a bit and start the job. 我想在开发人员面前走一点,然后开始工作。 Is it possible that the app that they build doesn't support Gradle? 他们构建的应用可能不支持Gradle吗? What scenarios are those, so I can influence decisions? 这些场景是什么,所以我可以影响决策?

Maybe Gradle isn't the latest thing, if not, what is? 也许Gradle不是最新的东西,如果不是,那是什么?

Is it possible that the app that they build doesn't support Gradle? 他们构建的应用可能不支持Gradle吗?

It is possible that they are not currently building the app with Gradle, but highly unlikely that the app could not be built with Gradle. 他们当前可能没有使用Gradle 构建应用程序,但是极不可能无法使用Gradle构建应用程序。

What scenarios are those, so I can influence decisions? 这些场景是什么,所以我可以影响决策?

The most likely scenario where they are not building with Gradle, is that they use the Eclipse IDE to develop the app. 他们不使用Gradle进行构建的最可能情况是,他们使用Eclipse IDE来开发应用程序。 Eclipse projects have historically been built more often with Ant or Maven. 从历史上看,Eclipse项目通常是使用Ant或Maven构建的。 But an Eclipse project can be built with Gradle. 但是可以使用Gradle构建Eclipse项目。 That said, configuring an Android project to be built with Gradle is not a requirement to build that project with Jenkins. 就是说,配置要使用Gradle构建的Android项目并不是用Jenkins构建该项目的要求。 Ant, Maven, and other build tools play nice with Jenkins also. Ant,Maven和其他构建工具也可以与Jenkins配合使用。 So, if your dev team is using a build tool other than Gradle, that shouldn't be a blocker for you. 因此,如果您的开发团队正在使用Gradle以外的构建工具,那么这对您来说就不会成为障碍。 You should be able to accommodate them, if that's going to cause less friction. 如果这样可以减少摩擦,则应该可以容纳它们。

Maybe Gradle isn't the latest thing, if not, what is? 也许Gradle不是最新的东西,如果不是,那是什么?

I'm not sure about latest , but Gradle does currently have a lot of momentum as the build tool of choice for Android projects because it is the default build tool for Android Studio (which is positioned to replace Eclipse as the default Android IDE). 我不确定最新消息 ,但是Gradle作为Android项目的首选构建工具目前确实势头强劲,因为它是Android Studio的默认构建工具(可以代替Eclipse作为默认Android IDE)。


So, my advice would be to ask your dev team what IDE and build tool they are currently using, and go from there... (if they use Eclipse and you want to build with Gradle: Is it possible to use the Gradle build system for Android with Eclipse? ) 因此,我的建议是询问您的开发团队当前正在使用的IDE和构建工具,然后从那里开始...(如果他们使用Eclipse且您想使用Gradle进行构建: 是否可以使用Gradle构建系统用于带有Eclipse的Android吗?

Source: At the company I work for, I develop two Android apps and make daily builds with Jenkins. 资料来源:在我工作的公司,我开发了两个Android应用程序,并使用Jenkins进行日常构建。 A few months ago I switched from Eclipse (Ant) to Android Studio (Gradle). 几个月前,我从Eclipse(Ant)切换到Android Studio(Gradle)。

I hope this was helpful. 我希望这可以帮到你。 I have not answered many questions on here so I'm not entirely sure I'm doing it right. 我在这里没有回答很多问题,所以我不确定自己做对了。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM