-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from darsen/master
NuGetSources task
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.ullink | ||
|
||
import org.gradle.api.GradleException | ||
|
||
class NuGetSources extends BaseNuGet { | ||
|
||
enum Operation{ | ||
add, remove, enable, disable, list | ||
} | ||
|
||
Operation operation | ||
def sourceName | ||
def sourceUrl | ||
def username | ||
def password | ||
def configFile | ||
def storePasswordInClearText = false | ||
|
||
NuGetSources() { | ||
super('sources') | ||
project.afterEvaluate{ | ||
if(!operation){ | ||
throw new GradleException('Operation not specified for NuGetSources task.') | ||
} | ||
if(operation != Operation.list && !sourceName){ | ||
throw new GradleException('SourceName not specified for NuGetSources task.') | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
void exec() { | ||
args operation | ||
if (sourceName) args '-Name', sourceName | ||
if (sourceUrl) args '-Source', sourceUrl | ||
if (username) args '-UserName', username | ||
if (password) args '-Password', password | ||
if (configFile) args '-ConfigFile', configFile | ||
if (storePasswordInClearText) args '-StorePasswordInClearText' | ||
super.exec() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters