Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Match the logic from functional tests script
The current logic assumes there will be no multi-value
dotnet testing branches but we could be wrong...

So, to be on the safe side, It's better to match the logic
with functional tests' version.
  • Loading branch information
Nirmal4G committed Mar 28, 2021
commit c4ec0b563cda3479426b08c31aa5dda91aab1d6c
42 changes: 26 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi
chmod +x cli/dotnet-install.sh

# Get recommended version for bootstrapping testing version
cli/dotnet-install.sh -i cli -c 1.0
cli/dotnet-install.sh -i cli -c 2.2 -nopath

if (( $? )); then
echo "The .NET CLI Install failed!!"
Expand All @@ -42,24 +42,34 @@ 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
CMD_LAST_LINE=${CMD_OUT_LINES[-1]//[[:space:]]}
DOTNET_BRANCHES=${CMD_OUT_LINES[-1]//[[:space:]]}
unset IFS

IFS=$';'
DOTNET_BRANCHES=(${CMD_LAST_LINE})
unset IFS

IFS=$':'
DOTNET_BRANCH=(${DOTNET_BRANCHES[0]})
unset IFS

echo $DOTNET_BRANCH
cli/dotnet-install.sh -i cli -c $DOTNET_BRANCH

if (( $? )); then
echo "The .NET CLI Install failed!!"
exit 1
fi
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 .NET CLI info
$DOTNET --info
Expand Down