Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Kotlin | 44,195 | 1,523 | 3,600 | 2 hours ago | 77 | September 07, 2022 | 149 | Kotlin | ||
The Kotlin Programming Language. | ||||||||||
Androiddevtools | 7,528 | 5 days ago | 4 | |||||||
收集整理Android开发所需的Android SDK、开发中用到的工具、Android开发教程、Android设计规范,免费的设计素材等。 | ||||||||||
Gradle Retrolambda | 5,388 | 68 | 3 | 4 years ago | 40 | April 21, 2019 | 74 | apache-2.0 | Java | |
A gradle plugin for getting java lambda support in java 6, 7 and android | ||||||||||
Detekt | 5,258 | 28 | 10 hours ago | 30 | August 30, 2021 | 170 | apache-2.0 | Kotlin | ||
Static code analysis for Kotlin | ||||||||||
Packer Ng Plugin | 4,796 | 32 | 1 | 9 months ago | 12 | March 03, 2017 | 21 | apache-2.0 | Java | |
下一代Android打包工具(对Gradle 7.x的支持,欢迎提PR) | ||||||||||
Gradle Versions Plugin | 3,553 | 11 | 8 | 17 hours ago | 20 | May 31, 2017 | 73 | apache-2.0 | Kotlin | |
Gradle plugin to discover dependency updates | ||||||||||
Gradle_plugin_android_aspectjx | 3,499 | 2 years ago | 145 | apache-2.0 | Groovy | |||||
A Android gradle plugin that effects AspectJ on Android project and can hook methods in Kotlin, aar and jar file. | ||||||||||
Shadow | 3,212 | a day ago | 216 | apache-2.0 | Groovy | |||||
Gradle plugin to create fat/uber JARs, apply file transforms, and relocate packages for applications and libraries. Gradle version of Maven's Shade plugin. | ||||||||||
Aboutlibraries | 3,169 | 1 | a month ago | 87 | August 19, 2022 | 8 | apache-2.0 | Kotlin | ||
AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments | ||||||||||
Dexcount Gradle Plugin | 3,002 | 14 days ago | 45 | January 25, 2022 | 2 | apache-2.0 | Java | |||
A Gradle plugin to report the number of method references in your APK on every build. |
Download files in your Gradle build script with style progress and in parallel
This is a download task for Gradle. It displays progress information just like Gradle does when it retrieves an artifact from a repository. It is also able to download multiple files in parallel and supports concurrent execution with other tasks.
The plugin has been successfully tested with Gradle 5.0 up to 8.0.2. It should work with newer versions as well.
FacebookReact NativeHermes |
GitHub repository |
![]() T. J. Watson Libraries for Analysis (WALA) |
6000+ more open-source projects … Want to be listed here? Just comment on this issue. |
First, apply the plugin configuration:
plugins {
id "de.undercouch.download" version "5.4.0"
}
Then, use the Download
task as follows:
task downloadFile(type: Download) {
src 'http://www.example.com/index.html'
dest buildDir
}
By default, the plugin always performs a download even if the destination file
already exists. If you want to prevent files from being downloaded again, use
the overwrite
flag (see description below).
task downloadFile(type: Download) {
src 'http://www.example.com/index.html'
dest buildDir
overwrite false
}
As an alternative to the Download
task, you may also use the download
extension to retrieve a file anywhere in your build script:
task myTask {
doLast {
// do something ...
// ... then download a file
download.run {
src 'http://www.example.com/index.html'
dest buildDir
overwrite false
}
// ... do something else
}
}
Note that the download
extension also has a runAsync
method that downloads
a file asynchronously. It returns a CompletableFuture
that either completes
successfully or exceptionally depending on whether the download has finished
successfully or if it has failed. Make sure to always wait for the result of
the CompletableFuture
. Otherwise, errors might get lost.
The plugin requires:
If you need to run the plugin with Gradle 2.x up to 4.x or Java 7, use gradle-download-task version 4.1.2.
task downloadFile(type: Download) {
src 'http://www.example.com/index.html'
dest buildDir
onlyIfModified true
}
Note that this example only works if the server supports the If-Modified-Since
request header and provides a Last-Modified
timestamp in its response. If the
server supports entity tags (ETags) you may use onlyIfModified
together with
useETag
.
task downloadMultipleFiles(type: Download) {
src([
'http://www.example.com/index.html',
'http://www.example.com/test.html'
])
dest buildDir
}
Please note that you have to specify a directory as destination if you download multiple files. Otherwise, the plugin will fail.
If you want to download all files from a directory and the server provides a simple directory listing, you can use the following code:
task downloadDirectory {
doLast {
def dir = 'http://central.maven.org/maven2/de/undercouch/gradle-download-task/1.0/'
def urlLister = new org.apache.ivy.util.url.ApacheURLLister()
def files = urlLister.listFiles(new URL(dir))
download.run {
src files
dest buildDir
}
}
}
To download and unpack a ZIP file, you can combine the download task plugin with Gradle's built-in support for ZIP files:
task downloadZipFile(type: Download) {
src 'https://github.com/michel-kraemer/gradle-download-task/archive/refs/tags/5.4.0.zip'
dest new File(buildDir, '5.4.0.zip')
}
task downloadAndUnzipFile(dependsOn: downloadZipFile, type: Copy) {
from zipTree(downloadZipFile.dest)
into buildDir
}
Please have a look at the examples
directory for more code samples. You can
also read my blog post about
common recipes for gradle-download-task.
The download task and the extension support the following properties.
true
if progress information should not be displayed
(default: false
)
true
if existing files should be overwritten (default:
true
)
true
if the file should only be downloaded if it
has been modified on the server since the last download (default:
false
)
eachFile
action will make the plugin fail.Tip! You may provide Groovy Closures or Kotlin Lambdas to the src
and dest
properties to calculate their value at runtime.
true
if HTTPS certificate verification errors should be ignored
and any certificate (even an invalid one) should be accepted.
(default: false
)
true
if compression should be used during download (default:
true
)
0
(zero) means infinite timeout. Negative values
are not allowed. (default: 30 seconds
)
0
(zero) means infinite timeout. Negative values
are not allowed. (default: 30 seconds
)
0
,
failed requests are retried regardless of the actual error. This includes
failed connection attempts and file-not-found errors (404). A negative value
means infinite retries. (default: 0
)
true
if preemptive Basic authentication should be enabled.
By default, gradle-download-task automatically detects the required
authentication scheme by sending two requests: one without credentials to
determine the scheme based on the WWW-Authenticate
header in the
server's response and the actual request with credentials. This will fail if the
server does not send a WWW-Authenticate
header. In this case, set
preemptiveAuth
to true
to use Basic authentication
and to always send credentials in the first request. Note:
Sending credentials in clear text in the first request without checking if the
server actually needs them might pose a security risk. (default:
false
)
${buildDir}/download-task
)
true
if the file should be downloaded to a temporary location
and, upon successful execution, moved to the final location. If
overwrite
is set to false
, this flag is useful to
avoid partially downloaded files if Gradle is forcefully closed or the system
crashes. Note that the plugin always deletes partial downloads on connection
errors, regardless of the value of this flag. The default temporary location
can be configured with the downloadTaskDir
property. (default:
false
)
onlyIfModified
. If both
flags are true
, the plugin will check a file’s timestamp as well
as its entity tag (ETag) and only download it if it has been modified on the
server since the last download. The plugin can differentiate between
strong and weak
ETags. Possible values are:
false
(default)
true
"all"
"strongOnly"
${downloadTaskDir}/etags.json
)
GET
)
The plugin also provides a Verify
task that can be used to check the integrity
of a downloaded file by calculating its checksum and comparing it to a
pre-defined value. The task succeeds if the file’s checksum equals the
given value and fails if it doesn’t.
Use the task as follows:
task verifyFile(type: Verify) {
src new File(buildDir, 'file.ext')
algorithm 'MD5'
checksum 'ce114e4501d2f4e2dcea3e17b546f339'
}
You can combine the download task and the verify task as follows:
task downloadFile(type: Download) {
src 'http://www.example.com/index.html'
dest buildDir
}
task verifyFile(type: Verify, dependsOn: downloadFile) {
src new File(buildDir, 'index.html')
algorithm 'MD5'
checksum '09b9c392dc1f6e914cea287cb6be34b0'
}
The verify task supports the following properties:
MD5
)
If you specify an eachFile
action, it will be called with an
instance of the DownloadDetails
class, which provides details about a
download source and its target file. It can be used to change some aspects of
the target file (e.g. its name or relative path).
DownloadDetails
provides the following properties:
eachFile { f ->
f.name = f.name.toLowerCase()
if (f.sourceURL.path.toLowerCase().endsWith(".jpg")) {
f.path = "images/" + f.path
}
}
You can configure a proxy server by setting standard JVM system properties. The plugin uses the same system properties as Gradle. You can set them in the build script directly. For example, the proxy host can be set as follows:
System.setProperty("http.proxyHost", "www.somehost.org");
Alternatively, you can set the properties in a gradle.properties
file like
this:
systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
Put this file in your project’s root directory or in your Gradle home directory.
HTTPS is also supported:
systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
gradle-download-task 5.0.0 introduces the following breaking changes:
authScheme
property has been removed. The plugin now automatically
detects the correct scheme to use based on the server response.download
extension was incompatible with Gradle 8. Also, using it
from Kotlin build scripts was rather inconvenient. It is therefore now
necessary to call the extension through its run
method. Replace
download { ... }
with download.run { ... }
. The same applies to the
verify
extension.In gradle-download-task 4.x, we made the following breaking changes to the API:
timeout
property and introduced connectTimeout
and
readTimeout
instead. This allows you to control the individual timeouts
better. Also, it improves compatibility with Gradle 5.x, where all tasks have
a timeout
property by default.credentials
property has been removed. The same applies to the
possibility to pass instances of Apache HttpClient’s AuthScheme
to the
authScheme
property. The strings Basic
and Digest
are now the only
accepted values. There is no replacement. If you need this functionality,
please file an issue.requestInterceptor
and responseInterceptor
have been
removed. There is no replacement. Again, if you need this functionality,
please file an issue.The plugin is licensed under the Apache License, Version 2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.