Skip to content

Updated packing module to support NuGet.exe pack argument changes. #13

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions .nuget/NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<activePackageSource>
<clear />
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<disabledPackageSources>
<clear />
</disabledPackageSources>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
Expand Down
Binary file modified .nuget/NuGet.exe
Binary file not shown.
32 changes: 16 additions & 16 deletions packageAll.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Write-Host "Packaging all modules..."
Get-ChildItem . -filter "*.nuspec" -recurse | Foreach {
$nuspec = $_.fullname
Write-Host "Packing $nuspec"
$dirName = Split-Path $nuspec -Parent
[xml] $packageMeta = Get-Content $nuspec
$packageName = $packageMeta.package.metadata.id
$entryPoint = "$dirName\$packageName.ps1"
if (!(Test-Path $entryPoint))
{
throw "No entry name has been found for $nuspec.`n Ensure that $entryPoint exists!"
}
.nuget\\NuGet.exe pack $nuspec -NoPackageAnalysis
Write-Host "Packaging all modules..."

Get-ChildItem . -filter "*.nuspec" -recurse | Foreach {
$nuspec = $_.fullname
Write-Host "Packing $nuspec"

$dirName = Split-Path $nuspec -Parent
[xml] $packageMeta = Get-Content $nuspec
$packageName = $packageMeta.package.metadata.id
$entryPoint = "$dirName\$packageName.ps1"
if (!(Test-Path $entryPoint))
{
throw "No entry name has been found for $nuspec.`n Ensure that $entryPoint exists!"
}

.nuget\\NuGet.exe pack $nuspec -NoPackageAnalysis
}
2 changes: 1 addition & 1 deletion psmake.Tests/psmake.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$psmake = "$PSScriptRoot\..\psmake\psmake.ps1"
$expectedVersion = '3.1.7.0'
$expectedVersion = '3.1.8'

<# Disable Write-Host in tested code #>
function Write-Host
Expand Down
16 changes: 8 additions & 8 deletions psmake.mod.packaging.Tests/psmake.mod.packaging.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ Describe "Package-VSProject" {
Package-VsProject 'abc.csproj'

$capturedCalls.Count | Should Be 1
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'abc.csproj', '-Prop', 'Configuration=Release', '-Prop', 'Platform=AnyCPU', '-NonInteractive', '-Output', '.', '-IncludeReferencedProjects')
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'abc.csproj', '-Prop', 'Configuration=Release', '-Prop', 'Platform=AnyCPU', '-NonInteractive', '-OutputDirectory', '.', '-IncludeReferencedProjects')
}

It "It should call Nuget with specified parameters" {
$capturedCalls.Clear()
Package-VsProject 'my project.csproj' -Configuration 'Debug' -IncludeReferencedProjects $false -Symbols $true -Version '3.2.1' -Output 'my folder' -Platform 'x86'

$capturedCalls.Count | Should Be 1
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'my project.csproj', '-Prop', 'Configuration=Debug', '-Prop', 'Platform=x86', '-NonInteractive', '-Output', 'my folder', '-Symbols', '-Version', '3.2.1')
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'my project.csproj', '-Prop', 'Configuration=Debug', '-Prop', 'Platform=x86', '-NonInteractive', '-OutputDirectory', 'my folder', '-Symbols', '-Version', '3.2.1')
}

It "It should pipe project paths" {
Expand All @@ -53,8 +53,8 @@ Describe "Package-VSProject" {
List-Projects | Package-VsProject

$capturedCalls.Count | Should Be 2
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'a.csproj', '-Prop', 'Configuration=Release', '-Prop', 'Platform=AnyCPU', '-NonInteractive', '-Output', '.', '-IncludeReferencedProjects')
$capturedCalls[1] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'b.csproj', '-Prop', 'Configuration=Release', '-Prop', 'Platform=AnyCPU', '-NonInteractive', '-Output', '.', '-IncludeReferencedProjects')
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'a.csproj', '-Prop', 'Configuration=Release', '-Prop', 'Platform=AnyCPU', '-NonInteractive', '-OutputDirectory', '.', '-IncludeReferencedProjects')
$capturedCalls[1] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'b.csproj', '-Prop', 'Configuration=Release', '-Prop', 'Platform=AnyCPU', '-NonInteractive', '-OutputDirectory', '.', '-IncludeReferencedProjects')
}
}

Expand All @@ -71,15 +71,15 @@ Describe "Package-DeployableNuSpec" {
Package-DeployableNuSpec 'abc.nuspec'

$capturedCalls.Count | Should Be 1
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'abc.nuspec', '-NonInteractive', '-Output', '.', '-NoPackageAnalysis')
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'abc.nuspec', '-NonInteractive', '-OutputDirectory', '.', '-NoPackageAnalysis')
}

