From a09705b7734b3a1bba0ce6e84bafd0362d86e522 Mon Sep 17 00:00:00 2001 From: darsen Date: Fri, 29 Dec 2017 20:44:15 -0800 Subject: [PATCH 01/18] add assert for NuGetSources task --- src/test/groovy/com/ullink/NuGetPluginTest.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/groovy/com/ullink/NuGetPluginTest.groovy b/src/test/groovy/com/ullink/NuGetPluginTest.groovy index eece907..ef852dd 100644 --- a/src/test/groovy/com/ullink/NuGetPluginTest.groovy +++ b/src/test/groovy/com/ullink/NuGetPluginTest.groovy @@ -22,6 +22,7 @@ class NuGetPluginTest { assertTrue(project.tasks.nugetPack instanceof NuGetPack) assertTrue(project.tasks.nugetPush instanceof NuGetPush) assertTrue(project.tasks.nugetSpec instanceof NuGetSpec) + assertTrue(project.tasks.nugetSources instanceof NuGetSources) } @Test From 52a8be448787d16d9b3c6019b0aa5073838bc36e Mon Sep 17 00:00:00 2001 From: darsen Date: Fri, 29 Dec 2017 20:46:18 -0800 Subject: [PATCH 02/18] Create NuGetSources.groovy --- src/main/groovy/com/ullink/NuGetSources.groovy | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/main/groovy/com/ullink/NuGetSources.groovy diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -0,0 +1 @@ + From daffe53eff53a4532ee5ca7aae74c7a3599fab26 Mon Sep 17 00:00:00 2001 From: darsen Date: Fri, 29 Dec 2017 20:46:59 -0800 Subject: [PATCH 03/18] Update NuGetSources.groovy --- src/main/groovy/com/ullink/NuGetSources.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 8b13789..8ed86a8 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -1 +1,6 @@ +package com.ullink + +class NuGetPush extends BaseNuGet { + +} From 4125a3fae8febd7abb5d0bb4dc095725c2221825 Mon Sep 17 00:00:00 2001 From: darsen Date: Fri, 29 Dec 2017 20:48:06 -0800 Subject: [PATCH 04/18] Update NuGetSources.groovy --- src/main/groovy/com/ullink/NuGetSources.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 8ed86a8..0be6a43 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -1,6 +1,10 @@ package com.ullink -class NuGetPush extends BaseNuGet { +class NuGetSources extends BaseNuGet { + + NuGetSources() { + super('sources') + } } From 8939c94f3df3c64358f508c285c32964548a7c27 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 00:29:00 -0800 Subject: [PATCH 05/18] added operations --- .../groovy/com/ullink/NuGetSources.groovy | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 0be6a43..ee5a786 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -1,10 +1,32 @@ - package com.ullink class NuGetSources extends BaseNuGet { - - NuGetSources() { + enum Operation{ + add, remove, enable, disable + } + + NuGetSources() { super('sources') } + Operation operation + def name + def source + def username + def password + def configFile + bool storePaswordInClearText + + @Override + void exec() { + args operation + if (name) args '-Name', name + if (source) args '-Source',source + if (username) args '-UserName', name + if (password) args '-Passsword', name + if (configFile) args '-ConfigFile', name + if (storePaswordInClearText) args '-StorePaswordInClearText' + super.exec() + } + } From be4af2cce4511f931e8b19dbe10a42accd3c73a6 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 00:35:55 -0800 Subject: [PATCH 06/18] verbosity added --- src/main/groovy/com/ullink/NuGetSources.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index ee5a786..de5f493 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -4,12 +4,15 @@ class NuGetSources extends BaseNuGet { enum Operation{ add, remove, enable, disable } - + enum Verbosity{ + normal, quiet, detailed + } NuGetSources() { super('sources') } Operation operation + Verbosity verbosity def name def source def username @@ -25,6 +28,7 @@ class NuGetSources extends BaseNuGet { if (username) args '-UserName', name if (password) args '-Passsword', name if (configFile) args '-ConfigFile', name + if (verbosity) args '-Verbosity', verbosity if (storePaswordInClearText) args '-StorePaswordInClearText' super.exec() } From c2b8f77f44710608e4e678b398c0b8b4a7ac6199 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 00:45:01 -0800 Subject: [PATCH 07/18] added to list of project tasks --- README.md | 15 +++++++++++++++ src/main/groovy/com/ullink/NuGetPlugin.groovy | 5 +++++ src/main/groovy/com/ullink/NuGetSources.groovy | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dccb05b..99dbcde 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,21 @@ You can see this plugin being used for real on [il-repack](https://github.com/gl - solutionDirectory - could either contain the .sln file or the repositories.config file - packagesDirectory - used only if a folder with repositories.config is used +## nugetSources + + Nuget sources is used to add, remove, enable, disable nuget feeds + + - Sample usage: + + nugetSources { + operation = remove + name = "localNuGetFeed" + } + + Where + - operation - could be add, remove, enable, disable + - name - name of the feed + # See also [Gradle Msbuild plugin](https://github.com/Ullink/gradle-msbuild-plugin) - Allows to build VS projects & solutions. diff --git a/src/main/groovy/com/ullink/NuGetPlugin.groovy b/src/main/groovy/com/ullink/NuGetPlugin.groovy index cf21e79..ebebe3d 100644 --- a/src/main/groovy/com/ullink/NuGetPlugin.groovy +++ b/src/main/groovy/com/ullink/NuGetPlugin.groovy @@ -27,6 +27,11 @@ class NuGetPlugin implements Plugin { group = BasePlugin.UPLOAD_GROUP description = 'Pushes the NuGet package to the configured server url.' } + + project.task('nugetSources', type: NuGetSources) { + group = BasePlugin.UPLOAD_GROUP + description = 'Adds, removes, enables and disables nuget sources (feeds).' + } } } diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index de5f493..2e7902d 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -18,7 +18,7 @@ class NuGetSources extends BaseNuGet { def username def password def configFile - bool storePaswordInClearText + def storePaswordInClearText = false @Override void exec() { From 86be1be9989e32a45e74a9e19941bc63d54cefc5 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 01:12:30 -0800 Subject: [PATCH 08/18] fixed some argument names and removed redundant --- src/main/groovy/com/ullink/NuGetSources.groovy | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 2e7902d..5e6ec23 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -1,20 +1,18 @@ package com.ullink class NuGetSources extends BaseNuGet { + enum Operation{ add, remove, enable, disable } - enum Verbosity{ - normal, quiet, detailed - } + NuGetSources() { super('sources') } - Operation operation - Verbosity verbosity - def name - def source + Operation operation + def sourceName + def sourceUrl def username def password def configFile @@ -23,12 +21,11 @@ class NuGetSources extends BaseNuGet { @Override void exec() { args operation - if (name) args '-Name', name - if (source) args '-Source',source + if (sourceName) args '-Name', sourceName + if (sourceUrl) args '-Source',sourceUrl if (username) args '-UserName', name if (password) args '-Passsword', name if (configFile) args '-ConfigFile', name - if (verbosity) args '-Verbosity', verbosity if (storePaswordInClearText) args '-StorePaswordInClearText' super.exec() } From ee7f6e803990d879a2c68097cf214018d13ee584 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 01:14:47 -0800 Subject: [PATCH 09/18] fixed readme --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 99dbcde..0ee372f 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,15 @@ You can see this plugin being used for real on [il-repack](https://github.com/gl - Sample usage: nugetSources { - operation = remove - name = "localNuGetFeed" + operation = 'add' + sourceName = 'localNuGetFeed' + sourceUrl = 'http://foo.com' } Where - operation - could be add, remove, enable, disable - - name - name of the feed + - sourceName - name of the nuget feed + - sourceUrl - url of the nuget feed # See also From 90e42ebe9535d714d4ccd5c175c5233f1928f465 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 01:40:49 -0800 Subject: [PATCH 10/18] validation of task definition --- src/main/groovy/com/ullink/NuGetSources.groovy | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 5e6ec23..9ff5316 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -8,6 +8,14 @@ class NuGetSources extends BaseNuGet { NuGetSources() { super('sources') + project.afterEvaluate{ + if(!operation){ + throw new GradleException('Operation not specified for NuGetSources task.') + } + if(!sourceName){ + throw new GradleException('SourceName not specified for NuGetSources task.') + } + } } Operation operation From e3f429a119158b825ed1a6a52ea8d0d07650a6f9 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 10:32:02 -0800 Subject: [PATCH 11/18] list operation added --- README.md | 2 +- src/main/groovy/com/ullink/NuGetPlugin.groovy | 2 +- src/main/groovy/com/ullink/NuGetSources.groovy | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0ee372f..5d8c026 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ You can see this plugin being used for real on [il-repack](https://github.com/gl } Where - - operation - could be add, remove, enable, disable + - operation - could be add, remove, enable, disable and list - sourceName - name of the nuget feed - sourceUrl - url of the nuget feed diff --git a/src/main/groovy/com/ullink/NuGetPlugin.groovy b/src/main/groovy/com/ullink/NuGetPlugin.groovy index ebebe3d..be0a8fe 100644 --- a/src/main/groovy/com/ullink/NuGetPlugin.groovy +++ b/src/main/groovy/com/ullink/NuGetPlugin.groovy @@ -30,7 +30,7 @@ class NuGetPlugin implements Plugin { project.task('nugetSources', type: NuGetSources) { group = BasePlugin.UPLOAD_GROUP - description = 'Adds, removes, enables and disables nuget sources (feeds).' + description = 'Adds, removes, enables, disables and lists nuget sources (feeds).' } } } diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 9ff5316..8c6a12a 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -3,7 +3,7 @@ package com.ullink class NuGetSources extends BaseNuGet { enum Operation{ - add, remove, enable, disable + add, remove, enable, disable, list } NuGetSources() { @@ -12,7 +12,7 @@ class NuGetSources extends BaseNuGet { if(!operation){ throw new GradleException('Operation not specified for NuGetSources task.') } - if(!sourceName){ + if(operation != Operation.list && !sourceName){ throw new GradleException('SourceName not specified for NuGetSources task.') } } @@ -38,4 +38,4 @@ class NuGetSources extends BaseNuGet { super.exec() } -} +} \ No newline at end of file From 68aa3e225d7beed6e65e1eea9a55d20d7c7ddac1 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 10:37:59 -0800 Subject: [PATCH 12/18] formatting --- src/main/groovy/com/ullink/NuGetSources.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 8c6a12a..0edc684 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -30,7 +30,7 @@ class NuGetSources extends BaseNuGet { void exec() { args operation if (sourceName) args '-Name', sourceName - if (sourceUrl) args '-Source',sourceUrl + if (sourceUrl) args '-Source', sourceUrl if (username) args '-UserName', name if (password) args '-Passsword', name if (configFile) args '-ConfigFile', name @@ -38,4 +38,4 @@ class NuGetSources extends BaseNuGet { super.exec() } -} \ No newline at end of file +} From 598fd8206c0ae21bf2c3ab989023f0bff564989e Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 10:39:48 -0800 Subject: [PATCH 13/18] fix order of blocks in a class --- src/main/groovy/com/ullink/NuGetSources.groovy | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 0edc684..2ad2254 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -6,6 +6,14 @@ class NuGetSources extends BaseNuGet { add, remove, enable, disable, list } + Operation operation + def sourceName + def sourceUrl + def username + def password + def configFile + def storePaswordInClearText = false + NuGetSources() { super('sources') project.afterEvaluate{ @@ -18,14 +26,6 @@ class NuGetSources extends BaseNuGet { } } - Operation operation - def sourceName - def sourceUrl - def username - def password - def configFile - def storePaswordInClearText = false - @Override void exec() { args operation @@ -37,5 +37,4 @@ class NuGetSources extends BaseNuGet { if (storePaswordInClearText) args '-StorePaswordInClearText' super.exec() } - } From 10bb9f4fc9340311932867f7fb70cf5436dcf105 Mon Sep 17 00:00:00 2001 From: darsen Date: Sat, 30 Dec 2017 14:20:18 -0800 Subject: [PATCH 14/18] import GradleException --- src/main/groovy/com/ullink/NuGetSources.groovy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 2ad2254..0af17c2 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -1,5 +1,7 @@ package com.ullink +import org.gradle.api.GradleException + class NuGetSources extends BaseNuGet { enum Operation{ From 9215f8f8bdbd3cdabec414076da4fd61cb1a793a Mon Sep 17 00:00:00 2001 From: darsen Date: Tue, 2 Jan 2018 15:55:22 -0800 Subject: [PATCH 15/18] eliminated upload group --- src/main/groovy/com/ullink/NuGetPlugin.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/groovy/com/ullink/NuGetPlugin.groovy b/src/main/groovy/com/ullink/NuGetPlugin.groovy index be0a8fe..a130ebe 100644 --- a/src/main/groovy/com/ullink/NuGetPlugin.groovy +++ b/src/main/groovy/com/ullink/NuGetPlugin.groovy @@ -29,7 +29,6 @@ class NuGetPlugin implements Plugin { } project.task('nugetSources', type: NuGetSources) { - group = BasePlugin.UPLOAD_GROUP description = 'Adds, removes, enables, disables and lists nuget sources (feeds).' } } From 464ac16af9553e139efc96adf6fcd3cbf4c781cc Mon Sep 17 00:00:00 2001 From: darsen Date: Wed, 3 Jan 2018 09:09:04 -0800 Subject: [PATCH 16/18] fix wrong arguments --- src/main/groovy/com/ullink/NuGetSources.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 0af17c2..ef36bee 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -34,8 +34,8 @@ class NuGetSources extends BaseNuGet { if (sourceName) args '-Name', sourceName if (sourceUrl) args '-Source', sourceUrl if (username) args '-UserName', name - if (password) args '-Passsword', name - if (configFile) args '-ConfigFile', name + if (password) args '-Passsword', password + if (configFile) args '-ConfigFile', configFile if (storePaswordInClearText) args '-StorePaswordInClearText' super.exec() } From 51807112bc79133fea7724a239af2b670f1155a4 Mon Sep 17 00:00:00 2001 From: darsen Date: Thu, 4 Jan 2018 18:28:06 -0800 Subject: [PATCH 17/18] fix password and username typos --- src/main/groovy/com/ullink/NuGetSources.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index ef36bee..11e5b00 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -14,7 +14,7 @@ class NuGetSources extends BaseNuGet { def username def password def configFile - def storePaswordInClearText = false + def storePasswordInClearText = false NuGetSources() { super('sources') @@ -33,10 +33,10 @@ class NuGetSources extends BaseNuGet { args operation if (sourceName) args '-Name', sourceName if (sourceUrl) args '-Source', sourceUrl - if (username) args '-UserName', name + if (username) args '-UserName', username if (password) args '-Passsword', password if (configFile) args '-ConfigFile', configFile - if (storePaswordInClearText) args '-StorePaswordInClearText' + if (storePasswordInClearText) args '-StorePasswordInClearText' super.exec() } } From 3f1e8a8d1186a34d7870fd2da1cb837694262d57 Mon Sep 17 00:00:00 2001 From: darsen Date: Thu, 4 Jan 2018 23:27:11 -0800 Subject: [PATCH 18/18] fix password typo --- src/main/groovy/com/ullink/NuGetSources.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/com/ullink/NuGetSources.groovy b/src/main/groovy/com/ullink/NuGetSources.groovy index 11e5b00..bd3322b 100644 --- a/src/main/groovy/com/ullink/NuGetSources.groovy +++ b/src/main/groovy/com/ullink/NuGetSources.groovy @@ -34,7 +34,7 @@ class NuGetSources extends BaseNuGet { if (sourceName) args '-Name', sourceName if (sourceUrl) args '-Source', sourceUrl if (username) args '-UserName', username - if (password) args '-Passsword', password + if (password) args '-Password', password if (configFile) args '-ConfigFile', configFile if (storePasswordInClearText) args '-StorePasswordInClearText' super.exec()