let RID detection do its thing
also: * fix up pjvalidate to handle versionless deps * fix up package-command-test
This commit is contained in:
parent
4344af3c1b
commit
845f2c56e6
11 changed files with 50 additions and 45 deletions
|
@ -12,20 +12,12 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
|
||||||
done
|
done
|
||||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
|
||||||
REPOROOT="$( cd -P "$DIR/../../" && pwd )"
|
source "$DIR/../../scripts/common/_common.sh"
|
||||||
|
|
||||||
if [ -z "$DOTNET_CLI_VERSION" ]; then
|
if [ -z "$DOTNET_CLI_VERSION" ]; then
|
||||||
echo "Provide a version number (DOTNET_CLI_VERSION) $DOTNET_CLI_VERSION" && exit 1
|
echo "Provide a version number (DOTNET_CLI_VERSION) $DOTNET_CLI_VERSION" && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(uname)" == "Darwin" ]; then
|
|
||||||
OSNAME=osx
|
|
||||||
RID=osx.10.10-x64
|
|
||||||
else
|
|
||||||
echo "Package (OSX) only runs on Darwin"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
STAGE2_DIR=$REPOROOT/artifacts/$RID/stage2
|
STAGE2_DIR=$REPOROOT/artifacts/$RID/stage2
|
||||||
|
|
||||||
if [ ! -d "$STAGE2_DIR" ]; then
|
if [ ! -d "$STAGE2_DIR" ]; then
|
||||||
|
|
16
scripts/build/build_info.sh
Executable file
16
scripts/build/build_info.sh
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
UNAME=$(uname)
|
||||||
|
echo "Platform: $UNAME"
|
||||||
|
|
||||||
|
if [ "$UNAME" = "Linux" ]; then
|
||||||
|
DISTRO=$(cat /etc/os-release | grep "^ID=" | cut -d = -f 2 | sed s/\"//g)
|
||||||
|
VERSION=$(cat /etc/os-release | grep "^VERSION_ID=" | cut -d = -f 2 | sed s/\"//g)
|
||||||
|
echo "Distro: $DISTRO"
|
||||||
|
echo "Version: $VERSION"
|
||||||
|
echo "RID: $DISTRO.$VERSION-x64"
|
||||||
|
else
|
||||||
|
VERSION=$(sw_vers -productVersion)
|
||||||
|
echo "OS: Mac OS X $VERSION"
|
||||||
|
echo "RID: osx.$(echo $VERSION | cut -d . -f 1,2)-x64"
|
||||||
|
fi
|
|
@ -18,10 +18,9 @@ source "$DIR/../common/_common.sh"
|
||||||
|
|
||||||
header "Restoring packages"
|
header "Restoring packages"
|
||||||
|
|
||||||
#Temporarily restore for ALL THE RIDS! This solves a bootstrapping problem in this fix
|
$DNX_ROOT/dnu restore "$REPOROOT/src" --quiet "$NOCACHE" --parallel
|
||||||
$DNX_ROOT/dnu restore "$REPOROOT/src" --quiet --runtime win7-x64 --runtime ubuntu.14.04-x64 --runtime osx.10.10-x64 --runtime osx.10.11-x64 --runtime centos.7.1-x64 "$NOCACHE" --parallel
|
$DNX_ROOT/dnu restore "$REPOROOT/test" --quiet "$NOCACHE" --parallel
|
||||||
$DNX_ROOT/dnu restore "$REPOROOT/test" --quiet --runtime win7-x64 --runtime ubuntu.14.04-x64 --runtime osx.10.10-x64 --runtime osx.10.11-x64 --runtime centos.7.1-x64 "$NOCACHE" --parallel
|
$DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet "$NOCACHE" --parallel
|
||||||
$DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet --runtime win7-x64 --runtime ubuntu.14.04-x64 --runtime osx.10.10-x64 --runtime osx.10.11-x64 --runtime centos.7.1-x64 "$NOCACHE" --parallel
|
|
||||||
set +e
|
set +e
|
||||||
$DNX_ROOT/dnu restore "$REPOROOT/testapp" --quiet --runtime win7-x64 --runtime ubuntu.14.04-x64 --runtime osx.10.10-x64 --runtime osx.10.11-x64 --runtime centos.7.1-x64 "$NOCACHE" --parallel >/dev/null 2>&1
|
$DNX_ROOT/dnu restore "$REPOROOT/testapp" --quiet "$NOCACHE" --parallel >/dev/null 2>&1
|
||||||
set -e
|
set -e
|
||||||
|
|
|
@ -59,12 +59,12 @@ RUNTIME_OUTPUT_DIR="$OUTPUT_DIR/runtime/coreclr"
|
||||||
|
|
||||||
for project in ${PROJECTS[@]}
|
for project in ${PROJECTS[@]}
|
||||||
do
|
do
|
||||||
echo dotnet publish --framework "$TFM" --runtime "$RID" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project"
|
echo dotnet publish --native-subdirectory --framework "$TFM" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project"
|
||||||
dotnet publish --native-subdirectory --framework "$TFM" --runtime "$RID" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project"
|
dotnet publish --native-subdirectory --framework "$TFM" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Bring in the runtime
|
# Bring in the runtime
|
||||||
dotnet publish --framework "$TFM" --runtime "$RID" --output "$RUNTIME_OUTPUT_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Runtime"
|
dotnet publish --output "$RUNTIME_OUTPUT_DIR" --configuration "$CONFIGURATION" "$REPOROOT/src/Microsoft.DotNet.Runtime"
|
||||||
|
|
||||||
# Clean up bogus additional files
|
# Clean up bogus additional files
|
||||||
for file in ${FILES_TO_CLEAN[@]}
|
for file in ${FILES_TO_CLEAN[@]}
|
||||||
|
|
|
@ -11,12 +11,14 @@ BIN_DIR="$( cd $1 && pwd )"
|
||||||
UNAME=`uname`
|
UNAME=`uname`
|
||||||
|
|
||||||
# Always recalculate the RID because the package always uses a specific RID, regardless of OS X version or Linux distro.
|
# Always recalculate the RID because the package always uses a specific RID, regardless of OS X version or Linux distro.
|
||||||
if [ "$UNAME" == "Darwin" ]; then
|
if [ "$OSNAME" == "osx" ]; then
|
||||||
RID=osx.10.10-x64
|
RID=osx.10.10-x64
|
||||||
elif [ "$UNAME" == "Linux" ]; then
|
elif [ "$OSNAME" == "ubuntu" ]; then
|
||||||
RID=ubuntu.14.04-x64
|
RID=ubuntu.14.04-x64
|
||||||
|
elif [ "$OSNAME" == "centos" ]; then
|
||||||
|
RID=centos.7.1-x64
|
||||||
else
|
else
|
||||||
echo "Unknown OS: $UNAME" 1>&2
|
echo "Unknown OS: $OSNAME" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
. "$PSScriptRoot\..\common\_common.ps1"
|
. "$PSScriptRoot\..\common\_common.ps1"
|
||||||
|
|
||||||
$TestPackagesPath = "$RepoRoot\tests\packages"
|
$TestPackagesPath = "$RepoRoot\artifacts\tests\package-command-test\packages"
|
||||||
|
|
||||||
if((Test-Path $TestPackagesPath) -eq 0)
|
if((Test-Path $TestPackagesPath) -eq 0)
|
||||||
{
|
{
|
||||||
|
@ -66,4 +66,4 @@ foreach {
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
Exit 0
|
Exit 0
|
||||||
|
|
|
@ -17,10 +17,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
|
|
||||||
source "$DIR/../common/_common.sh"
|
source "$DIR/../common/_common.sh"
|
||||||
|
|
||||||
TestPackagesPath="$REPOROOT/tests/packages"
|
TestPackagesPath="$REPOROOT/artifacts/tests/package-command-test/packages"
|
||||||
|
|
||||||
mkdir "$REPOROOT/tests"
|
mkdir -p "$TestPackagesPath"
|
||||||
mkdir "$TestPackagesPath"
|
|
||||||
|
|
||||||
dotnet pack "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello"
|
dotnet pack "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello"
|
||||||
cp "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/bin/Debug/"*.nupkg "$TestPackagesPath"
|
cp "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/bin/Debug/"*.nupkg "$TestPackagesPath"
|
||||||
|
@ -52,13 +51,13 @@ done
|
||||||
for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "AppWith")
|
for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "AppWith")
|
||||||
do
|
do
|
||||||
testName="test/PackagedCommands/Consumers/$test"
|
testName="test/PackagedCommands/Consumers/$test"
|
||||||
|
|
||||||
pushd "$REPOROOT/$testName"
|
pushd "$REPOROOT/$testName"
|
||||||
|
|
||||||
output=$(dotnet hello)
|
output=$(dotnet hello)
|
||||||
|
|
||||||
rm "project.json"
|
rm "project.json"
|
||||||
|
|
||||||
if [ "$output" == "Hello" ] ;
|
if [ "$output" == "Hello" ] ;
|
||||||
then
|
then
|
||||||
echo "Test Passed: $testName"
|
echo "Test Passed: $testName"
|
||||||
|
@ -67,6 +66,6 @@ do
|
||||||
error " printed $output"
|
error " printed $output"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
popd
|
popd
|
||||||
done
|
done
|
||||||
|
|
|
@ -28,7 +28,7 @@ TestProjects=( \
|
||||||
|
|
||||||
for project in ${TestProjects[@]}
|
for project in ${TestProjects[@]}
|
||||||
do
|
do
|
||||||
dotnet publish --framework "dnxcore50" --runtime "$RID" --output "$TestBinRoot" --configuration "$CONFIGURATION" "$REPOROOT/test/$project"
|
dotnet publish --framework "dnxcore50" --output "$TestBinRoot" --configuration "$CONFIGURATION" "$REPOROOT/test/$project"
|
||||||
done
|
done
|
||||||
|
|
||||||
# copy TestProjects folder which is used by the test cases
|
# copy TestProjects folder which is used by the test cases
|
||||||
|
@ -48,7 +48,7 @@ do
|
||||||
exitCode=$?
|
exitCode=$?
|
||||||
failCount+=$exitCode
|
failCount+=$exitCode
|
||||||
if [ $exitCode -ne 0 ]; then
|
if [ $exitCode -ne 0 ]; then
|
||||||
failedTests+=($project)
|
failedTests+=("${project}.dll")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ fi
|
||||||
|
|
||||||
for test in ${failedTests[@]}
|
for test in ${failedTests[@]}
|
||||||
do
|
do
|
||||||
error "$test.dll failed. Logs in '$TestBinRoot/${test}-testResults.xml'"
|
error "$test failed. Logs in '$TestBinRoot/${test}-testResults.xml'"
|
||||||
done
|
done
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -17,7 +17,7 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||||
source "$DIR/../common/_common.sh"
|
source "$DIR/../common/_common.sh"
|
||||||
|
|
||||||
# Run Validation for Project.json dependencies
|
# Run Validation for Project.json dependencies
|
||||||
dotnet publish "$REPOROOT/tools/MultiProjectValidator" -r "$RID" -o "$STAGE2_DIR/../tools"
|
dotnet publish "$REPOROOT/tools/MultiProjectValidator" -o "$STAGE2_DIR/../tools"
|
||||||
#TODO for release builds this should fail
|
#TODO for release builds this should fail
|
||||||
set +e
|
set +e
|
||||||
"$STAGE2_DIR/../tools/pjvalidate" "$REPOROOT/src"
|
"$STAGE2_DIR/../tools/pjvalidate" "$REPOROOT/src"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using System;
|
||||||
|
using Microsoft.DotNet.ProjectModel;
|
||||||
|
|
||||||
namespace MultiProjectValidator.AnalysisRules.DependencyMismatch
|
namespace MultiProjectValidator.AnalysisRules.DependencyMismatch
|
||||||
{
|
{
|
||||||
|
@ -9,7 +10,7 @@ namespace MultiProjectValidator.AnalysisRules.DependencyMismatch
|
||||||
return new DependencyInfo
|
return new DependencyInfo
|
||||||
{
|
{
|
||||||
ProjectPath = context.ProjectFile.ProjectFilePath,
|
ProjectPath = context.ProjectFile.ProjectFilePath,
|
||||||
Version = library.Identity.Version.ToString(),
|
Version = library.Identity.Version?.ToString() ?? String.Empty,
|
||||||
Name = library.Identity.Name
|
Name = library.Identity.Name
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,11 +70,11 @@ namespace MultiProjectValidator.AnalysisRules
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
sb.Append($"Conflict for {dependencyGroup.DependencyName} in projects:{Environment.NewLine}");
|
sb.Append($"Conflict for {dependencyGroup.DependencyName} in projects:{Environment.NewLine}");
|
||||||
|
|
||||||
foreach (var version in dependencyGroup.VersionDependencyInfoMap.Keys)
|
foreach (var version in dependencyGroup.VersionDependencyInfoMap.Keys)
|
||||||
{
|
{
|
||||||
var dependencyInfoList = dependencyGroup.VersionDependencyInfoMap[version];
|
var dependencyInfoList = dependencyGroup.VersionDependencyInfoMap[version];
|
||||||
|
|
||||||
foreach (var dependencyInfo in dependencyInfoList)
|
foreach (var dependencyInfo in dependencyInfoList)
|
||||||
{
|
{
|
||||||
sb.Append($"Version: {dependencyInfo.Version} Path: {dependencyInfo.ProjectPath} {Environment.NewLine}");
|
sb.Append($"Version: {dependencyInfo.Version} Path: {dependencyInfo.ProjectPath} {Environment.NewLine}");
|
||||||
|
@ -134,12 +134,8 @@ namespace MultiProjectValidator.AnalysisRules
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return libraryNameDependencyGroupMap.Values.ToList();
|
return libraryNameDependencyGroupMap.Values.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue