Simple gradle plugin to compile go sources.
It sets up a custom GOPATH
and installs dependencies via glide or go get.
plugins {
id "de.flachnetz.golang-gradle-plugin" version "0.1.44"
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "de.flachnetz:golang-gradle-plugin:0.1.44"
}
}
apply plugin: "de.flachnetz.golang-gradle-plugin"
plugins {
id "de.flachnetz.golang-gradle-plugin" version "VERSION"
}
golang {
binaryName = "main"
goVersion = "1.8"
cgoEnabled = false
// include = ["**/*.go", ...]
// exclude = ["**/vendor/**", ...]
}
The plugin provides the following gradle tasks:
- dependencies
- format
- test
- build and buildStatic