fix #332 by using dnu packages add

This commit is contained in:
Andrew Stanton-Nurse 2015-12-11 09:50:56 -08:00
parent b33335a144
commit 3b57c74921
3 changed files with 24 additions and 21 deletions

View File

@ -1,20 +0,0 @@
@{/*
dotnet-publish
Builds project. Downloads and executes dotnet sdk tools.
sourcePackagesDir=''
Required. Path to packages to install (skips symbol packages)
targetPackagesDir=''
Optional. Path to publish packages.
*/}
default targetPackagesDir=''
@{
var packages = Directory.EnumerateFiles(sourcePackagesDir, "*.nupkg")
.Where(p => !p.EndsWith(".symbols.nupkg"));
}
dotnet command='packages add ${package} ${targetPackagesDir}' each='var package in packages'

View File

@ -162,7 +162,7 @@ default NUGET_FEED = 'https://api.nuget.org/v3/index.json'
}
#nuget-install target='install' if='Directory.Exists("src")' description='Install NuGet packages to local repo'
dotnet-publish sourcePackagesDir='${BUILD_DIR}' targetPackagesDir='${E("PACKAGES_PUBLISH_DIR")}'
nuget-packages-add sourcePackagesDir='${BUILD_DIR}' targetPackagesDir='${E("PACKAGES_PUBLISH_DIR")}'
nuget-resilient-publish sourcePackagesDir='${BUILD_DIR}' nugetFeed='${E("NUGET_PUBLISH_FEED")}' if='!string.IsNullOrEmpty(E("NUGET_PUBLISH_FEED"))'
#xunit-test target='test' if='Directory.Exists("test")'

View File

@ -0,0 +1,23 @@
@{/*
nuget-packages-add
Installs packages to a NuGet v3 directory structure
sourcePackagesDir=''
Required. Path to packages to install (skips symbol packages)
targetPackagesDir=''
Optional. Path to publish packages.
*/}
default targetPackagesDir=''
@{
var packages = Directory.EnumerateFiles(sourcePackagesDir, "*.nupkg")
.Where(p => !p.EndsWith(".symbols.nupkg"));
}
-// Temporarily use dnu until we have a nuget command
exec program='cmd' commandline='/c dnu packages add ${package} ${targetPackagesDir}' each='var package in packages' if='!IsLinux'
exec program='dnu' commandline='packages add ${package} ${targetPackagesDir}' each='var package in packages' if='IsLinux'