diff --git a/.gitignore b/.gitignore index ed84606bd..cc968ba41 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ # OSX Packaging temp files *.pkg +# OS X Device Services Store +.DS_Store + # CMake generated files cmake/ @@ -255,3 +258,7 @@ _Pvt_Extensions # FAKE - F# Make .fake/ + +# Exceptions +# Build Scripts +!scripts/build/ diff --git a/bin b/bin new file mode 100644 index 000000000..476f524aa Binary files /dev/null and b/bin differ diff --git a/build.cmd b/build.cmd index 6d632f9f3..15cdc5999 100644 --- a/build.cmd +++ b/build.cmd @@ -3,4 +3,4 @@ REM Copyright (c) .NET Foundation and contributors. All rights reserved. REM Licensed under the MIT license. See LICENSE file in the project root for full license information. -powershell -NoProfile -NoLogo -Command "%~dp0scripts\build.ps1 %*; exit $LastExitCode;" +powershell -NoProfile -NoLogo -Command "%~dp0scripts\build\build.ps1 %*; exit $LastExitCode;" diff --git a/build.sh b/build.sh index 35670e35c..6d83126c7 100755 --- a/build.sh +++ b/build.sh @@ -12,62 +12,26 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$DIR/scripts/_common.sh" - -for i in "$@" -do - lowerI="$(echo $i | awk '{print tolower($0)}')" - case $lowerI in - release) - export CONFIGURATION=Release - ;; - debug) - export CONFIGURATION=Debug - ;; - offline) - export OFFLINE=true - ;; - *) - esac -done - -[ -z "$CONFIGURATION" ] && CONFIGURATION=Debug - -if [ ! -z "$OFFLINE" ]; then - header " - Offline Build - " -fi - -# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot -export DOTNET_INSTALL_DIR=$DIR/.dotnet_stage0/$RID -[ -d $DOTNET_INSTALL_DIR ] || mkdir -p $DOTNET_INSTALL_DIR -export PATH=$DOTNET_INSTALL_DIR/bin:$PATH - -# UTC Timestamp of the last commit is used as the build number. This is for easy synchronization of build number between Windows, OSX and Linux builds. -LAST_COMMIT_TIMESTAMP=$(git log -1 --format=%ct) -major=1 -minor=0 -# no. of days since epoch -build=0 -revision=$LAST_COMMIT_TIMESTAMP - -export DOTNET_BUILD_VERSION=$major.$minor.$build.$revision - -header "Building dotnet tools version $DOTNET_BUILD_VERSION - $CONFIGURATION" +source "$DIR/scripts/common/_common.sh" +source "$REPOROOT/scripts/build/process-args.sh" +# splitting build from package is required to work around dotnet/coreclr#2215 +# once that is fixed, we should remove the NOPACKAGE flag and do the full build either in +# or out of docker. if [ ! -z "$BUILD_IN_DOCKER" ]; then - export BUILD_COMMAND="/opt/code/scripts/compile.sh" - $DIR/scripts/docker/dockerbuild.sh + export BUILD_COMMAND="/opt/code/scripts/build/build.sh NOPACKAGE" + $REPOROOT/scripts/docker/dockerbuild.sh else - $DIR/scripts/compile.sh + $REPOROOT/scripts/build/build.sh NOPACKAGE fi if [ ! -z "$PACKAGE_IN_DOCKER" ]; then - export BUILD_COMMAND="/opt/code/scripts/package/package.sh" - $DIR/scripts/docker/dockerbuild.sh + export BUILD_COMMAND="/opt/code/scripts/package/package-native.sh" + $REPOROOT/scripts/docker/dockerbuild.sh else - $DIR/scripts/package/package.sh -fi + $REPOROOT/scripts/package/package.sh +fi \ No newline at end of file diff --git a/packaging/debian/package_tool/test/test_assets/test_package_layout/package_root/path_relative_to_package_root/test_exe.sh b/packaging/debian/package_tool/test/test_assets/test_package_layout/package_root/path_relative_to_package_root/test_exe.sh index 17c8db85f..370bc40f3 100755 --- a/packaging/debian/package_tool/test/test_assets/test_package_layout/package_root/path_relative_to_package_root/test_exe.sh +++ b/packaging/debian/package_tool/test/test_assets/test_package_layout/package_root/path_relative_to_package_root/test_exe.sh @@ -9,7 +9,7 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" diff --git a/packaging/nuget/package.ps1 b/packaging/nuget/package.ps1 index c047c7b79..6f7e97191 100644 --- a/packaging/nuget/package.ps1 +++ b/packaging/nuget/package.ps1 @@ -2,7 +2,7 @@ # 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"), + [Parameter(Mandatory=$true)][string]$toolsDir, [string]$versionSuffix = "" ) @@ -13,7 +13,7 @@ if ($versionSuffix -ne "") { $versionArg = "--version-suffix $VersionSuffix" } -. "$PSScriptRoot\..\..\scripts\_common.ps1" +. "$PSScriptRoot\..\..\scripts\common\_common.ps1" $IntermediatePackagesDir = "$RepoRoot\artifacts\packages\intermediate" $PackagesDir = "$RepoRoot\artifacts\packages" diff --git a/packaging/osx/package-osx.sh b/packaging/osx/package-osx.sh index 8dac0d0d4..1785e1591 100755 --- a/packaging/osx/package-osx.sh +++ b/packaging/osx/package-osx.sh @@ -8,7 +8,7 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" diff --git a/packaging/windows/generatemsi.ps1 b/packaging/windows/generatemsi.ps1 index 22201b638..933c3eb45 100644 --- a/packaging/windows/generatemsi.ps1 +++ b/packaging/windows/generatemsi.ps1 @@ -2,10 +2,10 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. param( - [string]$inputDir = $(throw "Specify the full path to the directory which needs to be harvested") + [Parameter(Mandatory=$true)][string]$inputDir ) -. "$PSScriptRoot\..\..\scripts\_common.ps1" +. "$PSScriptRoot\..\..\scripts\common\_common.ps1" $DotnetMSIOutput = "" $WixRoot = "" @@ -124,39 +124,33 @@ $WixRoot = AcquireWixTools if([string]::IsNullOrEmpty($WixRoot)) { - return -1 + Exit -1 } if(-Not (RunHeat)) { - return -1 + Exit -1 } if(-Not (RunCandle)) { - return -1 + Exit -1 } if(-Not (RunLight)) { - return -1 + Exit -1 } if(!(Test-Path $DotnetMSIOutput)) { throw "Unable to create the dotnet msi." - return -1 + Exit -1 } Write-Host -ForegroundColor Green "Successfully created dotnet MSI - $DotnetMSIOutput" -& $PSScriptRoot\testmsi.ps1 -inputMsi $DotnetMSIOutput - -if($LastExitCode -ne 0) -{ - Write-Host -ForegroundColor Red "Msi testing failed." - Exit 1 -} +_ $PSScriptRoot\testmsi.ps1 @("$DotnetMSIOutput") $PublishScript = Join-Path $PSScriptRoot "..\..\scripts\publish\publish.ps1" & $PublishScript -file $DotnetMSIOutput diff --git a/packaging/windows/testmsi.ps1 b/packaging/windows/testmsi.ps1 index 8744d903a..b73d81266 100644 --- a/packaging/windows/testmsi.ps1 +++ b/packaging/windows/testmsi.ps1 @@ -2,10 +2,10 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. param( - [string]$inputMsi = $(throw "Specify the full path to the msi which needs to be tested") + [Parameter(Mandatory=$true)][string]$inputMsi ) -. "$PSScriptRoot\..\..\scripts\_common.ps1" +. "$PSScriptRoot\..\..\scripts\common\_common.ps1" function Test-Administrator { diff --git a/scripts/build.ps1 b/scripts/build.ps1 deleted file mode 100644 index 39e1a46da..000000000 --- a/scripts/build.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -# -# 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]$Configuration="Debug", - [switch]$Offline) - -. "$PSScriptRoot\_common.ps1" - -$ErrorActionPreference="Stop" - -# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot -$env:DOTNET_INSTALL_DIR="$(Convert-Path "$PSScriptRoot\..")\.dotnet_stage0\win7-x64" -if (!(Test-Path $env:DOTNET_INSTALL_DIR)) -{ - mkdir $env:DOTNET_INSTALL_DIR | Out-Null -} -$env:PATH = "$env:DOTNET_INSTALL_DIR\cli\bin;$env:PATH" - -$VersionSuffix = "" -if (!$env:DOTNET_BUILD_VERSION) { - # Get the timestamp of the most recent commit - $timestamp = git log -1 --format=%ct - $commitTime = [timespan]::FromSeconds($timestamp) - - $majorVersion = 1 - $minorVersion = 0 - $buildnumber = 0 - $revnumber = $commitTime.TotalSeconds - - $VersionSuffix = "dev-$revnumber" - - $env:DOTNET_BUILD_VERSION = "$majorVersion.$minorVersion.$buildnumber.$revnumber" -} - -Write-Host -ForegroundColor Green "*** Building dotnet tools version $($env:DOTNET_BUILD_VERSION) - $Configuration ***" -if ($Offline) -{ - Write-Host -ForegroundColor Yellow " - Offline Build -" -} -& "$PSScriptRoot\compile.ps1" -Configuration:$Configuration -Offline:$Offline -if (!$?) { - Write-Host "Building dotnet tools finished with errors." - Exit 1 -} - -Write-Host -ForegroundColor Green "*** Packaging dotnet ***" -& "$PSScriptRoot\package\package.ps1" -if (!$?) { - Write-Host "Packaging dotnet finished with errors." - Exit 1 -} - - -Write-Host -ForegroundColor Green "*** Generating dotnet MSI ***" -& "$RepoRoot\packaging\windows\generatemsi.ps1" $Stage2Dir -if (!$?) { - Write-Host "Generating dotnet MSI finished with errors." - Exit 1 -} - - -Write-Host -ForegroundColor Green "*** Generating NuGet packages ***" -& "$RepoRoot\packaging\nuget\package.ps1" $Stage2Dir\bin $VersionSuffix -if (!$?) { - Write-Host "Generating NuGet packages finished with errors." - Exit 1 -} diff --git a/scripts/build/build.ps1 b/scripts/build/build.ps1 new file mode 100644 index 000000000..9247f0fe0 --- /dev/null +++ b/scripts/build/build.ps1 @@ -0,0 +1,48 @@ +# +# 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]$Configuration="Debug", + [switch]$Offline) + +$ErrorActionPreference="Stop" + +. "$PSScriptRoot\..\common\_common.ps1" + +_ "$RepoRoot\scripts\build\generate-version.ps1" + +header "Building dotnet tools version $($env:DOTNET_BUILD_VERSION) - $Configuration" +header "Checking Pre-Reqs" + +_ "$RepoRoot\scripts\test\check-prereqs.ps1" + +header "Restoring Tools and Packages" + +if ($Offline){ + info "Skipping Tools and Packages dowlnoad: Offline build" +} +else { + _ "$RepoRoot\scripts\obtain\install-tools.ps1" + + _ "$RepoRoot\scripts\build\restore-packages.ps1" +} + +header "Compiling" +_ "$RepoRoot\scripts\compile\compile.ps1" @("$Configuration") + +header "Running Tests" +_ "$RepoRoot\scripts\test\runtests.ps1" + +header "Validating Dependencies" +_ "$RepoRoot\scripts\test\validate-dependencies.ps1" + +header "Generating zip package" +_ "$RepoRoot\scripts\package\package.ps1" + +header "Generating dotnet MSI" +_ "$RepoRoot\packaging\windows\generatemsi.ps1" @("$Stage2Dir") + +header "Generating NuGet packages" +_ "$RepoRoot\packaging\nuget\package.ps1" @("$Stage2Dir\bin", "$VersionSuffix") \ No newline at end of file diff --git a/scripts/build/build.sh b/scripts/build/build.sh new file mode 100755 index 000000000..3d7fc253d --- /dev/null +++ b/scripts/build/build.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# +# 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. +# + +# Set OFFLINE environment variable to build offline + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" +source "$REPOROOT/scripts/build/generate-version.sh" + +header "Building dotnet tools version $DOTNET_BUILD_VERSION - $CONFIGURATION" +header "Checking Pre-Reqs" + +$REPOROOT/scripts/test/check-prereqs.sh + +header "Restoring Tools and Packages" + +if [ ! -z "$OFFLINE" ]; then + info "Skipping Tools and Package Download: Offline build" +else + $REPOROOT/scripts/obtain/install-tools.sh + + $REPOROOT/scripts/build/restore-packages.sh +fi + +header "Compiling" +$REPOROOT/scripts/compile/compile.sh + +# Skipping tests for centos +# tracked by issue - https://github.com/dotnet/corefx/issues/5066 +if [ "$OSNAME" != "centos" ]; then + # Run tests on the stage2 output + header "Testing stage2..." + DOTNET_HOME=$STAGE2_DIR DOTNET_TOOLS=$STAGE2_DIR $REPOROOT/scripts/test/runtests.sh +else + header "Skipping tests on CentOS due to corefx issue 5066" +fi + +header "Validating Dependencies" +$REPOROOT/scripts/test/validate-dependencies.sh + +header "Generating tarball" +$REPOROOT/scripts/package/package.sh + +if [ ! -z "$NOPACKAGE" ]; then + header "Generating Native Installer" + $REPOROOT/scripts/package/package-native.sh +else + header "Skipping packaging" +fi \ No newline at end of file diff --git a/scripts/build/build_appdeps.sh b/scripts/build/build_appdeps.sh index d1f03d22a..d69845d87 100755 --- a/scripts/build/build_appdeps.sh +++ b/scripts/build/build_appdeps.sh @@ -1,14 +1,22 @@ #!/usr/bin/env bash +# +# 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. +# -# This file encapsulates the temporary steps to build the dotnet-compile-native command successfully -# The AppDepSDK package is a temporary artifact until we have CoreRT assemblies published to Nuget +set -e -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source $SCRIPT_DIR/../_common.sh +source "$DIR/../common/_common.sh" -REPO_ROOT="$SCRIPT_DIR/../.." -APPDEPS_PROJECT_DIR=$REPO_ROOT/src/Microsoft.DotNet.Tools.Compiler.Native/appdep +APPDEPS_PROJECT_DIR="$REPOROOT/src/Microsoft.DotNet.Tools.Compiler.Native/appdep" # Get Absolute Output Dir pushd $1 diff --git a/scripts/build/generate-version.ps1 b/scripts/build/generate-version.ps1 new file mode 100644 index 000000000..b36e40640 --- /dev/null +++ b/scripts/build/generate-version.ps1 @@ -0,0 +1,19 @@ +# +# 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. +# + +#. "$PSScriptRoot\..\common\_common.ps1" + +# Get the timestamp of the most recent commit +$timestamp = git log -1 --format=%ct +$commitTime = [timespan]::FromSeconds($timestamp) + +$majorVersion = 1 +$minorVersion = 0 +$buildnumber = 0 +$revnumber = $commitTime.TotalSeconds + +$VersionSuffix = "dev-$revnumber" + +$env:DOTNET_BUILD_VERSION = "$majorVersion.$minorVersion.$buildnumber.$revnumber" \ No newline at end of file diff --git a/scripts/build/generate-version.sh b/scripts/build/generate-version.sh new file mode 100755 index 000000000..6d6f168b3 --- /dev/null +++ b/scripts/build/generate-version.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# +# 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. +# + +# UTC Timestamp of the last commit is used as the build number. This is for easy synchronization of build number between Windows, OSX and Linux builds. +LAST_COMMIT_TIMESTAMP=$(git log -1 --format=%ct) +export DOTNET_BUILD_VERSION=1.0.0-dev-$LAST_COMMIT_TIMESTAMP +echo "Version: $DOTNET_BUILD_VERSION" + +unset LAST_COMMIT_TIMESTAMP diff --git a/scripts/build/place-binary.sh b/scripts/build/place-binary.sh index 1d77d4307..533ff2b56 100755 --- a/scripts/build/place-binary.sh +++ b/scripts/build/place-binary.sh @@ -3,18 +3,18 @@ # 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. # + set -e SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done -SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$( cd -P "$SCRIPT_DIR/../.." && pwd )" +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$SCRIPT_DIR/../_common.sh" +source "$DIR/../common/_common.sh" echo "Copy From: $1" echo " To: $STAGE2_DIR/bin/" diff --git a/scripts/build/process-args.sh b/scripts/build/process-args.sh new file mode 100755 index 000000000..24e7edc25 --- /dev/null +++ b/scripts/build/process-args.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# 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. +# + +for i in "$@" +do + lowerI="$(echo $i | awk '{print tolower($0)}')" + case $lowerI in + release) + export CONFIGURATION=Release + ;; + debug) + export CONFIGURATION=Debug + ;; + offline) + export OFFLINE=true + ;; + nopackage) + export NOPACKAGE=true + ;; + *) + esac +done \ No newline at end of file diff --git a/scripts/build/restore-packages.ps1 b/scripts/build/restore-packages.ps1 new file mode 100644 index 000000000..92dda0d07 --- /dev/null +++ b/scripts/build/restore-packages.ps1 @@ -0,0 +1,18 @@ +# +# 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. +# + +. $PSScriptRoot\..\common\_common.ps1 + +# Restore packages +header "Restoring packages" +& "$DnxRoot\dnu" restore "$RepoRoot\src" --quiet --runtime "$Rid" --no-cache --parallel +& "$DnxRoot\dnu" restore "$RepoRoot\test" --quiet --runtime "$Rid" --no-cache --parallel +& "$DnxRoot\dnu" restore "$RepoRoot\tools" --quiet --runtime "$Rid" --no-cache --parallel + +$oldErrorAction=$ErrorActionPreference +$ErrorActionPreference="SilentlyContinue" +& "$DnxRoot\dnu" restore "$RepoRoot\testapp" --quiet --runtime "$Rid" --no-cache --parallel 2>&1 | Out-Null +$ErrorActionPreference=$oldErrorAction + diff --git a/scripts/build/restore-packages.sh b/scripts/build/restore-packages.sh new file mode 100755 index 000000000..fc2356932 --- /dev/null +++ b/scripts/build/restore-packages.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +header "Restoring packages" +$DNX_ROOT/dnu restore "$REPOROOT/src" --quiet --runtime "$RID" --no-cache --parallel +$DNX_ROOT/dnu restore "$REPOROOT/test" --quiet --runtime "$RID" --no-cache --parallel +$DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet --runtime "$RID" --no-cache --parallel +set +e +$DNX_ROOT/dnu restore "$REPOROOT/testapp" --quiet --runtime "$RID" --no-cache --parallel >/dev/null 2>&1 +set -e diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh index af9d4c873..d0e3a01ef 100755 --- a/scripts/ci_build.sh +++ b/scripts/ci_build.sh @@ -10,11 +10,11 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$SCRIPT_DIR/_common.sh" +source "$SCRIPT_DIR/common/_common.sh" # Tell install scripts to skip pre-req check since the CI has the pre-reqs but not ldconfig it seems # Also, install to a directory under the repo root since we don't have permission to work elsewhere @@ -41,6 +41,7 @@ if [[ "$OSNAME" == "ubuntu" ]]; then export DOTNET_BUILD_CONTAINER_NAME="$container_name" export PACKAGE_IN_DOCKER="true" + unset BUILD_IN_DOCKER $SCRIPT_DIR/../build.sh $@ else diff --git a/scripts/common/_clang.sh b/scripts/common/_clang.sh new file mode 100644 index 000000000..f4e442d23 --- /dev/null +++ b/scripts/common/_clang.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# 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. +# + +# Set up the environment to be used for building with clang. +if which "clang-3.5" > /dev/null 2>&1; then + export CC="$(which clang-3.5)" + export CXX="$(which clang++-3.5)" +elif which "clang-3.6" > /dev/null 2>&1; then + export CC="$(which clang-3.6)" + export CXX="$(which clang++-3.6)" +elif which clang > /dev/null 2>&1; then + export CC="$(which clang)" + export CXX="$(which clang++)" +else + error "Unable to find Clang Compiler" + error "Install clang-3.5 or clang3.6" + exit 1 +fi diff --git a/scripts/_common.ps1 b/scripts/common/_common.ps1 similarity index 50% rename from scripts/_common.ps1 rename to scripts/common/_common.ps1 index adc30cbdd..512cd3970 100644 --- a/scripts/_common.ps1 +++ b/scripts/common/_common.ps1 @@ -3,17 +3,21 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # +. $PSScriptRoot\_utility.ps1 + $Rid = "win7-x64" $Tfm = "dnxcore50" - -$RepoRoot = Convert-Path "$PSScriptRoot\.." +$RepoRoot = Convert-Path "$PSScriptRoot\..\.." $OutputDir = "$RepoRoot\artifacts\$Rid" +$DnxDir = "$OutputDir\dnx" +$DnxRoot = "$DnxDir\bin" $Stage1Dir = "$OutputDir\stage1" $Stage2Dir = "$OutputDir\stage2" $HostDir = "$OutputDir\corehost" $PackageDir = "$RepoRoot\artifacts\packages\dnvm" -function header([string]$message) -{ - Write-Host -ForegroundColor Green "*** $message ***" -} +# Set reasonable defaults for unset variables +setEnvIfDefault "DOTNET_INSTALL_DIR" "$(Convert-Path "$PSScriptRoot\..")\.dotnet_stage0\win7-x64" +setEnvIfDefault "DOTNET_BUILD_VERSION" "0.1.0.0" +setPathAndHomeIfDefault "$Stage2Dir" +setEnvIfDefault "CONFIGURATION" "Debug" diff --git a/scripts/common/_common.sh b/scripts/common/_common.sh new file mode 100644 index 000000000..edc0c52cb --- /dev/null +++ b/scripts/common/_common.sh @@ -0,0 +1,34 @@ +# +# 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. +# + +COMMONSOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + COMMONDIR="$( cd -P "$( dirname "$COMMONSOURCE" )" && pwd )" + COMMONSOURCE="$(readlink "$COMMONSOURCE")" + [[ $COMMONSOURCE != /* ]] && COMMONSOURCE="$COMMONDIR/$COMMONSOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +COMMONDIR="$( cd -P "$( dirname "$COMMONSOURCE" )" && pwd )" + +source "$COMMONDIR/_clang.sh" +source "$COMMONDIR/_prettyprint.sh" +source "$COMMONDIR/_rid.sh" + +# TODO: Replace this with a dotnet generation +export TFM=dnxcore50 +export REPOROOT=$(cd $COMMONDIR/../.. && pwd) +export OUTPUT_ROOT=$REPOROOT/artifacts/$RID +export DNX_DIR=$OUTPUT_ROOT/dnx +export DNX_ROOT=$DNX_DIR/bin +export STAGE1_DIR=$OUTPUT_ROOT/stage1 +export STAGE2_DIR=$OUTPUT_ROOT/stage2 +export HOST_DIR=$OUTPUT_ROOT/corehost + +[ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$RID +[ -z "$DOTNET_BUILD_VERSION" ] && export DOTNET_BUILD_VERSION=0.1.0.0 +[ -z "$DOTNET_HOME" ] && export DOTNET_HOME=$STAGE2_DIR && export PATH=$STAGE2_DIR/bin:$PATH +[ -z "$CONFIGURATION" ] && export CONFIGURATION=Debug + +unset COMMONSOURCE +unset COMMONDIR diff --git a/scripts/_common.sh b/scripts/common/_prettyprint.sh similarity index 59% rename from scripts/_common.sh rename to scripts/common/_prettyprint.sh index 1f34df645..39ae58d4e 100644 --- a/scripts/_common.sh +++ b/scripts/common/_prettyprint.sh @@ -1,18 +1,9 @@ +#!/usr/bin/env bash # # 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. # -# Source this to add some fancy stuff to your scripts - -COMMONSOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - COMMONDIR="$( cd -P "$( dirname "$COMMONSOURCE" )" && pwd )" - COMMONSOURCE="$(readlink "$COMMONSOURCE")" - [[ $COMMONSOURCE != /* ]] && COMMONSOURCE="$COMMONDIR/$COMMONSOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -COMMONDIR="$( cd -P "$( dirname "$COMMONSOURCE" )" && pwd )" - # Detect build servers if [[ ! -z "$JENKINS_URL" || ! -z "$BUILD_BUILDID" ]]; then # Jenkins or VSO build, disable colors because they make things gross. @@ -69,36 +60,4 @@ die() local text=$1 error "$text" exit 1 -} - -export UNAME=$(uname) - -if [ -z "$RID" ]; then - if [ "$UNAME" == "Darwin" ]; then - export OSNAME=osx - export RID=osx.10.10-x64 - elif [ "$UNAME" == "Linux" ]; then - # Detect Distro - if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then - export OSNAME=ubuntu - export RID=ubuntu.14.04-x64 - elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then - export OSNAME=centos - export RID=centos.7.1-x64 - else - error "unknown Linux Distro" 1>&2 - fi - else - error "unknown OS: $UNAME" 1>&2 - exit 1 - fi -fi - -export REPOROOT=$(cd $COMMONDIR/.. && pwd) -export OUTPUT_ROOT=$REPOROOT/artifacts/$RID -export STAGE1_DIR=$OUTPUT_ROOT/stage1 -export STAGE2_DIR=$OUTPUT_ROOT/stage2 -export HOST_DIR=$OUTPUT_ROOT/corehost - -# TODO: Replace this with a dotnet generation -export TFM=dnxcore50 +} \ No newline at end of file diff --git a/scripts/common/_rid.sh b/scripts/common/_rid.sh new file mode 100644 index 000000000..273085f55 --- /dev/null +++ b/scripts/common/_rid.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# +# 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. +# + +export UNAME=$(uname) + +if [ -z "$RID" ]; then + if [ "$UNAME" == "Darwin" ]; then + export OSNAME=osx + if [ -n "$(sw_vers -productVersion | grep 10.10.)" ]; then + export RID=osx.10.10-x64 + elif [ -n "$(sw_vers -productVersion | grep 10.11.)" ]; then + export RID=osx.10.10-x64 + else + error "unknown OS X: $(sw_vers -productVersion)" 1>&2 + fi + elif [ "$UNAME" == "Linux" ]; then + # Detect Distro + if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then + export OSNAME=ubuntu + export RID=ubuntu.14.04-x64 + elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then + export OSNAME=centos + export RID=centos.7.1-x64 + else + error "unknown Linux Distro" 1>&2 + fi + else + error "unknown OS: $UNAME" 1>&2 + fi +fi + +if [ -z "$RID" ]; then + exit 1 +fi \ No newline at end of file diff --git a/scripts/common/_utility.ps1 b/scripts/common/_utility.ps1 new file mode 100644 index 000000000..4c151c1fb --- /dev/null +++ b/scripts/common/_utility.ps1 @@ -0,0 +1,63 @@ +# +# 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. +# + +function header([string]$message) +{ + Write-Host -ForegroundColor Green "*** $message ***" +} + +function info([string]$message) +{ + Write-Host -ForegroundColor Yellow "*** $message ***" +} + +function error([string]$message) +{ + Write-Host -ForegroundColor Red "$message" +} + +function setEnvIfDefault([string]$envVarName, [string]$value) +{ + If ([Environment]::GetEnvironmentVariable($envVarName) -eq $null) + { + [Environment]::SetEnvironmentVariable($envVarName, $value) + } +} + +function setPathAndHomeIfDefault([string]$rootPath) +{ + If ($env:DOTNET_HOME -eq $null) + { + $env:DOTNET_HOME=$rootPath + $env:PATH="$rootPath\bin;$env:PATH" + } +} + +function _([string]$command) +{ + & "$command" + if (!$?) { + error "Command Failed: '& $command'" + Exit 1 + } +} + +function _([string]$command, $arguments) +{ + & "$command" @arguments + if (!$?) { + error "Command Failed: '& $command'" + Exit 1 + } +} + +function _cmd([string]$command) +{ + cmd /c "$command" + if (!$?) { + error "Command Failed: 'cmd /c $command'" + Exit 1 + } +} \ No newline at end of file diff --git a/scripts/compile.ps1 b/scripts/compile.ps1 deleted file mode 100644 index ef324d74a..000000000 --- a/scripts/compile.ps1 +++ /dev/null @@ -1,188 +0,0 @@ -# -# 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]$Configuration = "Debug", - [switch]$Offline) - -$ErrorActionPreference="Stop" - -. $PSScriptRoot\_common.ps1 - -# Capture PATH for later -$StartPath = $env:PATH -$StartDotNetHome = $env:DOTNET_HOME - -function getDnx() -{ - $DnxPackage = "dnx-coreclr-win-x64.1.0.0-rc1-update1.nupkg" - $DnxVersion = "1.0.0-rc1-16231" - $DnxDir = "$OutputDir\dnx" - $DnxRoot = "$DnxDir/bin" - - # check if the required dnx version is already downloaded - if ((Test-Path "$DnxRoot\dnx.exe")) { - $dnxOut = & "$DnxRoot\dnx.exe" --version - - if ($dnxOut -Match $DnxVersion) { - Write-Host "Dnx version - $DnxVersion already downloaded." - return $DnxRoot - } - } - - # Download dnx to copy to stage2 - Remove-Item -Recurse -Force -ErrorAction Ignore $DnxDir - mkdir -Force "$DnxDir" | Out-Null - - Write-Host "Downloading Dnx version - $DnxVersion." - $DnxUrl="https://api.nuget.org/packages/$DnxPackage" - Invoke-WebRequest -UseBasicParsing "$DnxUrl" -OutFile "$DnxDir\dnx.zip" - - Add-Type -Assembly System.IO.Compression.FileSystem | Out-Null - [System.IO.Compression.ZipFile]::ExtractToDirectory("$DnxDir\dnx.zip", "$DnxDir") - return $DnxRoot -} - -try { - - # Check prereqs - if (!(Get-Command -ErrorAction SilentlyContinue cmake)) { - throw @" -cmake is required to build the native host 'corehost' -Download it from https://www.cmake.org -"@ - } - - if($Offline){ - Write-Host "Skipping Stage 0, Dnx, and Packages dowlnoad: Offline build" - } - else { - # Install a stage 0 - header "Installing dotnet stage 0" - & "$PSScriptRoot\install.ps1" - if (!$?) { - Write-Host "Command failed: $PSScriptRoot\install.ps1" - Exit 1 - } - - # Put stage 0 on the path - $DotNetTools = $env:DOTNET_INSTALL_DIR - if (!$DotNetTools) { - $DotNetTools = "$($env:LOCALAPPDATA)\Microsoft\dotnet" - } - - $DnxRoot = getDnx - - # Restore packages - header "Restoring packages" - & "$DnxRoot\dnu" restore "$RepoRoot\src" --quiet --runtime "$Rid" --no-cache - & "$DnxRoot\dnu" restore "$RepoRoot\test" --quiet --runtime "$Rid" --no-cache - & "$DnxRoot\dnu" restore "$RepoRoot\tools" --quiet --runtime "$Rid" --no-cache - - $oldErrorAction=$ErrorActionPreference - $ErrorActionPreference="SilentlyContinue" - & "$DnxRoot\dnu" restore "$RepoRoot\testapp" --quiet --runtime "$Rid" --no-cache 2>&1 | Out-Null - $ErrorActionPreference=$oldErrorAction - - if (!$?) { - Write-Host "Command failed: " "$DnxRoot\dnu" restore "$RepoRoot" --quiet --runtime "$Rid" --no-cache - Exit 1 - } - } - - header "Building corehost" - pushd "$RepoRoot\src\corehost" - try { - if (!(Test-Path "cmake\$Rid")) { - mkdir "cmake\$Rid" | Out-Null - } - cd "cmake\$Rid" - cmake ..\.. -G "Visual Studio 14 2015 Win64" - $pf = $env:ProgramFiles - if (Test-Path "env:\ProgramFiles(x86)") { - $pf = (cat "env:\ProgramFiles(x86)") - } - & "$pf\MSBuild\14.0\Bin\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration="$Configuration" - if (!$?) { - Write-Host "Command failed: $pf\MSBuild\14.0\Bin\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration="$Configuration" - Exit 1 - } - - if (!(Test-Path $HostDir)) { - mkdir $HostDir | Out-Null - } - cp "$RepoRoot\src\corehost\cmake\$Rid\$Configuration\corehost.exe" $HostDir - - if (Test-Path "$RepoRoot\src\corehost\cmake\$Rid\$Configuration\corehost.pdb") - { - cp "$RepoRoot\src\corehost\cmake\$Rid\$Configuration\corehost.pdb" $HostDir - } - } finally { - popd - } - - # Build Stage 1 - header "Building stage1 dotnet using downloaded stage0 ..." - & "$PSScriptRoot\build\build-stage.ps1" -Tfm:$Tfm -Rid:$Rid -Configuration:$Configuration -OutputDir:$Stage1Dir -RepoRoot:$RepoRoot -HostDir:$HostDir - if (!$?) { - Write-Host "Command failed: $PSScriptRoot\build\build-stage.ps1" -Tfm:$Tfm -Rid:$Rid -Configuration:$Configuration -OutputDir:$Stage1Dir -RepoRoot:$RepoRoot -HostDir:$HostDir - Exit 1 - } - - - # Build Stage 2 using Stage 1 - $env:PATH = "$Stage1Dir\bin;$StartPath" - header "Building stage2 dotnet using just-built stage1 ..." - & "$PSScriptRoot\build\build-stage.ps1" -Tfm:$Tfm -Rid:$Rid -Configuration:$Configuration -OutputDir:$Stage2Dir -RepoRoot:$RepoRoot -HostDir:$HostDir - if (!$?) { - Write-Host "Command failed: $PSScriptRoot\build\build-stage.ps1" -Tfm:$Tfm -Rid:$Rid -Configuration:$Configuration -OutputDir:$Stage2Dir -RepoRoot:$RepoRoot -HostDir:$HostDir - Exit 1 - } - - - # Crossgen Roslyn - header "Crossgening Roslyn compiler ..." - cmd /c "$PSScriptRoot\crossgen\crossgen_roslyn.cmd" "$Stage2Dir" - if (!$?) { - Write-Host "Command failed: " cmd /c "$PSScriptRoot\crossgen\crossgen_roslyn.cmd" "$Stage2Dir" - Exit 1 - } - - - # Copy dnx into stage 2 - cp -rec "$DnxRoot\" "$Stage2Dir\bin\dnx\" - - # Copy in the dotnet-restore script - cp "$PSScriptRoot\dotnet-restore.cmd" "$Stage2Dir\bin\dotnet-restore.cmd" - - # Copy in AppDeps - $env:PATH = "$Stage2Dir\bin;$StartPath" - header "Acquiring Native App Dependencies" - cmd /c "$PSScriptRoot\build\build_appdeps.cmd" "$Stage2Dir" - if (!$?) { - Write-Host "Command failed: " cmd /c "$PSScriptRoot\build\build_appdeps.cmd" "$Stage2Dir" - Exit 1 - } - - $env:DOTNET_HOME = "$Stage2Dir" - # Run tests on stage2 dotnet tools - & "$PSScriptRoot\test\runtests.ps1" - if (!$?) { - Write-Host "Command failed: $PSScriptRoot\test\runtests.ps1" - Exit 1 - } - - # Run Validation for Project.json dependencies - dotnet publish $RepoRoot\tools\MultiProjectValidator -o $Stage2Dir\..\tools - & "$Stage2Dir\..\tools\pjvalidate" "$RepoRoot\src" - # TODO For release builds, this should be uncommented and fail. - # if (!$?) { - # Write-Host "Project Validation Failed" - # Exit 1 - # } - -} finally { - $env:PATH = $StartPath - $env:DOTNET_HOME = $StartDotNetHome -} diff --git a/scripts/compile.sh b/scripts/compile.sh deleted file mode 100755 index 7070eef3d..000000000 --- a/scripts/compile.sh +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash -# -# 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. -# - -set -e - -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - -source "$DIR/_common.sh" - -getDnx() -{ - DNX_FEED="https://api.nuget.org/packages" - DNX_VERSION="1.0.0-rc1-update1" - DNX_DIR=$OUTPUT_ROOT/dnx - - if [ "$OSNAME" == "osx" ]; then - DNX_FLAVOR="dnx-coreclr-darwin-x64" - elif [ "$OSNAME" == "ubuntu" ]; then - DNX_FLAVOR="dnx-coreclr-linux-x64" - elif [ "$OSNAME" == "centos" ]; then - # No support dnx on redhat yet. - # using patched dnx - DNX_FEED="https://dotnetcli.blob.core.windows.net/dotnet/redhat_dnx" - DNX_VERSION="1.0.0-rc2-15000" - DNX_FLAVOR="dnx-coreclr-redhat-x64" - else - error "unknown OS: $OSNAME" 1>&2 - exit 1 - fi - - header "Downloading DNX $DNX_VERSION" - DNX_URL="$DNX_FEED/$DNX_FLAVOR.$DNX_VERSION.nupkg" - DNX_ROOT="$DNX_DIR/bin" - rm -rf $DNX_DIR - mkdir -p $DNX_DIR - curl -o $DNX_DIR/dnx.zip $DNX_URL --silent - unzip -qq $DNX_DIR/dnx.zip -d $DNX_DIR - chmod a+x $DNX_ROOT/dnu $DNX_ROOT/dnx -} - -if ! type -p cmake >/dev/null; then - error "cmake is required to build the native host 'corehost'" - error "OS X w/Homebrew: 'brew install cmake'" - error "Ubuntu: 'sudo apt-get install cmake'" - exit 1 -fi - -[ -z "$CONFIGURATION" ] && export CONFIGURATION=Debug - -if [[ ! -z "$OFFLINE" ]]; then - header "Skipping Stage 0, Dnx, and Packages download: Offline Build" -else - # Download DNX to copy into stage2 - getDnx - - # Ensure the latest stage0 is installed - $DIR/install.sh - - # And put the stage0 on the PATH - export PATH=$REPOROOT/artifacts/$RID/stage0/bin:$PATH - - # Intentionally clear the DOTNET_TOOLS path, we want to use the default installed version - unset DOTNET_TOOLS - - DOTNET_PATH=$(which dotnet) - PREFIX="$(cd -P "$(dirname "$DOTNET_PATH")/.." && pwd)" - - header "Restoring packages" - $DNX_ROOT/dnu restore "$REPOROOT/src" --quiet --runtime "$RID" --no-cache - $DNX_ROOT/dnu restore "$REPOROOT/test" --quiet --runtime "$RID" --no-cache - $DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet --runtime "$RID" --no-cache - set +e - $DNX_ROOT/dnu restore "$REPOROOT/testapp" --quiet --runtime "$RID" --no-cache >/dev/null 2>&1 - set -e -fi - -header "Building corehost" - -# Set up the environment to be used for building with clang. -if which "clang-3.5" > /dev/null 2>&1; then - export CC="$(which clang-3.5)" - export CXX="$(which clang++-3.5)" -elif which "clang-3.6" > /dev/null 2>&1; then - export CC="$(which clang-3.6)" - export CXX="$(which clang++-3.6)" -elif which clang > /dev/null 2>&1; then - export CC="$(which clang)" - export CXX="$(which clang++)" -else - error "Unable to find Clang Compiler" - error "Install clang-3.5 or clang3.6" - exit 1 -fi - -pushd "$REPOROOT/src/corehost" 2>&1 >/dev/null -[ -d "cmake/$RID" ] || mkdir -p "cmake/$RID" -cd "cmake/$RID" -cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=$CONFIGURATION -make - -# Publish to artifacts -[ -d "$HOST_DIR" ] || mkdir -p $HOST_DIR -cp "$REPOROOT/src/corehost/cmake/$RID/corehost" $HOST_DIR -popd 2>&1 >/dev/null - -# Build Stage 1 -header "Building stage1 dotnet using downloaded stage0 ..." -OUTPUT_DIR=$STAGE1_DIR $DIR/build/build-stage.sh - -# Use stage1 tools -export DOTNET_TOOLS=$STAGE1_DIR - -# Build Stage 2 -header "Building stage2 dotnet using just-built stage1 ..." -OUTPUT_DIR=$STAGE2_DIR $DIR/build/build-stage.sh - -echo "Crossgenning Roslyn compiler ..." -$REPOROOT/scripts/crossgen/crossgen_roslyn.sh "$STAGE2_DIR/bin" - -# Make Stage 2 Folder Accessible -chmod -R a+r $REPOROOT - -# Copy DNX in to stage2 -cp -R $DNX_ROOT $STAGE2_DIR/bin/dnx - -# Copy and CHMOD the dotnet-restore script -cp $DIR/dotnet-restore.sh $STAGE2_DIR/bin/dotnet-restore -chmod a+x $STAGE2_DIR/bin/dotnet-restore - -# No compile native support in centos yet -# https://github.com/dotnet/cli/issues/453 -if [ "$OSNAME" != "centos" ]; then - # Copy in AppDeps - header "Acquiring Native App Dependencies" - DOTNET_HOME=$STAGE2_DIR DOTNET_TOOLS=$STAGE2_DIR $REPOROOT/scripts/build/build_appdeps.sh "$STAGE2_DIR/bin" -fi - -# Stamp the output with the commit metadata -COMMIT_ID=$(git rev-parse HEAD) -echo $COMMIT_ID > $STAGE2_DIR/.commit - -# Skipping tests for centos -# tracked by issue - https://github.com/dotnet/corefx/issues/5066 -if [ "$OSNAME" != "centos" ]; then - # Run tests on the stage2 output - header "Testing stage2..." - DOTNET_HOME=$STAGE2_DIR DOTNET_TOOLS=$STAGE2_DIR $DIR/test/runtests.sh -fi - -# Run Validation for Project.json dependencies -dotnet publish "$REPOROOT/tools/MultiProjectValidator" -o "$STAGE2_DIR/../tools" -#TODO for release builds this should fail -set +e -"$STAGE2_DIR/../tools/pjvalidate" "$REPOROOT/src" -set -e diff --git a/scripts/compile/compile-corehost.ps1 b/scripts/compile/compile-corehost.ps1 new file mode 100644 index 000000000..d27564476 --- /dev/null +++ b/scripts/compile/compile-corehost.ps1 @@ -0,0 +1,37 @@ +# +# 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. +# + +. $PSScriptRoot\..\common\_common.ps1 + +header "Building corehost" +pushd "$RepoRoot\src\corehost" +try { + if (!(Test-Path "cmake\$Rid")) { + mkdir "cmake\$Rid" | Out-Null + } + cd "cmake\$Rid" + cmake ..\.. -G "Visual Studio 14 2015 Win64" + $pf = $env:ProgramFiles + if (Test-Path "env:\ProgramFiles(x86)") { + $pf = (cat "env:\ProgramFiles(x86)") + } + & "$pf\MSBuild\14.0\Bin\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration="$Configuration" + if (!$?) { + Write-Host "Command failed: $pf\MSBuild\14.0\Bin\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration="$Configuration" + Exit 1 + } + + if (!(Test-Path $HostDir)) { + mkdir $HostDir | Out-Null + } + cp "$RepoRoot\src\corehost\cmake\$Rid\$Configuration\corehost.exe" $HostDir + + if (Test-Path "$RepoRoot\src\corehost\cmake\$Rid\$Configuration\corehost.pdb") + { + cp "$RepoRoot\src\corehost\cmake\$Rid\$Configuration\corehost.pdb" $HostDir + } +} finally { + popd +} diff --git a/scripts/compile/compile-corehost.sh b/scripts/compile/compile-corehost.sh new file mode 100755 index 000000000..e90f8c9f5 --- /dev/null +++ b/scripts/compile/compile-corehost.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# 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. +# + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +header "Building corehost" + +pushd "$REPOROOT/src/corehost" 2>&1 >/dev/null +[ -d "cmake/$RID" ] || mkdir -p "cmake/$RID" +cd "cmake/$RID" +cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE:STRING=$CONFIGURATION +make + +# Publish to artifacts +[ -d "$HOST_DIR" ] || mkdir -p $HOST_DIR +cp "$REPOROOT/src/corehost/cmake/$RID/corehost" $HOST_DIR +popd 2>&1 >/dev/null diff --git a/scripts/compile/compile-stage-1.ps1 b/scripts/compile/compile-stage-1.ps1 new file mode 100644 index 000000000..7ee5cc7b1 --- /dev/null +++ b/scripts/compile/compile-stage-1.ps1 @@ -0,0 +1,17 @@ +# +# 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. +# + +. $PSScriptRoot\..\common\_common.ps1 + +header "Compiling stage1 dotnet using downloaded stage0 ..." +$StartPath = $env:PATH +$env:PATH = "$env:DOTNET_INSTALL_DIR\cli\bin;$StartPath" + +_ "$RepoRoot\scripts\compile\compile-stage.ps1" @("$Tfm","$Rid","$Configuration","$Stage1Dir","$RepoRoot","$HostDir") + +# Copy in the dotnet-restore script +cp "$RepoRoot\scripts\dotnet-restore.cmd" "$Stage1Dir\bin\dotnet-restore.cmd" + +$env:PATH=$StartPath \ No newline at end of file diff --git a/scripts/compile/compile-stage-1.sh b/scripts/compile/compile-stage-1.sh new file mode 100755 index 000000000..ce11e4690 --- /dev/null +++ b/scripts/compile/compile-stage-1.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +export StartPath=$PATH +export PATH=$DOTNET_INSTALL_DIR/bin:$PATH + +# Build Stage 1 +header "Building stage1 dotnet using downloaded stage0 ..." +OUTPUT_DIR=$STAGE1_DIR $REPOROOT/scripts/compile/compile-stage.sh + +export PATH=$StartPath \ No newline at end of file diff --git a/scripts/compile/compile-stage-2.ps1 b/scripts/compile/compile-stage-2.ps1 new file mode 100644 index 000000000..0c211c3c2 --- /dev/null +++ b/scripts/compile/compile-stage-2.ps1 @@ -0,0 +1,30 @@ +# +# 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. +# + +. $PSScriptRoot\..\common\_common.ps1 + +header "Compiling stage2 dotnet using stage1 ..." +$StartPath = $env:PATH +$env:PATH = "$Stage1Dir\bin;$env:PATH" + +# Compile +_ "$RepoRoot\scripts\compile\compile-stage.ps1" @("$Tfm","$Rid","$Configuration","$Stage2Dir","$RepoRoot","$HostDir") + +# Crossgen Roslyn +header "Crossgening Roslyn compiler ..." +_cmd "$RepoRoot\scripts\crossgen\crossgen_roslyn.cmd ""$Stage2Dir""" + +# Copy dnx into stage 2 +cp -rec "$DnxRoot\" "$Stage2Dir\bin\dnx\" + +# Copy in the dotnet-restore script +cp "$RepoRoot\scripts\dotnet-restore.cmd" "$Stage2Dir\bin\dotnet-restore.cmd" + +# Copy in AppDeps +$env:PATH = "$Stage2Dir\bin;$StartPath" +header "Acquiring Native App Dependencies" +_cmd "$RepoRoot\scripts\build\build_appdeps.cmd ""$Stage2Dir""" + +$env:PATH=$StartPath \ No newline at end of file diff --git a/scripts/compile/compile-stage-2.sh b/scripts/compile/compile-stage-2.sh new file mode 100755 index 000000000..df9e22c88 --- /dev/null +++ b/scripts/compile/compile-stage-2.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +# Use stage1 tools +export StartPath=$PATH +export DOTNET_TOOLS=$STAGE1_DIR +export PATH=$STAGE1_DIR/bin:$PATH + +# Build Stage 2 +header "Building stage2 dotnet using just-built stage1 ..." +OUTPUT_DIR=$STAGE2_DIR $REPOROOT/scripts/compile/compile-stage.sh + +echo "Crossgenning Roslyn compiler ..." +$REPOROOT/scripts/crossgen/crossgen_roslyn.sh "$STAGE2_DIR/bin" + +# Make Stage 2 Folder Accessible +chmod -R a+r $REPOROOT + +# Copy DNX in to stage2 +cp -R $DNX_ROOT $STAGE2_DIR/bin/dnx + +# Copy and CHMOD the dotnet-restore script +cp $REPOROOT/scripts/dotnet-restore.sh $STAGE2_DIR/bin/dotnet-restore +chmod a+x $STAGE2_DIR/bin/dotnet-restore + +# No compile native support in centos yet +# https://github.com/dotnet/cli/issues/453 +if [ "$OSNAME" != "centos" ]; then + # Copy in AppDeps + header "Acquiring Native App Dependencies" + DOTNET_HOME=$STAGE2_DIR DOTNET_TOOLS=$STAGE2_DIR $REPOROOT/scripts/build/build_appdeps.sh "$STAGE2_DIR/bin" +fi + +# Stamp the output with the commit metadata +COMMIT=$(git rev-parse HEAD) +echo $COMMIT > $STAGE2_DIR/.version +echo $DOTNET_BUILD_VERSION >> $STAGE2_DIR/.version + +export DOTNET_HOME=$STAGE2_DIR +export DOTNET_TOOLS=$STAGE2_DIR \ No newline at end of file diff --git a/scripts/build/build-stage.ps1 b/scripts/compile/compile-stage.ps1 similarity index 100% rename from scripts/build/build-stage.ps1 rename to scripts/compile/compile-stage.ps1 index 94380d80e..076614056 100644 --- a/scripts/build/build-stage.ps1 +++ b/scripts/compile/compile-stage.ps1 @@ -13,8 +13,8 @@ param( $Projects = @( "Microsoft.DotNet.Cli", - "Microsoft.DotNet.Tools.Compiler", "Microsoft.DotNet.Tools.Builder", + "Microsoft.DotNet.Tools.Compiler", "Microsoft.DotNet.Tools.Compiler.Csc", "Microsoft.DotNet.Tools.Compiler.Fsc", "Microsoft.DotNet.Tools.Compiler.Native", diff --git a/scripts/build/build-stage.sh b/scripts/compile/compile-stage.sh similarity index 87% rename from scripts/build/build-stage.sh rename to scripts/compile/compile-stage.sh index b92e079d4..c83ce1657 100755 --- a/scripts/build/build-stage.sh +++ b/scripts/compile/compile-stage.sh @@ -10,12 +10,11 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$( cd -P "$DIR/../.." && pwd )" -source "$DIR/../_common.sh" +source "$DIR/../common/_common.sh" [ ! -z "$TFM" ] || die "Missing required environment variable TFM" [ ! -z "$RID" ] || die "Missing required environment variable RID" @@ -25,8 +24,8 @@ source "$DIR/../_common.sh" PROJECTS=( \ Microsoft.DotNet.Cli \ - Microsoft.DotNet.Tools.Compiler \ Microsoft.DotNet.Tools.Builder \ + Microsoft.DotNet.Tools.Compiler \ Microsoft.DotNet.Tools.Compiler.Csc \ Microsoft.DotNet.Tools.Compiler.Fsc \ Microsoft.DotNet.Tools.Compiler.Native \ @@ -61,6 +60,7 @@ 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 --framework "$TFM" --runtime "$RID" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project" done @@ -90,4 +90,4 @@ cd $OUTPUT_DIR # Fix up permissions. Sometimes they get dropped with the wrong info find . -type f | xargs chmod 644 -$DIR/fix-mode-flags.sh +$REPOROOT/scripts/build/fix-mode-flags.sh diff --git a/scripts/compile/compile.ps1 b/scripts/compile/compile.ps1 new file mode 100644 index 000000000..30a96ce5c --- /dev/null +++ b/scripts/compile/compile.ps1 @@ -0,0 +1,26 @@ +# +# 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]$Configuration = "Debug", + [switch]$Offline) + +$ErrorActionPreference="Stop" + +. $PSScriptRoot\..\common\_common.ps1 + +# Capture PATH for later +$StartPath = $env:PATH +$StartDotNetHome = $env:DOTNET_HOME + +try { + _ "$RepoRoot\scripts\compile\compile-corehost.ps1" + + _ "$RepoRoot\scripts\compile\compile-stage-1.ps1" + + _ "$RepoRoot\scripts\compile\compile-stage-2.ps1" +} finally { + $env:PATH = $StartPath + $env:DOTNET_HOME = $StartDotNetHome +} diff --git a/scripts/compile/compile.sh b/scripts/compile/compile.sh new file mode 100755 index 000000000..bb66a4170 --- /dev/null +++ b/scripts/compile/compile.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +$REPOROOT/scripts/compile/compile-corehost.sh + +$REPOROOT/scripts/compile/compile-stage-1.sh + +$REPOROOT/scripts/compile/compile-stage-2.sh \ No newline at end of file diff --git a/scripts/dev-dotnet.ps1 b/scripts/dev-dotnet.ps1 index bd53ad84e..8b5f1290f 100644 --- a/scripts/dev-dotnet.ps1 +++ b/scripts/dev-dotnet.ps1 @@ -1,3 +1,8 @@ +# +# 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. +# + $oldPath = $env:PATH try { # Put the stage2 output on the front of the path diff --git a/scripts/dev-dotnet.sh b/scripts/dev-dotnet.sh index 12bab2731..e7d8e6eac 100755 --- a/scripts/dev-dotnet.sh +++ b/scripts/dev-dotnet.sh @@ -10,12 +10,11 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$( cd -P "$DIR/.." && pwd )" -source "$DIR/_common.sh" +source "$DIR/common/_common.sh" if [ -d "$STAGE2_DIR" ]; then PATH=$STAGE2_DIR/bin:$PATH diff --git a/scripts/docker/dockerbuild.sh b/scripts/docker/dockerbuild.sh index 423231eb3..bcee32e24 100755 --- a/scripts/docker/dockerbuild.sh +++ b/scripts/docker/dockerbuild.sh @@ -10,13 +10,13 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source $DIR/../_common.sh +source "$DIR/../common/_common.sh" -cd $DIR/../.. +cd $REPOROOT [ -z "$DOTNET_BUILD_CONTAINER_TAG" ] && DOTNET_BUILD_CONTAINER_TAG="dotnetcli-build" [ -z "$DOTNET_BUILD_CONTAINER_NAME" ] && DOTNET_BUILD_CONTAINER_NAME="dotnetcli-build-container" diff --git a/scripts/docker/dockerrun.sh b/scripts/docker/dockerrun.sh index 948802115..d388d0b1b 100755 --- a/scripts/docker/dockerrun.sh +++ b/scripts/docker/dockerrun.sh @@ -8,13 +8,13 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../_common.sh" -cd $DIR/../.. +cd $REPOROOT [ -z "$DOTNET_BUILD_CONTAINER_TAG" ] && DOTNET_BUILD_CONTAINER_TAG="dotnetcli-build" [ -z "$DOTNET_BUILD_CONTAINER_NAME" ] && DOTNET_BUILD_CONTAINER_NAME="dotnetcli-build-container" diff --git a/scripts/docker/windows_dockerbuild.sh b/scripts/docker/windows_dockerbuild.sh index 76bb31785..960740dbc 100755 --- a/scripts/docker/windows_dockerbuild.sh +++ b/scripts/docker/windows_dockerbuild.sh @@ -13,7 +13,7 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" diff --git a/scripts/dotnet-restore.sh b/scripts/dotnet-restore.sh index ef24cf8c6..c54ee868f 100644 --- a/scripts/dotnet-restore.sh +++ b/scripts/dotnet-restore.sh @@ -10,7 +10,7 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" diff --git a/scripts/obtain/install-dnx.ps1 b/scripts/obtain/install-dnx.ps1 new file mode 100644 index 000000000..8d1ecafd5 --- /dev/null +++ b/scripts/obtain/install-dnx.ps1 @@ -0,0 +1,36 @@ +# +# 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. +# + +. $PSScriptRoot\..\common\_common.ps1 + +$DnxPackage = "dnx-coreclr-win-x64.1.0.0-rc1-update1.nupkg" +$DnxVersion = "1.0.0-rc1-16231" + +$doInstall = $true + +# check if the required dnx version is already downloaded +if ((Test-Path "$DnxRoot\dnx.exe")) { + $dnxOut = & "$DnxRoot\dnx.exe" --version + + if ($dnxOut -Match $DnxVersion) { + Write-Host "Dnx version - $DnxVersion already downloaded." + + $doInstall = $false + } +} + +if ($doInstall) +{ + # Download dnx to copy to stage2 + Remove-Item -Recurse -Force -ErrorAction Ignore $DnxDir + mkdir -Force "$DnxDir" | Out-Null + + Write-Host "Downloading Dnx version - $DnxVersion." + $DnxUrl="https://api.nuget.org/packages/$DnxPackage" + Invoke-WebRequest -UseBasicParsing "$DnxUrl" -OutFile "$DnxDir\dnx.zip" + + Add-Type -Assembly System.IO.Compression.FileSystem | Out-Null + [System.IO.Compression.ZipFile]::ExtractToDirectory("$DnxDir\dnx.zip", "$DnxDir") +} \ No newline at end of file diff --git a/scripts/obtain/install-dnx.sh b/scripts/obtain/install-dnx.sh new file mode 100755 index 000000000..907455fcd --- /dev/null +++ b/scripts/obtain/install-dnx.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +say() { + printf "%b\n" "dotnet_install_dnx: $1" +} + +doInstall=true + +DNX_FEED="https://api.nuget.org/packages" +DNX_PACKAGE_VERSION="1.0.0-rc1-update1" +DNX_VERSION="1.0.0-rc1-16231" + +if [ "$OSNAME" == "osx" ]; then + DNX_FLAVOR="dnx-coreclr-darwin-x64" +elif [ "$OSNAME" == "ubuntu" ]; then + DNX_FLAVOR="dnx-coreclr-linux-x64" +elif [ "$OSNAME" == "centos" ]; then + # No support dnx on redhat yet. + # using patched dnx + DNX_FEED="https://dotnetcli.blob.core.windows.net/dotnet/redhat_dnx" + DNX_PACKAGE_VERSION="1.0.0-rc2-15000" + DNX_VERSION="1.0.0-rc2-15000" + DNX_FLAVOR="dnx-coreclr-redhat-x64" +else + error "unknown OS: $OSNAME" 1>&2 + exit 1 +fi + +DNX_URL="$DNX_FEED/$DNX_FLAVOR.$DNX_PACKAGE_VERSION.nupkg" + +say "Preparing to install DNX to $DNX_DIR" +say "Requested Version: $DNX_VERSION" + +if [ -e "$DNX_ROOT/dnx" ] ; then + dnxOut=`$DNX_ROOT/dnx --version | grep '^ Version: ' | awk '{ print $2; }'` + + say "Local Version: $dnxOut" + + if [ $dnxOut = $DNX_VERSION ] ; then + say "You already have the requested version." + + doInstall=false + fi +else + say "Local Version: Not Installed" +fi + +if [ $doInstall = true ] ; then + rm -rf $DNX_DIR + + mkdir -p $DNX_DIR + curl -o $DNX_DIR/dnx.zip $DNX_URL --silent + unzip -qq $DNX_DIR/dnx.zip -d $DNX_DIR + chmod a+x $DNX_ROOT/dnu $DNX_ROOT/dnx +fi \ No newline at end of file diff --git a/scripts/obtain/install-tools.ps1 b/scripts/obtain/install-tools.ps1 new file mode 100644 index 000000000..8a01def34 --- /dev/null +++ b/scripts/obtain/install-tools.ps1 @@ -0,0 +1,23 @@ +# +# 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. +# + +. $PSScriptRoot\..\common\_common.ps1 + +# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot +if (!(Test-Path $env:DOTNET_INSTALL_DIR)) +{ + mkdir $env:DOTNET_INSTALL_DIR | Out-Null +} + +# Install a stage 0 +header "Installing dotnet stage 0" +_ "$RepoRoot\scripts\obtain\install.ps1" + +# Put stage0 on the PATH +$env:PATH = "$env:DOTNET_INSTALL_DIR\cli\bin;$env:PATH" + +# Download dnx to copy to stage2 +header "Downloading DNX $DnxVersion" +_ "$RepoRoot\scripts\obtain\install-dnx.ps1" \ No newline at end of file diff --git a/scripts/obtain/install-tools.sh b/scripts/obtain/install-tools.sh new file mode 100755 index 000000000..ed4ac913c --- /dev/null +++ b/scripts/obtain/install-tools.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot +[ -d $DOTNET_INSTALL_DIR ] || mkdir -p $DOTNET_INSTALL_DIR + +# Ensure the latest stage0 is installed +header "Installing dotnet stage 0" +$REPOROOT/scripts/obtain/install.sh + +# Put the stage0 on the PATH +export PATH=$REPOROOT/artifacts/$RID/stage0/bin:$PATH + +# Download DNX to copy into stage2 +header "Downloading DNX $DNX_VERSION" +$REPOROOT/scripts/obtain/install-dnx.sh diff --git a/scripts/install.ps1 b/scripts/obtain/install.ps1 similarity index 100% rename from scripts/install.ps1 rename to scripts/obtain/install.ps1 diff --git a/scripts/install.sh b/scripts/obtain/install.sh similarity index 98% rename from scripts/install.sh rename to scripts/obtain/install.sh index 87f292189..a5c19042e 100755 --- a/scripts/install.sh +++ b/scripts/obtain/install.sh @@ -16,7 +16,7 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" diff --git a/scripts/package/package-debian.sh b/scripts/package/package-debian.sh index 26224a62b..50c8b9252 100755 --- a/scripts/package/package-debian.sh +++ b/scripts/package/package-debian.sh @@ -12,11 +12,11 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$DIR/../_common.sh" +source "$DIR/../common/_common.sh" if [ "$UNAME" != "Linux" ]; then error "Debian Package build only supported on Linux" diff --git a/scripts/package/package-dnvm.sh b/scripts/package/package-dnvm.sh index 64cf182b8..aa873e725 100755 --- a/scripts/package/package-dnvm.sh +++ b/scripts/package/package-dnvm.sh @@ -8,20 +8,11 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$DIR/../_common.sh" - -REPOROOT="$( cd -P "$DIR/../.." && pwd )" - -if [ -z "$DOTNET_BUILD_VERSION" ]; then - TIMESTAMP=$(date "+%Y%m%d%H%M%S") - DOTNET_BUILD_VERSION=0.0.1-alpha-t$TIMESTAMP -fi - -STAGE2_DIR=$REPOROOT/artifacts/$RID/stage2 +source "$DIR/../common/_common.sh" if [ ! -d "$STAGE2_DIR" ]; then error "missing stage2 output in $STAGE2_DIR" 1>&2 @@ -44,4 +35,4 @@ tar -czf $PACKAGE_NAME * .version info "Packaged stage2 to $PACKAGE_NAME" -$DIR/../publish/publish.sh $PACKAGE_NAME +$REPOROOT/scripts/publish/publish.sh $PACKAGE_NAME diff --git a/scripts/package/package-native.sh b/scripts/package/package-native.sh new file mode 100755 index 000000000..f62754e8e --- /dev/null +++ b/scripts/package/package-native.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +if [[ "$OSNAME" == "ubuntu" ]]; then + # Create Debian package + $REPOROOT/scripts/package/package-debian.sh +elif [[ "$OSNAME" == "osx" ]]; then + # Create OSX PKG + $REPOROOT/packaging/osx/package-osx.sh +fi diff --git a/scripts/package/package.ps1 b/scripts/package/package.ps1 index 3b752a500..0436afa14 100644 --- a/scripts/package/package.ps1 +++ b/scripts/package/package.ps1 @@ -3,7 +3,7 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # -. "$PSScriptRoot\..\_common.ps1" +. "$PSScriptRoot\..\common\_common.ps1" if(!(Test-Path $PackageDir)) { mkdir $PackageDir | Out-Null diff --git a/scripts/package/package.sh b/scripts/package/package.sh index 4bd24f349..40d9f9074 100755 --- a/scripts/package/package.sh +++ b/scripts/package/package.sh @@ -4,38 +4,42 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # -set -e - SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$( cd -P "$DIR/../.." && pwd )" -source "$DIR/../_common.sh" - -echo "Starting packaging" +source "$DIR/../common/_common.sh" if [ -z "$DOTNET_BUILD_VERSION" ]; then TIMESTAMP=$(date "+%Y%m%d%H%M%S") - export DOTNET_BUILD_VERSION=0.0.1-alpha-t$TIMESTAMP - echo "Version: $DOTNET_BUILD_VERSION" + DOTNET_BUILD_VERSION=0.0.1-alpha-t$TIMESTAMP fi -COMMIT=$(git rev-parse HEAD) -echo $COMMIT > $STAGE2_DIR/.version -echo $DOTNET_BUILD_VERSION >> $STAGE2_DIR/.version +STAGE2_DIR=$REPOROOT/artifacts/$RID/stage2 -# Create Dnvm Package -$DIR/package-dnvm.sh - -if [[ "$OSNAME" == "ubuntu" ]]; then - # Create Debian package - $DIR/package-debian.sh -elif [[ "$OSNAME" == "osx" ]]; then - # Create OSX PKG - $DIR/../../packaging/osx/package-osx.sh +if [ ! -d "$STAGE2_DIR" ]; then + error "missing stage2 output in $STAGE2_DIR" 1>&2 + exit fi + +PACKAGE_DIR=$REPOROOT/artifacts/packages/dnvm +[ -d "$PACKAGE_DIR" ] || mkdir -p $PACKAGE_DIR + +PACKAGE_SHORT_NAME=dotnet-${OSNAME}-x64.${DOTNET_BUILD_VERSION} +PACKAGE_NAME=$PACKAGE_DIR/${PACKAGE_SHORT_NAME}.tar.gz + +cd $STAGE2_DIR + +header "Packaging $PACKAGE_SHORT_NAME" + +# Tar up the stage2 artifacts +# We need both "*" and ".version" to ensure we pick up that file +tar -czf $PACKAGE_NAME * .version + +info "Packaged stage2 to $PACKAGE_NAME" + +$REPOROOT/scripts/publish/publish.sh $PACKAGE_NAME diff --git a/scripts/publish/publish.ps1 b/scripts/publish/publish.ps1 index 82604c7a1..10328d12e 100644 --- a/scripts/publish/publish.ps1 +++ b/scripts/publish/publish.ps1 @@ -4,7 +4,7 @@ # param( - [string]$file = $(throw "Specify the full path to the file to be uploaded") + [Parameter(Mandatory=$true)][string]$file ) function CheckRequiredVariables diff --git a/scripts/publish/publish.sh b/scripts/publish/publish.sh index 5d8100fd2..574c63b47 100755 --- a/scripts/publish/publish.sh +++ b/scripts/publish/publish.sh @@ -16,12 +16,13 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done -SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -REPOROOT="$( cd -P "$SCRIPT_DIR/../.." && pwd )" +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$SCRIPT_DIR/../_common.sh" +source "$DIR/../common/_common.sh" + +SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" UPLOAD_FILE=$1 UPLOAD_JSON_FILE="package_upload.json" diff --git a/scripts/test/check-prereqs.ps1 b/scripts/test/check-prereqs.ps1 new file mode 100644 index 000000000..21a65b988 --- /dev/null +++ b/scripts/test/check-prereqs.ps1 @@ -0,0 +1,11 @@ +# +# 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. +# + +if (!(Get-Command -ErrorAction SilentlyContinue cmake)) { + throw @" +cmake is required to build the native host 'corehost' +Download it from https://www.cmake.org +"@ +} \ No newline at end of file diff --git a/scripts/test/check-prereqs.sh b/scripts/test/check-prereqs.sh new file mode 100755 index 000000000..1101a6afe --- /dev/null +++ b/scripts/test/check-prereqs.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# +# 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. +# + +if ! type -p cmake >/dev/null; then + error "cmake is required to build the native host 'corehost'" + error "OS X w/Homebrew: 'brew install cmake'" + error "Ubuntu: 'sudo apt-get install cmake'" + exit 1 +fi \ No newline at end of file diff --git a/scripts/test/runtests.ps1 b/scripts/test/runtests.ps1 index a7f9b05c8..f04b9b658 100644 --- a/scripts/test/runtests.ps1 +++ b/scripts/test/runtests.ps1 @@ -3,7 +3,7 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # -. "$PSScriptRoot\..\_common.ps1" +. "$PSScriptRoot\..\common\_common.ps1" $TestBinRoot = "$RepoRoot\artifacts\tests" diff --git a/scripts/test/runtests.sh b/scripts/test/runtests.sh index 7a8726a88..666f0d541 100755 --- a/scripts/test/runtests.sh +++ b/scripts/test/runtests.sh @@ -10,12 +10,11 @@ SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$DIR/../_common.sh" - +source "$DIR/../common/_common.sh" TestBinRoot="$REPOROOT/artifacts/tests" diff --git a/scripts/test/validate-dependencies.ps1 b/scripts/test/validate-dependencies.ps1 new file mode 100644 index 000000000..8a9a5df2d --- /dev/null +++ b/scripts/test/validate-dependencies.ps1 @@ -0,0 +1,15 @@ +# +# 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. +# + +. "$PSScriptRoot\..\common\_common.ps1" + +# Run Validation for Project.json dependencies +dotnet publish $RepoRoot\tools\MultiProjectValidator -o $Stage2Dir\..\tools +& "$Stage2Dir\..\tools\pjvalidate" "$RepoRoot\src" +# TODO For release builds, this should be uncommented and fail. +# if (!$?) { +# Write-Host "Project Validation Failed" +# Exit 1 +# } \ No newline at end of file diff --git a/scripts/test/validate-dependencies.sh b/scripts/test/validate-dependencies.sh new file mode 100755 index 000000000..bf5c1ab65 --- /dev/null +++ b/scripts/test/validate-dependencies.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +# Run Validation for Project.json dependencies +dotnet publish "$REPOROOT/tools/MultiProjectValidator" -o "$STAGE2_DIR/../tools" +#TODO for release builds this should fail +set +e +"$STAGE2_DIR/../tools/pjvalidate" "$REPOROOT/src" +set -e diff --git a/scripts/unuse-dev.ps1 b/scripts/unuse-dev.ps1 index eefd11bc6..fbf5f4c18 100644 --- a/scripts/unuse-dev.ps1 +++ b/scripts/unuse-dev.ps1 @@ -1,3 +1,8 @@ +# +# 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. +# + # Remove the stage2 output from the path $splat = $env:PATH.Split(";") $stripped = @($splat | where { $_ -notlike "*artifacts\win7-x64\stage2*" }) diff --git a/scripts/use-dev.ps1 b/scripts/use-dev.ps1 index 93a549810..b255979c7 100644 --- a/scripts/use-dev.ps1 +++ b/scripts/use-dev.ps1 @@ -1,3 +1,8 @@ +# +# 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. +# + # Put the stage2 output on the front of the path $stage2 = "$PSScriptRoot\..\artifacts\win7-x64\stage2\bin" if (Test-Path $stage2) { diff --git a/src/Microsoft.DotNet.Tools.Run/project.json b/src/Microsoft.DotNet.Tools.Run/project.json index 3e306f69c..6471efd27 100644 --- a/src/Microsoft.DotNet.Tools.Run/project.json +++ b/src/Microsoft.DotNet.Tools.Run/project.json @@ -1,4 +1,4 @@ -{ +{ "name": "dotnet-run", "version": "1.0.0-*", "compilationOptions": {