New major version 5.0.0 of gradle-download-task

Today, I’m happy to an­nounce the new ma­jor ver­sion 5.0.0 of the pop­u­lar gradle-down­load-task. With this Gradle plug­in, you can down­load files in your build scripts and dis­play pro­gress in­form­a­tion. The re­lease notes for the new ver­sion are rather ex­tens­ive this time. High­lights in­clude down­load­ing mul­tiple files in par­al­lel, con­cur­rent ex­e­cu­tion with other build tasks, and bet­ter sup­port for Kot­lin and Gradle 8 (see full list of changes be­low). Up­dat­ing is re­com­men­ded for all users.

Grab gradle-down­load-task 5.0.0 while it’s still hot:
https://github.com/michel-kraemer/gradle-download-task

The new ver­sion has been tested with Gradle 5.0 up to 7.3.3 but should be com­pat­ible to any newer ver­sion as well.

New features

  • The plug­in can now down­load mul­tiple files in par­al­lel
  • Down­load tasks can now be ex­ecuted con­cur­rently with other build tasks
  • Writ­ing to disk is per­formed asyn­chron­ously (and there­fore in par­al­lel to the down­load)
  • The des­tin­a­tion file name is dis­played in the pro­gress mes­sage
  • The plug­in logs retry at­tempts
  • It re­tries down­loads on any ex­cep­tion but UnknownHostException
  • The download and verify ex­ten­sions are now com­pat­ible with Kot­lin and Gradle 8
  • Sup­port for lazy eval­u­ation of Kot­lin lambdas has been ad­ded
  • Kot­lin ex­ample build scripts have been ad­ded

Breaking changes

  • The plug­in now re­quires Java 8 (or higher) and Gradle 5 (or higher)
  • The authScheme prop­erty has been re­moved. The plug­in is now able to de­tect the re­quired scheme it­self.
  • Due to in­com­pat­ib­il­ity with Gradle 8, the download and verify ex­ten­sions now need to be called through their run method.
  • Fur­ther in­form­a­tion can be found in the mi­gra­tion guide be­low

Maintenance

  • In­teg­ra­tion tests for all Gradle ver­sions up to 7.3.3 have been ad­ded
  • Gradle has been up­graded to 6.9.1
  • Apache Ht­tp­Cli­ent has been up­graded to 5.1.2
  • The tests have been mi­grated to JU­nit 5 and As­sertJ
  • Ja­C­oCo has been en­abled for testkit tests
  • JU­nit test re­ports are now up­loaded on fail­ure on the CI server
  • Func­tional tests are now ex­ecuted for all Gradle ver­sions from the build script

Others

  • The README file has been im­proved
  • There is a cool new screen­cast 😎

Migrating from version 4.x to 5.x

gradle-down­load-task 5.0.0 in­tro­duces the fol­low­ing break­ing changes:

  • The authScheme prop­erty has been re­moved. The plug­in now auto­mat­ic­ally de­tects the cor­rect scheme to use based on the server re­sponse.
  • The download ex­ten­sion was in­com­pat­ible with Gradle 8. Also, us­ing it from Kot­lin build scripts was rather in­con­veni­ent. It is there­fore now ne­ces­sary to call the ex­ten­sion through its run method. Re­place download { ... } with download.run { ... }. The same ap­plies to the verify ex­ten­sion.

More information

If you want to learn more about the plug­in, have a look at its README file or at my earlier post.

I also strongly ad­vice you to read my blog post on 10 re­cipes for gradle-down­load-task to get an idea what you can do with the plug­in.

If you or your com­pany use any of my pro­jects or like what I’m do­ing, please con­sider spon­sor­ing me so I can con­tinue main­tain­ing and de­vel­op­ing my pro­jects and new ones!

Thank you so much for your sup­port!


Posted by Michel Krämer
on January, 29th 2022.