Skip to content

Commit

Permalink
Merge branch 'release/0.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-samuraj committed Apr 9, 2018
2 parents b85bbbc + 8069d0c commit b5ca349
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
notifications:
email: false
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Changelog of _Gradle Golang Plugin_ #

## 0.4.0 (next version)

* The `fmt` task added to the life-cycle ([#])
* The `vet` task added to the life-cycle ([#])
* Code refactoring ([#])

## 0.3.3 ##

* Fix optional `dep` task in multi-module build
([#7](https://github.com/sw-samuraj/gradle-godep-plugin/pull/7))
* CHANGELOG.md added
([#6](https://github.com/sw-samuraj/gradle-godep-plugin/pull/6))

## 0.3.2 ##

**No new features.** This release has been created via automated _Travis CI_ deployment.
([#5](https://github.com/sw-samuraj/gradle-godep-plugin/pull/5))
* Publishing to _Gradle Plugin Portal_.
* Creating of the _GitHub_ release.

## 0.3.0 ##

The `dep` task could be optional via configuration.
([#2](https://github.com/sw-samuraj/gradle-godep-plugin/pull/2))

## 0.2.1 ##

Supports three basic Gradle tasks, chained in following order:

* dep
* test
* build

## 0.1.0 ##

Initial release.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Plugin expects that _go_ and _dep_ commands are already installed on given syste

```groovy
plugins {
id "cz.swsamuraj.godep" version "0.3.2"
id "cz.swsamuraj.godep" version "0.3.3"
}
```
### All Gradle versions (or local repository) ##
Expand All @@ -38,7 +38,7 @@ buildscript {
}
}
dependencies {
classpath "gradle.plugin.cz.swsamuraj:gradle-godep-plugin:0.3.2"
classpath "gradle.plugin.cz.swsamuraj:gradle-godep-plugin:0.3.3"
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
compile localGroovy()
}

version = '0.3.2'
version = '0.3.3'
group = 'cz.swsamuraj'

jar {
Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'cz.swsamuraj.godep' version '0.3.2'
id 'cz.swsamuraj.godep' version '0.3.3'
}
/*
buildscript {
Expand Down
21 changes: 14 additions & 7 deletions src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
package cz.swsamuraj.gradle.godep

import groovy.transform.CompileStatic
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.ProjectEvaluationListener
import org.gradle.api.ProjectState
import org.gradle.api.*

@CompileStatic
class GoDepPlugin implements Plugin<Project> {
Expand All @@ -43,15 +40,19 @@ class GoDepPlugin implements Plugin<Project> {
GoDepExtension extension = project.extensions.create('godep', GoDepExtension, project)

project.tasks.create('clean', CleanTask)
project.tasks.create('prepareWorkspace', PrepareWorkspaceTask) {

PrepareWorkspaceTask prepareWorkspaceTask = project.tasks.create('prepareWorkspace', PrepareWorkspaceTask) {
it.importPath = extension.importPath
}

project.tasks.create('dep', GoDepTask) {
it.importPath = extension.importPath
}

project.tasks.create('test', GoTestTask) {
it.importPath = extension.importPath
}

project.tasks.create('build', GoBuildTask) {
it.importPath = extension.importPath
}
Expand All @@ -63,10 +64,16 @@ class GoDepPlugin implements Plugin<Project> {

@Override
void afterEvaluate(Project proj, ProjectState projectState) {
if (extension.depOptional.get()) {
proj.tasks.getByName('dep').enabled = false
if (proj.tasks.findByPath('dep') != null) {
if (extension.depOptional.get()) {
proj.tasks.getByName('test').setDependsOn(taskList(prepareWorkspaceTask))
}
}
}
})
}

List<Task> taskList(Task task) {
return Arrays.asList(task)
}
}

0 comments on commit b5ca349

Please sign in to comment.