Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ project.json text
*.sql text
*.vb text

# Unix artifacts
*.sh text eol=lf

# Visual Studio artifacts
*.csproj text eol=crlf
*.dbproj text eol=crlf
Expand All @@ -67,4 +70,4 @@ project.json text
*.jpg binary
*.png binary
*.gif binary
*.zip binary
*.zip binary
73 changes: 58 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,67 @@ echo "Installing dotnet CLI"
mkdir -p cli
curl -o cli/dotnet-install.sh -L https://dot.net/v1/dotnet-install.sh

if (( $? )); then
echo "Could not download 'dotnet-install.sh' script. Please check your network and try again!"
exit 1
fi

# Run install.sh for cli
chmod +x cli/dotnet-install.sh

# v1 needed for some test and bootstrapping testing version
cli/dotnet-install.sh -i cli -c 1.0
# Get recommended version for bootstrapping testing version
cli/dotnet-install.sh -i cli -c 2.2 -nopath

DOTNET="$(pwd)/cli/dotnet"
if (( $? )); then
echo "The .NET CLI Install failed!!"
exit 1
fi

echo "$DOTNET msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting"
# Disable .NET CLI Install Lookup
DOTNET_MULTILEVEL_LOOKUP=0

# run it twice so dotnet cli can expand and decompress without affecting the result of the target
$DOTNET msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting
DOTNET_BRANCH="$($DOTNET msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting)"
DOTNET="$(pwd)/cli/dotnet"

echo $DOTNET_BRANCH
cli/dotnet-install.sh -i cli -c $DOTNET_BRANCH
# Let the dotnet cli expand and decompress first if it's a first-run
$DOTNET --info

# Get CLI Branches for testing
echo "dotnet msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting"

