From adcd3c3c76710d4d7b85a2cec5868b8840ff9db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Kota=C4=8Dka?= Date: Tue, 5 Jun 2018 11:26:16 +0200 Subject: [PATCH] Fix proprietaryVendors property without provider --- CHANGELOG.md | 7 ++++++- README.md | 4 ++-- build.gradle | 2 +- example/build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- .../groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy | 1 + .../swsamuraj/gradle/godep/ProprietaryVendorsTask.groovy | 4 ++-- 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aab208..7e6b9ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,11 +6,16 @@ * The `vet` task added to the life-cycle ([#]) * Code refactoring ([#]) -## 0.4.1 (next version) +## 0.4.2 (next version) * Document _How to handle proprietary vendors_. ([#]) +## 0.4.1 + +* Fix error `proprietaryVendors` property without provider. + ([#10](https://github.com/sw-samuraj/gradle-godep-plugin/pull/10)) + ## 0.4.0 * The `proprietaryVendors` task for dealing with import packages in private repositories. diff --git a/README.md b/README.md index afd9cd3..2414fef 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.4.0" + id "cz.swsamuraj.godep" version "0.4.1" } ``` ### All Gradle versions (or local repository) @@ -38,7 +38,7 @@ buildscript { } } dependencies { - classpath "gradle.plugin.cz.swsamuraj:gradle-godep-plugin:0.4.0" + classpath "gradle.plugin.cz.swsamuraj:gradle-godep-plugin:0.4.1" } } diff --git a/build.gradle b/build.gradle index 47379d0..7933696 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ dependencies { compile localGroovy() } -version = '0.4.0' +version = '0.4.1' group = 'cz.swsamuraj' jar { diff --git a/example/build.gradle b/example/build.gradle index 4ccbeee..0e2de04 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'cz.swsamuraj.godep' version '0.4.0' + id 'cz.swsamuraj.godep' version '0.4.1' } /* buildscript { @@ -9,7 +9,7 @@ buildscript { } } dependencies { - classpath 'gradle.plugin.cz.swsamuraj:gradle-godep-plugin:0.5.0-SNAPSHOT' + classpath 'gradle.plugin.cz.swsamuraj:gradle-godep-plugin:0.5.0-SNAPSTHOT' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 16d2805..d2c45a4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy b/src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy index 8e7f23c..ef20ab2 100644 --- a/src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy +++ b/src/main/groovy/cz/swsamuraj/gradle/godep/GoDepPlugin.groovy @@ -53,6 +53,7 @@ class GoDepPlugin implements Plugin { project.tasks.create('proprietaryVendors', ProprietaryVendorsTask) { it.importPath = extension.importPath + it.proprietaryVendors = extension.proprietaryVendors } project.tasks.create('test', GoTestTask) { diff --git a/src/main/groovy/cz/swsamuraj/gradle/godep/ProprietaryVendorsTask.groovy b/src/main/groovy/cz/swsamuraj/gradle/godep/ProprietaryVendorsTask.groovy index ec5e5a0..92c1f38 100644 --- a/src/main/groovy/cz/swsamuraj/gradle/godep/ProprietaryVendorsTask.groovy +++ b/src/main/groovy/cz/swsamuraj/gradle/godep/ProprietaryVendorsTask.groovy @@ -40,7 +40,7 @@ import org.gradle.process.ExecSpec class ProprietaryVendorsTask extends DefaultTask { final Property importPath = project.objects.property(String) - final Property packagesToImport = project.objects.property(Map) + final Property proprietaryVendors = project.objects.property(Map) ProprietaryVendorsTask() { group = 'go & dep' @@ -50,7 +50,7 @@ class ProprietaryVendorsTask extends DefaultTask { @TaskAction void proprietaryVendors() { - packagesToImport.get().forEach { String pkg, String ver -> + proprietaryVendors.get().forEach { String pkg, String ver -> int lastSeparator = pkg.lastIndexOf(File.separator) String parentPkg = pkg.substring(0, lastSeparator) File parentDir = new File(project.projectDir, "vendor/${parentPkg}")