Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 'update' operation on nuget sources. Updated nuget default to 4.4.0. #59

Merged
merged 2 commits into from
Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# gradle-nuget-plugin changelog

## 2.16
### Added
* Added "update" operation on nuget sources

### Changed
* Default NuGet version used is 4.4.0


## 2.15
### Fixed
Expand Down
131 changes: 72 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,78 +10,91 @@ You can see this plugin being used for real on [il-repack](https://github.com/gl

## nugetSpec

The task is to generate nuspec file by custom configuration

- Sample usage:

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath "com.ullink.gradle:gradle-nuget-plugin:2.5"
}
}

apply plugin:'nuget'
The task is to generate nuspec file by custom configuration.

Sample usage:

nuget {
// nuget.exe version to use, defaults to 3.3.0
// available versions can be found [here](https://dist.nuget.org/index.html)
version = '3.3.0'
```groovy
buildscript {
repositories {
mavenCentral()
}

nugetSpec {
// Array, Map and Closure could be used to generate nuspec XML, for details please check NuGetSpecTest
nuspec = [
metadata: [
title: 'project title',
authors: 'Francois Valdy',
// id: default is project.name
// version: default is project.version
// description: default is project.description
// ...
]
files: [
{ file (src: 'somefile1', target: 'tools') },
{ file (src: 'somefile2', target: 'tools') }
]
]
dependencies {
classpath "com.ullink.gradle:gradle-nuget-plugin:2.16"
}
}

apply plugin: 'nuget'

nuget {
// nuget.exe version to use, defaults to 4.4.0
// available versions can be found [here](https://dist.nuget.org/index.html)
version = '4.4.0'
}

nugetSpec {
// Array, Map and Closure could be used to generate nuspec XML, for details please check NuGetSpecTest
nuspec = [
metadata: [
title: 'project title',
authors: 'Francois Valdy',
// id: default is project.name
// version: default is project.version
// description: default is project.description
// ...
]
files: [
{ file (src: 'somefile1', target: 'tools') },
{ file (src: 'somefile2', target: 'tools') }
]
]
}
```

## nugetRestore

Nuget restore is used to retrieve missing packages before starting the build
Nuget restore is used to retrieve missing packages before starting the build.

- Sample usage:
Sample usage:

nugetRestore {
solutionDirectory = path\to\project
packagesDirectory = location\for\package\restore
}
```groovy
nugetRestore {
solutionDirectory = path\to\project
packagesDirectory = location\for\package\restore
}
```

Where
- solutionDirectory - could either contain the .sln file or the repositories.config file
- packagesDirectory - used only if a folder with repositories.config is used
Where
- 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 = 'add'
sourceName = 'localNuGetFeed'
sourceUrl = 'http://foo.com'
}

Where
- operation - could be add, remove, enable, disable and list
- sourceName - name of the nuget feed
- sourceUrl - url of the nuget feed

Nuget sources is used to add, remove, update, enable, disable nuget feeds.

Sample usage:

```groovy
nugetSources {
operation = 'add'
sourceName = 'localNuGetFeed'
sourceUrl = 'http://foo.com'
username = 'optional username'
password = 'optional password'
configFile = 'nuget.config'
}
```

Where
- operation - could be add, remove, update, enable, disable and list
- sourceName - name of the nuget feed
- sourceUrl - url of the nuget feed
- username - optional username for nuget sources that require http basic authentication
- password - optional password for nuget sources that require http basic authentication
- configFile - optional NuGet.config file to modify


# See also

[Gradle Msbuild plugin](https://github.com/Ullink/gradle-msbuild-plugin) - Allows to build VS projects & solutions.
Expand Down
2 changes: 1 addition & 1 deletion src/main/groovy/com/ullink/NuGetExtension.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.ullink

class NuGetExtension {
String version = '3.4.4'
String version = '4.4.0'
}
2 changes: 1 addition & 1 deletion src/main/groovy/com/ullink/NuGetSources.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.gradle.api.GradleException
class NuGetSources extends BaseNuGet {

enum Operation{
add, remove, enable, disable, list
add, remove, enable, disable, list, update
}

Operation operation
Expand Down