2015-12-04 18:03:57 -08:00
|
|
|
# Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
|
|
param(
|
2015-12-28 11:47:21 -08:00
|
|
|
[Parameter(Mandatory=$true)][string]$toolsDir,
|
2015-12-04 18:03:57 -08:00
|
|
|
[string]$versionSuffix = ""
|
|
|
|
)
|
|
|
|
|
|
|
|
# unify trailing backslash
|
|
|
|
$toolsDir = $toolsDir.TrimEnd('\')
|
|
|
|
$versionArg = ""
|
|
|
|
if ($versionSuffix -ne "") {
|
2016-01-23 16:56:22 -08:00
|
|
|
$versionArg = "--version-suffix"
|
2015-12-04 18:03:57 -08:00
|
|
|
}
|
|
|
|
|
2016-03-07 12:20:50 -08:00
|
|
|
$RepoRoot = Convert-Path "$PSScriptRoot\..\.."
|
|
|
|
|
|
|
|
. "$RepoRoot\scripts\common\_common.ps1"
|
|
|
|
. "$RepoRoot\scripts\package\projectsToPack.ps1"
|
2015-11-30 16:51:07 -08:00
|
|
|
|
2015-12-01 14:41:31 -08:00
|
|
|
$IntermediatePackagesDir = "$RepoRoot\artifacts\packages\intermediate"
|
|
|
|
$PackagesDir = "$RepoRoot\artifacts\packages"
|
2015-11-30 16:51:07 -08:00
|
|
|
|
|
|
|
New-Item -ItemType Directory -Force -Path $IntermediatePackagesDir
|
|
|
|
|
2016-01-22 17:37:14 -08:00
|
|
|
foreach ($ProjectName in $ProjectsToPack) {
|
2015-12-01 14:41:31 -08:00
|
|
|
$ProjectFile = "$RepoRoot\src\$ProjectName\project.json"
|
2016-01-11 22:29:05 -08:00
|
|
|
|
2016-02-16 19:31:09 -08:00
|
|
|
& $toolsDir\dotnet pack "$ProjectFile" --no-build --build-base-path "$Stage2CompilationDir\forPackaging" --output "$IntermediatePackagesDir" --configuration "$env:CONFIGURATION" $versionArg $versionSuffix
|
2015-11-30 16:51:07 -08:00
|
|
|
if (!$?) {
|
2015-12-04 18:03:57 -08:00
|
|
|
Write-Host "$toolsDir\dotnet pack failed for: $ProjectFile"
|
2015-11-30 16:51:07 -08:00
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-03 10:57:25 -08:00
|
|
|
Get-ChildItem $IntermediatePackagesDir -Filter *.nupkg | ? {$_.Name -NotLike "*.symbols.nupkg"} | Copy-Item -Destination $PackagesDir
|