Skip to content

Commit

Permalink
Add build/test environment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dsplaisted committed Sep 14, 2017
1 parent ebbf880 commit 2955e55
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build/sdk-build-env.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo off

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.

REM Get normalized version of parent path
for %%i in (%~dp0..\) DO (
SET SDK_REPO_ROOT=%%~dpi
)

title SDK Build (%SDK_REPO_ROOT%)
set PATH=%SDK_REPO_ROOT%.dotnet_cli;%PATH%
set /P SDK_CLI_VERSION=<%SDK_REPO_ROOT%DotnetCLIVersion.txt
rem set DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=%SDK_REPO_ROOT%.dotnet_cli\sdk\%SDK_CLI_VERSION%\Sdks
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set DOTNET_MULTILEVEL_LOOKUP=0

set NUGET_PACKAGES=%SDK_REPO_ROOT%packages
23 changes: 23 additions & 0 deletions build/sdk-build-env.sh
Original file line number Diff line number Diff line change
@@ -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.
#

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

REPO_ROOT="$( cd -P "$( dirname "$SOURCE" )/../" && pwd )"

STAGE0_DIR=$REPO_ROOT/.dotnet_cli
export PATH=$STAGE0_DIR:$PATH


export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_MULTILEVEL_LOOKUP=0

export NUGET_PACKAGES=$REPO_ROOT/packages
22 changes: 22 additions & 0 deletions build/sdk-test-env.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@echo off

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.

REM Get normalized version of parent path
for %%i in (%~dp0..\) DO (
SET SDK_REPO_ROOT=%%~dpi
)

title SDK Test (%SDK_REPO_ROOT%)
set DOTNET_MULTILEVEL_LOOKUP=0
set PATH=%SDK_REPO_ROOT%.dotnet_cli;%PATH%
set NUGET_PACKAGES=%SDK_REPO_ROOT%packages
set /P SDK_CLI_VERSION=<%SDK_REPO_ROOT%DotnetCLIVersion.txt
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set MSBuildSDKsPath=%SDK_REPO_ROOT%bin\Debug\Sdks
set DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=%SDK_REPO_ROOT%bin\Debug\Sdks
set NETCoreSdkBundledVersionsProps=%SDK_REPO_ROOT%.dotnet_cli\sdk\%SDK_CLI_VERSION%\Microsoft.NETCoreSdk.BundledVersions.props
set CustomAfterMicrosoftCommonTargets=%SDK_REPO_ROOT%bin\Debug\Sdks\Microsoft.NET.Build.Extensions\msbuildExtensions-ver\Microsoft.Common.Targets\ImportAfter\Microsoft.NET.Build.Extensions.targets
set MicrosoftNETBuildExtensionsTargets=%SDK_REPO_ROOT%bin\Debug\Sdks\Microsoft.NET.Build.Extensions\msbuildExtensions\Microsoft\Microsoft.NET.Build.Extensions\Microsoft.NET.Build.Extensions.targets
rem You also need to add https://dotnet.myget.org/F/dotnet-core/api/v3/index.json to your NuGet feeds if building projects outside the SDK cone
27 changes: 27 additions & 0 deletions build/sdk-test-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/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

REPO_ROOT="$( cd -P "$( dirname "$SOURCE" )/../" && pwd )"

STAGE0_DIR=$REPO_ROOT/.dotnet_cli
SDK_CLI_VERSION="$( cat $REPO_ROOT/DotnetCLIVersion.txt )"

export DOTNET_MULTILEVEL_LOOKUP=0
export PATH=$STAGE0_DIR:$PATH
export NUGET_PACKAGES=$REPO_ROOT/packages
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export MSBuildSDKsPath=$REPO_ROOT/bin/Debug/Sdks
export DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=$REPO_ROOT/bin/Debug/Sdks
export NETCoreSdkBundledVersionsProps=$REPO_ROOT/.dotnet_cli/sdk/%SDK_CLI_VERSION%/Microsoft.NETCoreSdk.BundledVersions.props
export CustomAfterMicrosoftCommonTargets=$REPO_ROOT/bin/Debug/Sdks/Microsoft.NET.Build.Extensions/msbuildExtensions-ver/Microsoft.Common.Targets/ImportAfter/Microsoft.NET.Build.Extensions.targets
export MicrosoftNETBuildExtensionsTargets=$REPO_ROOT/bin/Debug/Sdks/Microsoft.NET.Build.Extensions/msbuildExtensions/Microsoft/Microsoft.NET.Build.Extensions/Microsoft.NET.Build.Extensions.targets

0 comments on commit 2955e55

Please sign in to comment.