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(
|
|
|
|
[string]$toolsDir = $(throw "Specify the full path to the directory which has dotnet tool"),
|
|
|
|
[string]$versionSuffix = ""
|
|
|
|
)
|
|
|
|
|
|
|
|
# unify trailing backslash
|
|
|
|
$toolsDir = $toolsDir.TrimEnd('\')
|
|
|
|
$versionArg = ""
|
|
|
|
if ($versionSuffix -ne "") {
|
|
|
|
$versionArg = "--version-suffix $VersionSuffix"
|
|
|
|
}
|
|
|
|
|
2015-12-01 22:41:31 +00:00
|
|
|
. "$PSScriptRoot\..\..\scripts\_common.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
|
|
|
|
|
2015-12-01 22:41:31 +00:00
|
|
|
$Projects = @(
|
|
|
|
"Microsoft.DotNet.Cli.Utils",
|
|
|
|
"Microsoft.DotNet.ProjectModel",
|
|
|
|
"Microsoft.DotNet.ProjectModel.Workspaces",
|
|
|
|
"Microsoft.DotNet.Runtime",
|
|
|
|
"Microsoft.Extensions.Testing.Abstractions"
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach ($ProjectName in $Projects) {
|
|
|
|
$ProjectFile = "$RepoRoot\src\$ProjectName\project.json"
|
2015-12-05 02:03:57 +00:00
|
|
|
& $toolsDir\dotnet restore "$ProjectFile"
|
2015-12-01 00:51:07 +00:00
|
|
|
if (!$?) {
|
2015-12-05 02:03:57 +00:00
|
|
|
Write-Host "$toolsDir\dotnet restore failed for: $ProjectFile"
|
2015-12-01 00:51:07 +00:00
|
|
|
Exit 1
|
|
|
|
}
|
2015-12-05 02:03:57 +00:00
|
|
|
& $toolsDir\dotnet pack "$ProjectFile" --output "$IntermediatePackagesDir" $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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Get-ChildItem $IntermediatePackagesDir -Filter *.nupkg | Copy-Item -Destination $PackagesDir
|