IFS=$'\n'
CMD_OUT_LINES=(`dotnet msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting`)
# Take only last the line which has the version information and strip all the spaces
DOTNET_BRANCHES=${CMD_OUT_LINES[-1]//[[:space:]]}
unset IFS

IFS=$';'
for DOTNET_BRANCH in ${DOTNET_BRANCHES[@]}
do
echo $DOTNET_BRANCH

IFS=$':'
ChannelAndVersion=($DOTNET_BRANCH)
Channel=${ChannelAndVersion[0]}
if [ ${#ChannelAndVersion[@]} -eq 1 ]
then
Version="latest"
else
Version=${ChannelAndVersion[1]}
fi
unset IFS

echo "Channel is: $Channel"
echo "Version is: $Version"
cli/dotnet-install.sh -i cli -c $Channel -v $Version -nopath

if (( $? )); then
echo "The .NET CLI Install for $DOTNET_BRANCH failed!!"
exit 1
fi
done

# Display current version
$DOTNET --version
# Display .NET CLI info
$DOTNET --info

echo "================="

Expand All @@ -52,16 +94,17 @@ then
fi

# restore packages
echo "$DOTNET msbuild build/build.proj /t:Restore /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta"
$DOTNET msbuild build/build.proj /t:Restore /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta
echo "dotnet msbuild build/build.proj /t:Restore /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta"
dotnet msbuild build/build.proj /t:Restore /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta

if [ $? -ne 0 ]; then
echo "Restore failed!!"
exit 1
fi

# run tests
echo "$DOTNET msbuild build/build.proj /t:CoreUnitTests /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta"
$DOTNET msbuild build/build.proj /t:CoreUnitTests /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta
echo "dotnet msbuild build/build.proj /t:CoreUnitTests /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta"
dotnet msbuild build/build.proj /t:CoreUnitTests /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta

if [ $? -ne 0 ]; then
echo "Tests failed!!"
Expand Down
8 changes: 5 additions & 3 deletions build/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ Function Install-DotnetCLI {
)
$vsMajorVersion = Get-VSMajorVersion
$MSBuildExe = Get-MSBuildExe $vsMajorVersion
$CliBranchListForTesting = & $msbuildExe $NuGetClientRoot\build\config.props /v:m /nologo /t:GetCliBranchForTesting
$CliBranchList = $CliBranchListForTesting.Trim().Split(';');

$CmdOutLines = ((& $msbuildExe $NuGetClientRoot\build\config.props /v:m /nologo /t:GetCliBranchForTesting) | Out-String).Trim()
$CliBranchListForTesting = ($CmdOutLines -split [Environment]::NewLine)[-1]
$CliBranchList = $CliBranchListForTesting -split ';'

$DotNetInstall = Join-Path $CLIRoot 'dotnet-install.ps1'

Expand All @@ -171,7 +173,7 @@ Function Install-DotnetCLI {

ForEach ($CliBranch in $CliBranchList) {
$CliBranch = $CliBranch.trim()
$CliChannelAndVersion = $CliBranch -split "\s+"
$CliChannelAndVersion = $CliBranch -split ":"

$Channel = $CliChannelAndVersion[0].trim()
if ($CliChannelAndVersion.count -eq 1) {
Expand Down
2 changes: 1 addition & 1 deletion build/config.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<!-- Specifies the SDK version to download to use for testing. The first value represents the channel, the second value represents the exact SDK version to be download. If a version is not specified, the latest version from the channel will be downloaded.
Note that multiple SDKs can be downloaded by using `;` as a separator.
-->
<CliBranchForTesting Condition="'$(CliBranchForTesting)' == ''">release/5.0.2xx 5.0.200-servicing.21120.4</CliBranchForTesting>
<CliBranchForTesting Condition="'$(CliBranchForTesting)' == ''">release/5.0.2xx:5.0.200-servicing.21120.4</CliBranchForTesting>
</PropertyGroup>

<!-- Config -->
Expand Down
44 changes: 36 additions & 8 deletions scripts/funcTests/runFuncTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pushd $DIR/

mono --version

dotnet --info

# Download the CLI install script to cli
echo "Installing dotnet CLI"
mkdir -p cli
Expand All @@ -36,18 +38,37 @@ chmod +x scripts/funcTests/dotnet-install.sh

# Get recommended version for bootstrapping testing version
# Issue 8936 - DISABLED TEMPORARILY cli/dotnet-install.sh -i cli -c 2.2
scripts/funcTests/dotnet-install.sh -i cli -c 2.2 -NoPath
scripts/funcTests/dotnet-install.sh -i cli -c 2.2 -nopath

if (( $? )); then
echo "The .NET CLI Install failed!!"
exit 1
fi

# Disable .NET CLI Install Lookup
DOTNET_MULTILEVEL_LOOKUP=0

DOTNET="$(pwd)/cli/dotnet"

# Let the dotnet cli expand and decompress first if it's a first-run
$DOTNET --info

# Get CLI Branches for testing
echo "dotnet msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting"
# run it twice so dotnet cli can expand and decompress without affecting the result of the target
dotnet msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting
DOTNET_BRANCHES="$(dotnet msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting)"
echo $DOTNET_BRANCHES | tr ";" "\n" | while read -r DOTNET_BRANCH

IFS=$'\n'
CMD_OUT_LINES=(`dotnet msbuild build/config.props /v:m /nologo /t:GetCliBranchForTesting`)
# Take only last the line which has the version information and strip all the spaces
CMD_LAST_LINE=${CMD_OUT_LINES[@]:(-1)}
DOTNET_BRANCHES=${CMD_LAST_LINE//[[:space:]]}
unset IFS

IFS=$';'
for DOTNET_BRANCH in ${DOTNET_BRANCHES[@]}
do
echo $DOTNET_BRANCH

IFS=$':'
ChannelAndVersion=($DOTNET_BRANCH)
Channel=${ChannelAndVersion[0]}
if [ ${#ChannelAndVersion[@]} -eq 1 ]
Expand All @@ -56,15 +77,21 @@ do
else
Version=${ChannelAndVersion[1]}
fi
unset IFS

echo "Channel is: $Channel"
echo "Version is: $Version"
scripts/funcTests/dotnet-install.sh -i cli -c $Channel -v $Version -nopath

# Display current version
$DOTNET --version
dotnet --info
if (( $? )); then
echo "The .NET CLI Install for $DOTNET_BRANCH failed!!"
exit 1
fi
done

# Display .NET CLI info
$DOTNET --info

echo "initial dotnet cli install finished at `date -u +"%Y-%m-%dT%H:%M:%S"`"

echo "================="
Expand Down Expand Up @@ -104,6 +131,7 @@ fi
# restore packages
echo "dotnet msbuild build/build.proj /t:Restore /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta"
dotnet msbuild build/build.proj /t:Restore /p:VisualStudioVersion=16.0 /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta

if [ $? -ne 0 ]; then
echo "Restore failed!!"
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public MsbuildIntegrationTestFixture()
var dotnetExecutableName = RuntimeEnvironmentHelper.IsWindows ? "dotnet.exe" : "dotnet";
TestDotnetCli = Path.Combine(_cliDirectory, dotnetExecutableName);

var sdkPath = Directory.EnumerateDirectories(Path.Combine(_cliDirectory, "sdk")).Single();
var sdkPath = Directory.EnumerateDirectories(Path.Combine(_cliDirectory, "sdk"))
.Where(d => !string.Equals(Path.GetFileName(d), "NuGetFallbackFolder", StringComparison.OrdinalIgnoreCase))
.Single();

MsBuildSdksPath = Path.Combine(sdkPath, "Sdks");

Expand Down Expand Up @@ -442,6 +444,7 @@ private void UpdateCliWithLatestNuGetAssemblies(string cliDirectory)
var artifactsDirectory = DotnetCliUtil.GetArtifactsDirectoryInRepo();
var pathToSdkInCli = Path.Combine(
Directory.EnumerateDirectories(Path.Combine(cliDirectory, "sdk"))
.Where(d => !string.Equals(Path.GetFileName(d), "NuGetFallbackFolder", StringComparison.OrdinalIgnoreCase))
.First());
const string configuration =
#if DEBUG
Expand Down