如何配置gradle这个工作"离线" (使用缓存依赖性)离线、依赖性、缓存、工作

2023-09-07 00:06:17 作者:-你在我心里是常驻

我有一个命令行的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?

感谢

推荐答案

摇篮确实避免重新下载文物一个很好的工作,但你可以通过 - 离线 以年级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.