How to configure gradle to work quot;offlinequot; (using cached dependencies)(如何配置 gradle 以“离线工作(使用缓存的依赖项))
问题描述
我有一个命令行 apk 生成器,它使用相同的源代码编译大量 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 dependencies.
在 gradle 文档中我可以看到:
In the gradle documentation I can see this:
Gradle 项目需要网络连接才能下载依赖项.
The Gradle project needs network connectivity to download dependencies.
我知道可以将 gradle 配置为离线工作,而不是下载它为其他 apk 下载的相同依赖项.如何激活这种离线模式?
I know that it is possible to configure gradle to work offline and not download the same dependencies that it has downloaded for other apks. How can this offline mode be activated?
推荐答案
Gradle 在避免重新下载工件方面做得很好,但是你可以通过 --offline
到 Gradle 以防止在构建期间访问网络.
Gradle does a good job of avoiding re-downloading artifacts, but you can pass --offline
to Gradle to prevent from accessing the network during builds.
例如
gradle --offline build
如果它需要网络中没有的东西,而不是尝试获取它,你的构建将会失败.
If it needs something from the network that it doesn't have, instead of attempting to fetch it, your build will fail.
这篇关于如何配置 gradle 以“离线"工作(使用缓存的依赖项)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何配置 gradle 以“离线"工作(使用缓存的依
基础教程推荐
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01