Create test packages directory

This commit is contained in:
piotrp 2016-01-10 23:06:02 -08:00
parent 9a615ff242
commit ac0dc9a666
2 changed files with 15 additions and 5 deletions

View file

@ -5,12 +5,17 @@
. "$PSScriptRoot\..\common\_common.ps1"
$TestPackagesPath = "$RepoRoot\tests\packages"
if((Test-Path $TestPackagesPath) -eq 0)
{
mkdir $TestPackagesPath;
}
"v1", "v2" |
foreach {
dotnet pack "$RepoRoot\test\PackagedCommands\Commands\dotnet-hello\$_\dotnet-hello"
cp "$RepoRoot\test\PackagedCommands\Commands\dotnet-hello\$_\dotnet-hello\bin\Debug\*.nupkg" -Destination "$RepoRoot\artifacts\packages"
cp "$RepoRoot\test\PackagedCommands\Commands\dotnet-hello\$_\dotnet-hello\bin\Debug\*.nupkg" -Destination $TestPackagesPath
if (!$?) {
error "Command failed: dotnet pack"
Exit 1
@ -27,7 +32,7 @@ foreach {
#restore test projects
pushd "$RepoRoot\test\PackagedCommands\Consumers"
dotnet restore -s "$RepoRoot\artifacts\packages" --no-cache --ignore-failed-sources --parallel
dotnet restore -s "$TestPackagesPath" --no-cache --ignore-failed-sources --parallel
if (!$?) {
error "Command failed: dotnet restore"
Exit 1

View file

@ -17,10 +17,15 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
source "$DIR/../common/_common.sh"
TestPackagesPath="$REPOROOT/tests/packages"
mkdir "$REPOROOT/tests"
mkdir "$TestPackagesPath"
dotnet pack "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello"
cp "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/bin/Debug/"*.nupkg "$REPOROOT/artifacts/packages"
cp "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/bin/Debug/"*.nupkg "$TestPackagesPath"
dotnet pack "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello"
cp "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello/bin/Debug/"*.nupkg "$REPOROOT/artifacts/packages"
cp "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello/bin/Debug/"*.nupkg "$TestPackagesPath"
# enable restore for test projects
for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "AppWith")
@ -32,7 +37,7 @@ done
# restore test projects
pushd "$REPOROOT/test/PackagedCommands/Consumers"
dotnet restore -s "$REPOROOT/artifacts/packages" --no-cache --ignore-failed-sources --parallel
dotnet restore -s "$TestPackagesPath" --no-cache --ignore-failed-sources --parallel
popd
#compile tests with direct dependencies