Skip to content

Latest commit

 

History

History
136 lines (93 loc) · 4.05 KB

release-note.md

File metadata and controls

136 lines (93 loc) · 4.05 KB

Gogradle 0.9 Release Note

What's new in Gogradle 0.9

Incremental support for build task

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
  • Output
    • outputLocation defined in build task. Note if this value is not set, incremental build won't take effect.

Incremental support for cover task

Now cover task is incremental:

  • Input
    • Coverage files generated by test task
  • Output
    • HTML reports generated by go tool cover command.

Report coverage in console log

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.

Multiple command configuration in Go task

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'
}

Set environment variables for Test task

Now you can set environment variables for Test task:

test {
    environment 'ENV1', 'VALUE1'
    environment ENV2: 'VALUE', ENV3: 'VALUE3'
}

Exclude some packages by default

To improve user experience, Gogradle excludes some unrecognizable packages by default since 0.9. See Global exclude packages for more details.

Support repositories ending with .vcs

Now repositories ending with .vcs are supported by Gogradle.

Potential breaking changes

DSL change of Go task

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() 
}

coverage task is renamed to cover now

Previously, coverage task's alias is goCover, which puzzles users a lot. Now it's renamed to cover and its alias version keeps unchanged.

Deprecations

Deprecation of continueWhenFail

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.

Fixed bugs

Contributors

Contribute

Please don't hesitate to report bugs or request features. Any contributions are always welcomed.