This plugin will scan and adapt your source files to include a provided header, e.g. a LICENSE file. By default it will scan every source set and report warnings. It will also create format tasks, which will properly format and apply the specified header. A bulk of the logic comes from the maven-license-plugin.
This plugin will also report on the licenses of your dependencies.
The jython-gradle-plugin will be published to http://bintray.com and will be available through the Gradle plugin exchange. This means that there are a few different usage scenarios listed below.
In your build.gradle file add:
plugins {
id "com.github.hierynomus.jython" version "0.3.0"
}The following example will download the boto3 library from pypi.python.org and bundle it in your Jar file.
plugins {
id "java"
id "com.github.hierynomus.jython" version "0.3.0"
}
dependencies {
jython ":boto3:1.1.3"
}By default the following two repository-patterns have been defined for the plugin:
The pipy repository pattern triggers special behavior. A REST call to https://pypi.python.org/pypi/${dep.name}/json
is made and the URL for the source release for that version is retrieved from the response.
These can be overridden or extended using the jython extension. For instance:
jython {
sourceRepositories += `http://my.local.repo/${dep.name}/${dep.version}/${dep.name}-${dep.version}.tar.gz
}In some cases, the python module name is not the same as the artifact name. In order to overcome this, you can use the classifier of the dependency to set the correct module name used for extraction. For instance:
dependencies {
jython "jmespath:jmespath.py:0.7.1:jmespath"
jython ":python-dateutil:2.4.2:dateutil"
}In some cases, the python script(s) are not bundled in a python module directory, but rather in the root. In these cases you can configure the plugin with the following dependency:
dependencies {
jython(":six:1.9.0") {
artifact {
name = "six"
extension = "py"
}
}
}This will only add the six.py file from the downloaded module.
-
Converted download code from Apache HTTP to Groovy HTTP-Builder (Fixes #7)