diff --git a/packaging/osx/package-osx.sh b/packaging/osx/package-osx.sh index 95d252409..caebef802 100755 --- a/packaging/osx/package-osx.sh +++ b/packaging/osx/package-osx.sh @@ -12,20 +12,12 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$( cd -P "$DIR/../../" && pwd )" +source "$DIR/../../scripts/common/_common.sh" if [ -z "$DOTNET_CLI_VERSION" ]; then echo "Provide a version number (DOTNET_CLI_VERSION) $DOTNET_CLI_VERSION" && exit 1 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 if [ ! -d "$STAGE2_DIR" ]; then diff --git a/scripts/build/build_info.sh b/scripts/build/build_info.sh new file mode 100755 index 000000000..3002f798a --- /dev/null +++ b/scripts/build/build_info.sh @@ -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 diff --git a/scripts/build/restore-packages.sh b/scripts/build/restore-packages.sh index 585e9b6b1..6eba8638c 100755 --- a/scripts/build/restore-packages.sh +++ b/scripts/build/restore-packages.sh @@ -18,10 +18,9 @@ source "$DIR/../common/_common.sh" header "Restoring packages" -#Temporarily restore for ALL THE RIDS! This solves a bootstrapping problem in this fix -$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 --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 --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/src" --quiet "$NOCACHE" --parallel +$DNX_ROOT/dnu restore "$REPOROOT/test" --quiet "$NOCACHE" --parallel +$DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet "$NOCACHE" --parallel 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 diff --git a/scripts/compile/compile-stage.sh b/scripts/compile/compile-stage.sh index ad548c3f9..993a5c912 100755 --- a/scripts/compile/compile-stage.sh +++ b/scripts/compile/compile-stage.sh @@ -59,12 +59,12 @@ RUNTIME_OUTPUT_DIR="$OUTPUT_DIR/runtime/coreclr" for project in ${PROJECTS[@]} do -echo dotnet publish --framework "$TFM" --runtime "$RID" --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" + echo dotnet publish --native-subdirectory --framework "$TFM" --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 # 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 for file in ${FILES_TO_CLEAN[@]} diff --git a/scripts/crossgen/crossgen_roslyn.sh b/scripts/crossgen/crossgen_roslyn.sh index 7c74c2fcb..08cfd27bb 100755 --- a/scripts/crossgen/crossgen_roslyn.sh +++ b/scripts/crossgen/crossgen_roslyn.sh @@ -11,12 +11,14 @@ BIN_DIR="$( cd $1 && pwd )" UNAME=`uname` # 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 -elif [ "$UNAME" == "Linux" ]; then +elif [ "$OSNAME" == "ubuntu" ]; then RID=ubuntu.14.04-x64 +elif [ "$OSNAME" == "centos" ]; then + RID=centos.7.1-x64 else - echo "Unknown OS: $UNAME" 1>&2 + echo "Unknown OS: $OSNAME" 1>&2 exit 1 fi diff --git a/scripts/test/package-command-test.ps1 b/scripts/test/package-command-test.ps1 index ec3e769b3..53c71313d 100644 --- a/scripts/test/package-command-test.ps1 +++ b/scripts/test/package-command-test.ps1 @@ -5,7 +5,7 @@ . "$PSScriptRoot\..\common\_common.ps1" -$TestPackagesPath = "$RepoRoot\tests\packages" +$TestPackagesPath = "$RepoRoot\artifacts\tests\package-command-test\packages" if((Test-Path $TestPackagesPath) -eq 0) { @@ -66,4 +66,4 @@ foreach { popd } -Exit 0 \ No newline at end of file +Exit 0 diff --git a/scripts/test/package-command-test.sh b/scripts/test/package-command-test.sh index 592f5999d..3d65d6f53 100755 --- a/scripts/test/package-command-test.sh +++ b/scripts/test/package-command-test.sh @@ -17,10 +17,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" -TestPackagesPath="$REPOROOT/tests/packages" +TestPackagesPath="$REPOROOT/artifacts/tests/package-command-test/packages" -mkdir "$REPOROOT/tests" -mkdir "$TestPackagesPath" +mkdir -p "$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 "$TestPackagesPath" @@ -52,13 +51,13 @@ done for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "AppWith") do testName="test/PackagedCommands/Consumers/$test" - + pushd "$REPOROOT/$testName" - - output=$(dotnet hello) - + + output=$(dotnet hello) + rm "project.json" - + if [ "$output" == "Hello" ] ; then echo "Test Passed: $testName" @@ -67,6 +66,6 @@ do error " printed $output" exit 1 fi - + popd -done \ No newline at end of file +done diff --git a/scripts/test/runtests.sh b/scripts/test/runtests.sh index 03201a26c..5fb622c42 100755 --- a/scripts/test/runtests.sh +++ b/scripts/test/runtests.sh @@ -28,7 +28,7 @@ TestProjects=( \ for project in ${TestProjects[@]} 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 # copy TestProjects folder which is used by the test cases @@ -48,7 +48,7 @@ do exitCode=$? failCount+=$exitCode if [ $exitCode -ne 0 ]; then - failedTests+=($project) + failedTests+=("${project}.dll") fi done @@ -60,7 +60,7 @@ fi for test in ${failedTests[@]} do - error "$test.dll failed. Logs in '$TestBinRoot/${test}-testResults.xml'" + error "$test failed. Logs in '$TestBinRoot/${test}-testResults.xml'" done popd diff --git a/scripts/test/validate-dependencies.sh b/scripts/test/validate-dependencies.sh index 8292e9b12..bf5c1ab65 100755 --- a/scripts/test/validate-dependencies.sh +++ b/scripts/test/validate-dependencies.sh @@ -17,7 +17,7 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" # 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 set +e "$STAGE2_DIR/../tools/pjvalidate" "$REPOROOT/src" diff --git a/tools/MultiProjectValidator/AnalysisRules/DependencyMismatch/DependencyInfo.cs b/tools/MultiProjectValidator/AnalysisRules/DependencyMismatch/DependencyInfo.cs index 7c2669dec..df6570093 100644 --- a/tools/MultiProjectValidator/AnalysisRules/DependencyMismatch/DependencyInfo.cs +++ b/tools/MultiProjectValidator/AnalysisRules/DependencyMismatch/DependencyInfo.cs @@ -1,4 +1,5 @@ -using Microsoft.DotNet.ProjectModel; +using System; +using Microsoft.DotNet.ProjectModel; namespace MultiProjectValidator.AnalysisRules.DependencyMismatch { @@ -9,7 +10,7 @@ namespace MultiProjectValidator.AnalysisRules.DependencyMismatch return new DependencyInfo { ProjectPath = context.ProjectFile.ProjectFilePath, - Version = library.Identity.Version.ToString(), + Version = library.Identity.Version?.ToString() ?? String.Empty, Name = library.Identity.Name }; } diff --git a/tools/MultiProjectValidator/AnalysisRules/DependencyMismatchRule.cs b/tools/MultiProjectValidator/AnalysisRules/DependencyMismatchRule.cs index 64794e843..3900639d1 100644 --- a/tools/MultiProjectValidator/AnalysisRules/DependencyMismatchRule.cs +++ b/tools/MultiProjectValidator/AnalysisRules/DependencyMismatchRule.cs @@ -70,11 +70,11 @@ namespace MultiProjectValidator.AnalysisRules StringBuilder sb = new StringBuilder(); sb.Append($"Conflict for {dependencyGroup.DependencyName} in projects:{Environment.NewLine}"); - + foreach (var version in dependencyGroup.VersionDependencyInfoMap.Keys) { var dependencyInfoList = dependencyGroup.VersionDependencyInfoMap[version]; - + foreach (var dependencyInfo in dependencyInfoList) { sb.Append($"Version: {dependencyInfo.Version} Path: {dependencyInfo.ProjectPath} {Environment.NewLine}"); @@ -134,12 +134,8 @@ namespace MultiProjectValidator.AnalysisRules } } } - + return libraryNameDependencyGroupMap.Values.ToList(); } - - - - } }