Travis CI如何缓存Gradle依赖关系? [英] How does Travis CI cache Gradle dependencies?

查看:115
本文介绍了Travis CI如何缓存Gradle依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关缓存依赖项的Travis文档 ,它提到:


缓存的目的是使安装特定于语言的依赖性变得简单和快速,所以与Bundler,pip ,Composer,npm,Gradle,Maven是应该进入缓存的内容。


快速安装但下载速度慢的大文件不会受益于缓存,因为它们需要从缓存中从原始源下载一段时间:


我在我的Java项目中使用了Gradle。



看起来Gradle缓存是那些<$ c

所以我的问题是,为什么Travis建议高速缓存Gradle依赖如果 .jar 文件安装速度快,但下载速度慢?



更短的构建时间)来自?

解决方案

这是一个很好的问题。我不确定缓存使用的好处,因为我从来没有测量过S3的下载时间,但它可能更快。

在链接页面的末尾,他们解释:


如果您在
缓存中存储大于几百兆的档案,则不太可能会看到显着的速度提升。


看来他们认为缓存大量小文件比单独下载文件要快。



他们不建议使用缓存来快速安装文件,而SLOW可以像下载一样在我看来,他们这样说是因为你伤害了他们的S3配额(我不知道这项服务的条款),一个在这种情况下您享有的优惠。

In Travis documentation about caching dependencies, it mentions:

The cache’s purpose is to make installing language-specific dependencies easy and fast, so everything related to tools like Bundler, pip, Composer, npm, Gradle, Maven, is what should go into the cache.

Large files that are quick to install but slow to download do not benefit from caching, as they take as long to download from the cache as from the original source:

I am using Gradle in my Java project.

It seems what Gradle caches is those .jar files, which should fall in the category "quick to install".

So my question is, why Travis recommends caching Gradle dependencies if .jar files are quick to install but slow to download?

Where does the benefits (in terms of shorter build time) come from?

解决方案

It's a good question. I'm not sure about the benefits of cache usage because I never measured the download time of S3, but it's probably faster.

At the end of the linked page they explain:

If you store archives larger than a few hundred megabytes in the cache, it’s unlikely that you’ll see a significant speed improvement.

It seems that they consider faster to cache a lot of small files than downloading them independently.

Gradle files fit in this category are quick to install and FAST to download.

They don't recommend to use cache for quick to install files and SLOW to download like the system images of 1GB of Android.

In my opinion, they say this because you are hurting their S3 quotas (I have no idea about the terms of this service) for a negligible benefit for you in this case.

这篇关于Travis CI如何缓存Gradle依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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