2015-12-05 02:03:57 +00: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 19:47:21 +00:00
|
|
|
[Parameter(Mandatory=$true)][string]$toolsDir,
|
2015-12-05 02:03:57 +00:00
|
|
|
[string]$versionSuffix = ""
|
|
|
|
)
|
|
|
|
|
|
|
|
# unify trailing backslash
|
|
|
|
$toolsDir = $toolsDir.TrimEnd('\')
|
|
|
|
$versionArg = ""
|
|
|
|
if ($versionSuffix -ne "") {
|
2016-01-12 23:27:02 +00:00
|
|
|
$versionArg = "--version-suffix $versionSuffix"
|
2015-12-05 02:03:57 +00:00
|
|
|
}
|
|
|
|
|
2015-12-28 19:47:21 +00:00
|
|
|
. "$PSScriptRoot\..\..\scripts\common\_common.ps1"
|
2016-01-23 01:37:14 +00:00
|
|
|
. "$REPOROOT\scripts\package\projectsToPack.ps1"
|
2015-12-01 00:51:07 +00:00
|
|
|
|
2015-12-01 22:41:31 +00:00
|
|
|
$IntermediatePackagesDir = "$RepoRoot\artifacts\packages\intermediate"
|
|
|
|
$PackagesDir = "$RepoRoot\artifacts\packages"
|
2015-12-01 00:51:07 +00:00
|
|
|
|
|
|
|
New-Item -ItemType Directory -Force -Path $IntermediatePackagesDir
|
|
|
|
|
2016-01-23 01:37:14 +00:00
|
|
|
foreach ($ProjectName in $ProjectsToPack) {
|
2015-12-01 22:41:31 +00:00
|
|
|
$ProjectFile = "$RepoRoot\src\$ProjectName\project.json"
|
2016-01-12 06:29:05 +00:00
|
|
|
|
2016-01-21 23:01:21 +00:00
|
|
|
& $toolsDir\dotnet pack "$ProjectFile" --basepath "$Stage2CompilationDir\bin" --output "$IntermediatePackagesDir" --configuration "$Configuration" $versionArg
|
2015-12-01 00:51:07 +00:00
|
|
|
if (!$?) {
|
2015-12-05 02:03:57 +00:00
|
|
|
Write-Host "$toolsDir\dotnet pack failed for: $ProjectFile"
|
2015-12-01 00:51:07 +00:00
|
|
|
Exit 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-20 23:41:46 +00:00
|
|
|
Get-ChildItem $IntermediatePackagesDir\$Configuration -Filter *.nupkg | ? {$_.Name -NotLike "*.symbols.nupkg"} | Copy-Item -Destination $PackagesDir
|