Now Gogradle leverage Gradle's incremental build mechanism to improve build performance.
If the following things are not changed between two build, build
task will be marked as UP-TO-DATE
and skip.
- Input
- All go source code in project (not including
*_test.go
but including source code in vendor) buildTags
defined in configuration- Go version
- Environment variables
- All go source code in project (not including
- Output
outputLocation
defined in build task. Note if this value is not set, incremental build won't take effect.
Now cover
task is incremental:
- Input
- Coverage files generated by
test
task
- Coverage files generated by
- Output
- HTML reports generated by
go tool cover
command.
- HTML reports generated by
Now Gogradle will print package coverage rate and total coverage rate in --info
log level. This make it much more convenient to read them from online CI log, e.g. travis.
In Gogradle 0.8, configuring multiple commands in Go
task will result in the latter declaration overwriting the former declaration.
Now it's allowed to configure multiple commands in Go
task:
task myBuild(type: Go) {
go 'build -o build/${GOOS}/${GOARCH}/app1a${GOEXE} gitrepo/apps/app1/app1a'
go 'build -o build/${GOOS}/${GOARCH}/app1b${GOEXE} gitrepo/apps/app1/app1b'
}
Now you can set environment variables for Test task:
test {
environment 'ENV1', 'VALUE1'
environment ENV2: 'VALUE', ENV3: 'VALUE3'
}
To improve user experience, Gogradle excludes some unrecognizable packages by default since 0.9. See Global exclude packages for more details.
Now repositories ending with .vcs
are supported by Gogradle.
Previously, a custom go build command declaration is:
go('build -v github.com/my/project', { stdoutLine ->
println stdoutLine
}, { stderrLine ->
println stderrLine
})
or
go('build -v github.com/my/project', writeTo('stdout.txt), devNull())
To make it more readable, now the DSL is changed to:
go('build -v github.com/my/project') {
stdout { line ->
println line
}
stderr { line ->
println line
}
}
and
go('build -v github.com/my/project') {
stdout writeTo('stdout.txt')
stderr devNull()
}
Previously, coverage
task's alias is goCover
, which puzzles users a lot. Now it's renamed to cover
and its alias version keeps unchanged.
In most tasks, property continueWhenFail
is deprecated and superseded by continueOnFailure
to keep it consistent with official property.
You can still use this property, but Gogradle will render a deprecation warning on console.
- Running vet task scans files in vendor directory
- Lock throws NullPointerException
- ResolveDependencies Task Can not get dependencies from transitivity gogradle.lock file
Please don't hesitate to report bugs or request features. Any contributions are always welcomed.