Gogradle Versions Save

A Gradle Plugin Providing Full Support for Go

0.9

6 years ago

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.

v0.8.1

6 years ago

Gogradle 0.8.1 is a patch release. It fixed #183 #184 #189 .

v0.8.0

6 years ago

Gogradle 0.8.0 has been released.

In this release, a lot of improvements have been made:

  • Support dep as external dependency management tool.
  • Support branch in dependency declaration.
  • Global cache improvements. Previously, Gogradle kept all dependencies with same name (but different urls) in the same cache directory, which resulted in collision. Now they're put into different cache directory so that dependency resolution could be faster.
  • Realtime update on dependencies which don't declare version explicitly. In this version, if you don't declare your dependency's version, Gogradle will use latest version on remote by default. This can make build result reproducible.
  • Gradle 4.4 runtime support.

Thanks for the contributors, I really appreciate your PRs.

  • @fkorotkov
  • @maguro

v0.7.0

6 years ago

Gogradle 0.7.0 is a minor release.

New Features

  • Supports custom go distributions server (Contributed by @markslater)
  • More informative gradle tasks output (#117)
  • More convenient configuration for build.targetPlatforms (#128)

Bug Fixes

  • Closes #120
  • Closes #137

Breaking Changes

To make build.gradle more declarative, now you should declare custom command line arguments out of doLast block. For example,

Before 0.7.0:

task myTask(type:com.github.blindpirate.gogradle.Go) {
    doLast {
        go 'build github.com/my/package'
    }
}

0.7.0+:

task myTask(type:com.github.blindpirate.gogradle.Go) {
    go 'build github.com/my/package'
}

See #130

v0.6.5

6 years ago

Gogradle 0.6.5 is a minor release

  • Fix #116 #117 #118
  • Fix issues caused by incorrect gitlab go-import meta tag

v0.6.4

6 years ago

Gogradle 0.6.4 is a minor release.

  • Fix issue on configuration generation in Gogland

v0.6.3

6 years ago

Gogradle 0.6.3 is a minor release.

It fixes #112 .

v0.6.2

6 years ago
  • Supports both Gradle 3.x and Gradle 4.0
  • Supports multi-project build

v0.5.4

6 years ago

Gogradle 0.5.4 Release Note

Improvements

  • Add -Dgogradle.refresh instead of --refresh-dependencies due to potential performance issues.
  • Disable verification of revision in vendor.json.
  • Slightly improve logs in test.

Breaking Changes

After careful consideration, default task names are set to build/test, etc. To solve the task name conflict problem, please consult documentation and examples.

v0.5.3

6 years ago

Fix bugs:

  • Global GOPATH can not be recognized
  • Missing test result when panic thrown in init() method