New major version 4.0.0 of gradle-download-task

Today, I’m happy to an­nounce the new ma­jor ver­sion 4.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 new ver­sion con­tains many new fea­tures and up­dat­ing is re­com­men­ded for all users.

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

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

New features

  • I re­lo­cated the Apache Ht­tp­Cli­ent lib­rary. In earlier ver­sions, some users ex­per­i­enced de­pend­ency con­flicts, in par­tic­u­lar if they were us­ing the An­droid Gradle plug­in. This should not hap­pen any­more be­cause the Ht­tp­Cli­ent is now isol­ated and in its own pack­age.
  • Er­ror mes­sages now con­tain HTTP status codes (see is­sue #115)
  • It is now pos­sible to auto­mat­ic­ally retry failed re­quests (#83)
  • The timeout prop­erty has been re­named to connectTimeout and readTimeout (#126). See mi­gra­tion notes be­low.
  • URLs of failed down­loads are now logged to the con­sole (#127)

Maintenance

  • I re­move prop­er­ties de­prec­ated in earlier ver­sions
  • Sup­port for Gradle 1.x and Java 6 has been dropped
  • I ad­ded in­teg­ra­tion tests for Gradle up to ver­sion 5.4.1
  • All unit tests have been mi­grated to WireMock for bet­ter main­ten­ance
  • I fixed a couple of com­piler warn­ings

Bug fixes

  • Com­pres­sion is now really dis­abled if the compress flag is false
  • PlainConnectionSocketFactory.INSTANCE is now ex­pli­citly re­gistered for HTTP (#133)
  • I fixed a num­ber of as­ser­tion er­rors (#114)
  • HTTP re­sponses will now al­ways be closed even if they failed

Migrating from version 3.x to 4.x

In this new ma­jor ver­sion, I made the fol­low­ing break­ing changes to the API:

  • The plug­in now re­quires Gradle 2.x (or higher) and Java 7 (or higher)
  • I re­moved the timeout prop­erty and in­tro­duced connectTimeout and readTimeout in­stead. This al­lows you to con­trol the in­di­vidual timeouts bet­ter. Also, it im­proves com­pat­ib­il­ity with Gradle 5.x, where all tasks have a timeout prop­erty by de­fault.
  • The credentials prop­erty has been re­moved. The same ap­plies to the pos­sib­il­ity to pass in­stances of Apache Ht­tp­Cli­ent’s AuthScheme to the authScheme prop­erty. The strings Basic and Digest are now the only ac­cep­ted val­ues. There is no re­place­ment. If you need this func­tion­al­ity, please file an is­sue.
  • The prop­er­ties requestInterceptor and responseInterceptor have been re­moved. There is no re­place­ment. Again, if you need this func­tion­al­ity, please file an is­sue.

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.


Posted by Michel Krämer
on July, 6th 2019.