2
2
3
3
if (! (Test-Path $cmdletsDir ))
4
4
{
5
- throw " cmdletsDir: '$cmdletsDir ' must be an existing directory containing cmdlet code"
5
+ throw " cmdletsDir: '$cmdletsDir ' must be an existing directory containing cmdlet code"
6
6
}
7
7
if (! (Test-Path $outputDir ))
8
8
{
9
- throw " outputDir: '$outputDir ' must be an existing directory"
9
+ throw " outputDir: '$outputDir ' must be an existing directory"
10
10
}
11
11
12
12
if ([string ]::IsNullOrWhiteSpace($env: WORKSPACE ) -or ! (Test-Path $env: WORKSPACE ))
13
13
{
14
- throw " env:WORKSPACE: '$env: WORKSPACE ' must be an existing directory"
14
+ throw " env:WORKSPACE: '$env: WORKSPACE ' must be an existing directory"
15
15
}
16
16
17
17
$packageSource = $packageSource.TrimEnd (' \\' )
18
18
Write-Host " using package id: $packageId , package source: $packageSource , packageVersion: $packageVersion "
19
19
dotnet publish $cmdletsDir -f dnxcore50 - r win7- x64 - o $packageSource
20
20
Copy-Item - Path $cmdletsDir \content - Destination $packageSource \content - Recurse - Force
21
+ Copy-Item - Path $cmdletsDir \* xml - Destination $packageSource \content - Force
21
22
22
23
$nuSpecTemplate = (Get-ChildItem ([System.IO.Path ]::Combine($cmdletsDir , ($packageId + " .nuspec.template" ))))
23
24
$nuSpecOutput = [System.IO.Path ]::Combine($packageSource , ($packageId + " .nuspec" ))
@@ -34,19 +35,20 @@ $contentFileText = ""
34
35
$contentFiles | % { $contentFileText += (" <file src="" " + $_.Name + " "" target="" content"" />`r`n " )}
35
36
if ($packageId -ne " Microsoft.CLU.Commands" )
36
37
{
37
- $contentFileText += " <file src="" content\*.lx"" target="" content"" />`r`n "
38
+ $contentFileText += " <file src="" content\*.lx"" target="" content"" />`r`n "
39
+ $contentFileText += " <file src="" content\*xml"" target="" content"" />`r`n "
38
40
}
39
41
if ($renameFileExists )
40
42
{
41
- $contentFileText += " <file src="" content\rename.cfg"" target="" content"" />`r`n "
43
+ $contentFileText += " <file src="" content\rename.cfg"" target="" content"" />`r`n "
42
44
}
43
45
$contentFileText += " <file src="" content\package.cfg"" target="" content"" />`r`n "
44
46
$sourceFileText = " "
45
47
$refFiles | % {$sourceFileText += (" <file src="" " + $_.Name + " "" target="" lib\dnxcore50"" />`r`n " )}
46
48
$outputContent = $fileContent -replace " %PackageVersion%" , $packageVersion
47
49
$outputContent = $outputContent -replace " %ReferenceFiles%" , $refFileText
48
- $outputContent = $outputContent -replace " %SourceFiles%" , $sourceFileText
49
- $outputContent = $outputContent -replace " %ContentFiles%" , $contentFileText
50
+ $outputContent = $outputContent -replace " %SourceFiles%" , $sourceFileText
51
+ $outputContent = $outputContent -replace " %ContentFiles%" , $contentFileText
50
52
Set-Content - Value $outputContent - Path $nuspecOutput
51
53
52
54
Write-Host " Creating nuget package..."
0 commit comments