It "It should call Nuget with specified parameters" {
$capturedCalls.Clear()
Package-DeployableNuSpec 'my project.nuspec' -NoPackageAnalysis $false -NoDefaultExcludes $true -Version '3.2.1' -Output 'my folder'

$capturedCalls.Count | Should Be 1
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'my project.nuspec', '-NonInteractive', '-Output', 'my folder', '-NoDefaultExcludes', '-Version', '3.2.1')
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'my project.nuspec', '-NonInteractive', '-OutputDirectory', 'my folder', '-NoDefaultExcludes', '-Version', '3.2.1')
}

It "It should pipe project paths" {
Expand All @@ -92,8 +92,8 @@ Describe "Package-DeployableNuSpec" {
List-Projects | Package-DeployableNuSpec

$capturedCalls.Count | Should Be 2
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'a.nuspec', '-NonInteractive', '-Output', '.', '-NoPackageAnalysis')
$capturedCalls[1] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'b.nuspec', '-NonInteractive', '-Output', '.', '-NoPackageAnalysis')
$capturedCalls[0] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'a.nuspec', '-NonInteractive', '-OutputDirectory', '.', '-NoPackageAnalysis')
$capturedCalls[1] | %{$_} | Should Be @($Context.NuGetExe,'pack', 'b.nuspec', '-NonInteractive', '-OutputDirectory', '.', '-NoPackageAnalysis')
}
}

Expand Down
5 changes: 5 additions & 0 deletions psmake.mod.packaging/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
PsMake Packaging Module
========================================

Version 1.2.0.0
----------------------------------------
(Change) Nuget.exe pack command deprecated 'Output' argument to 'OutputDirectory'
(Change) NuGet.exe versions to 4.6.2

Version 1.1.0.0
----------------------------------------
(Change) Package-VSProject: added Platform parameter with default: AnyCPU
Expand Down
2 changes: 1 addition & 1 deletion psmake.mod.packaging/package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>psmake.mod.packaging</id>
<version>1.1.0.0</version>
<version>1.2.0.0</version>
<title>PSMake Packaging module</title>
<authors>Wojciech Kotlarski</authors>
<owners>Wojciech Kotlarski</owners>
Expand Down
4 changes: 2 additions & 2 deletions psmake.mod.packaging/psmake.mod.packaging.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Package-VSProject
[string]$Platform = "AnyCPU"
)
process {
$arguments = @("pack",$Project,"-Prop","Configuration=$Configuration","-Prop","Platform=$Platform","-NonInteractive","-Output",$Output)
$arguments = @("pack",$Project,"-Prop","Configuration=$Configuration","-Prop","Platform=$Platform","-NonInteractive","-OutputDirectory",$Output)
if ($IncludeReferencedProjects) { $arguments += "-IncludeReferencedProjects"}
if ($Symbols) { $arguments += "-Symbols" }
if ($Version) { $arguments += "-Version"; $arguments += $Version; }
Expand Down Expand Up @@ -98,7 +98,7 @@ function Package-DeployableNuSpec
[bool]$NoDefaultExcludes = $false
)
process {
$arguments = "pack",$Package,"-NonInteractive","-Output",$Output
$arguments = "pack",$Package,"-NonInteractive","-OutputDirectory",$Output
if ($NoPackageAnalysis) { $arguments += "-NoPackageAnalysis"}
if ($NoDefaultExcludes) { $arguments += "-NoDefaultExcludes"}
if ($Version) { $arguments += "-Version"; $arguments += $Version; }
Expand Down
2 changes: 1 addition & 1 deletion psmake.mod.testing.Tests/TestSolution/.nuget/NuGet.Config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://www.nuget.org/api/v2/"/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<activePackageSource>
<clear />
Expand Down
Binary file modified psmake.mod.testing.Tests/TestSolution/.nuget/NuGet.exe
Binary file not shown.
5 changes: 5 additions & 0 deletions psmake/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
PsMake
========================================
Version 3.1.8
----------------------------------------
(Change) NuGet.exe versions to 4.6.2
(Change) Updated PSMake version number. Due to Nuget.exe issues #3050

Version 3.1.7.0
----------------------------------------
General: Added run duration for Overall script and for each step.
Expand Down
2 changes: 1 addition & 1 deletion psmake/package.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>psmake</id>
<version>3.1.7.0</version>
<version>3.1.8</version>
<title>PSMake</title>
<authors>Wojciech Kotlarski</authors>
<owners>Wojciech Kotlarski</owners>
Expand Down
2 changes: 1 addition & 1 deletion psmake/psmake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function private:Build-Context()

function private:Get-Version()
{
return "3.1.7.0"
return "3.1.8"
}

function private:Load-MakeFile()
Expand Down
6 changes: 3 additions & 3 deletions quick_run.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rmdir temp -force -recurse -ErrorAction SilentlyContinue
& .\packageAll.ps1
& .\psmake\psmake.ps1 -Scaffold empty -md temp -NuGetSource $PSScriptRoot
rmdir temp -force -recurse -ErrorAction SilentlyContinue
& .\packageAll.ps1
& .\psmake\psmake.ps1 -Scaffold empty -md temp -NuGetSource $PSScriptRoot
& .\temp\make.ps1 -Target build