如何配置gradle这个工作"离线" (使用缓存依赖性) [英] How to configure gradle to work "offline" (using cached dependencies)

查看:412
本文介绍了如何配置gradle这个工作"离线" (使用缓存依赖性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个命令行的apk生成器,编译了很多使用相同的源$ C ​​$ C的APK,使这些应用程序具有相同的依赖性。

I have a command line apk generator which compiles a lot of APKs using the same source code, so these apps have the same dependences.

在文档的gradle我可以看到这一点:的摇篮项目需要网络连接才能下载的依赖

In gradle documentation i can see this: The Gradle project needs network connectivity to download dependencies.

我知道这是可能的gradle配置脱机工作并且不下载所有被编译的APK它下载的APK其他同样依赖关系的时间。如何解决这个离线模式下激活?

I know that it is possible to configure gradle to work offline and to not download all the times it is compiling an apk the same dependences that it has download for other apks. How can this offline mode be activated?

感谢

推荐答案

摇篮确实避免重新下载文物一个很好的工作,但你可以通过<一个href=\"https://docs.gradle.org/current/userguide/dependency_management.html#sec:cache_command_line_options\"相对=nofollow> - 离线 以年级prevent访问网络构建过程中。如果需要从网络上的东西,它不具备的,而不是试图把它拿来,构建就会失败。

Gradle does a good job of avoiding redownloading artifacts, but you can pass --offline to grade to prevent from accessing the network during builds. If it needs something from the network that it doesn't have, instead of attempting to fetch it, your build will fail.

这篇关于如何配置gradle这个工作&QUOT;离线&QUOT; (使用缓存依赖性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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