• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Itiviti/gradle-nuget-plugin: Executes NuGet from a gradle build

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Itiviti/gradle-nuget-plugin

开源软件地址(OpenSource Url):

https://github.com/Itiviti/gradle-nuget-plugin

开源编程语言(OpenSource Language):

Groovy 100.0%

开源软件介绍(OpenSource Introduction):

Gradle NuGet Plugin Build status Build Status

This plugin allows to execute NuGet.exe from a gradle build. It also supports pack & push commands through built-in tasks, nugetPack, nugetPush & nugetRestore.

nugetPack

You can see this plugin being used for real on il-repack project. (together with msbuild one)

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.17"
    }
}

apply plugin: 'nuget'

nuget {
    // nuget.exe version to use, defaults to 4.9.4

    // there are three different mutually excluded options for Nuget binary downloading:

    // first: define nuget version for download.
    // available versions can be found [here](https://dist.nuget.org/index.html)
    version = '4.9.4'

    // second - set nuget location, which will be used for download:
    nugetExePath = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"

    // third: define nuget executable file, which is already downloaded previously:
    nugetExePath = "C:\\Tools\\Nuget\\nuget.exe"
}

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.

Sample usage:

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

nugetSources

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

Sample usage:

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 - Allows to build VS projects & solutions.

Gradle NUnit plugin - Allows to execute NUnit tests from CI (used with this plugin to build the projects prior to UT execution)

Gradle OpenCover plugin - Allows to execute the UTs through OpenCover for coverage reports.

You can see these 4 plugins in use on ILRepack project (build.gradle).

License

All these plugins are licensed under the Apache License, Version 2.0 with no warranty (expressed or implied) for any purpose.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap