Easily resolve GitHub release assets as dependencies in Gradle
See here how to apply this plugin.
GitHub release assets can be resolved and cached as dependencies by adding an Ivy repository with a custom pattern layout.
This plugin adds a new github(USER)
method to a Gradle project's repositories
block so that this can work with minimal overhead.
If GitHub user foo has a repository bar with a release tagged v1.0, and that release has assets (e.g., bar-1.0.zip
) that include an Ivy descriptor (i.e., ivy-1.0.xml
), then those assets can be resolved from the URLs
- https://github.com/foo/bar/releases/download/v1.0/ivy-1.0.xml
- https://github.com/foo/bar/releases/download/v1.0/bar-1.0.zip
- etc.
In your Gradle build script, you can apply this plugin and then add a repository like this:
repositories {
github('foo')
}
Then, you can declare a dependency on bar (for some configuration, e.g., data
) like this:
dependencies {
data group: 'io.github.foo', name: 'bar', version: '1.0'
}
The group
must match the organisation
in the Ivy descriptor.