From f055bd64cdb1ce8efc54c2ded4d4befd0cb8d851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kota=C4=8Dka?= Date: Sat, 7 Apr 2018 23:26:51 +0200 Subject: [PATCH 1/5] Add a changelog --- CHANGELOG.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d98fd03 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,32 @@ +# 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 ([#]) +* CHANGELOG.md added ([#]) + +## 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. From bae31540ad2afd490505217761f995118760f6d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kota=C4=8Dka?= Date: Sat, 7 Apr 2018 23:43:15 +0200 Subject: [PATCH 2/5] Update CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d98fd03..c898947 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ * The `fmt` task added to the life-cycle ([#]) * The `vet` task added to the life-cycle ([#]) * Code refactoring ([#]) -* CHANGELOG.md added ([#]) +* CHANGELOG.md added + ([#6](https://github.com/sw-samuraj/gradle-godep-plugin/pull/6)) ## 0.3.2 ## From 33f463add52745cf4db6b520301c2c0534ed0af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kota=C4=8Dka?= Date: Sun, 8 Apr 2018 00:10:02 +0200 Subject: [PATCH 3/5] Disable email notifications from Travis CI --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8cad64d..9db9897 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,3 +56,5 @@ cache: directories: - $HOME/.gradle/caches/ - $HOME/.gradle/wrapper/ +notifications: + email: false From d159f651033682c5014b678abfd3538c90b7009a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kota=C4=8Dka?= Date: Mon, 9 Apr 2018 23:16:41 +0200 Subject: [PATCH 4/5] Fix optional dep --- build.gradle | 2 +- .../swsamuraj/gradle/godep/GoDepPlugin.groovy | 21 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 6982419..b96322f 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ dependencies { compile localGroovy() } -version = '0.3.2' +version = '0.3.3-SNAPSHOT' group = 'cz.swsamuraj' jar { diff --git a/src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy b/src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy index 6d7181f..3883280 100644 --- a/src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy +++ b/src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy @@ -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 { @@ -43,15 +40,19 @@ class GoDepPlugin implements Plugin { 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 } @@ -63,10 +64,16 @@ class GoDepPlugin implements Plugin { @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 taskList(Task task) { + return Arrays.asList(task) + } } From 8069d0cc899888341f79004ead36f7d9bf7b61d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kota=C4=8Dka?= Date: Mon, 9 Apr 2018 23:36:15 +0200 Subject: [PATCH 5/5] Prepare release 0.3.3 --- CHANGELOG.md | 5 +++++ README.md | 4 ++-- build.gradle | 2 +- example/build.gradle | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c898947..3bf3ee3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ * 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)) diff --git a/README.md b/README.md index 6896c52..9f61e1b 100644 --- a/README.md +++ b/README.md @@ -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) ## @@ -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" } } diff --git a/build.gradle b/build.gradle index b96322f..cb8f5a1 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ dependencies { compile localGroovy() } -version = '0.3.3-SNAPSHOT' +version = '0.3.3' group = 'cz.swsamuraj' jar { diff --git a/example/build.gradle b/example/build.gradle index ee357e4..4fedbda 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'cz.swsamuraj.godep' version '0.3.2' + id 'cz.swsamuraj.godep' version '0.3.3' } /* buildscript {