Skip to content

Commit

Permalink
Merge pull request #6757 from AvaloniaUI/update-net-5.0
Browse files Browse the repository at this point in the history
Update to net sdk 5.0.408
  • Loading branch information
danwalmsley committed Oct 27, 2021
1 parent b03c0b0 commit 2e1d9b8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 68 deletions.
50 changes: 29 additions & 21 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,47 @@ jobs:
pool:
vmImage: 'ubuntu-20.04'
steps:
- task: CmdLine@2
displayName: 'Install Nuke'
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1.414'
inputs:
script: |
dotnet tool install --global Nuke.GlobalTool --version 0.24.0
version: 3.1.414

- task: UseDotNet@2
displayName: 'Use .NET Core SDK 5.0.402'
inputs:
version: 5.0.402

- task: CmdLine@2
displayName: 'Run Nuke'
displayName: 'Run Build'
inputs:
script: |
export PATH="$PATH:$HOME/.dotnet/tools"
dotnet --info
printenv
nuke --target CiAzureLinux --configuration=Release
./build.sh --target CiAzureLinux --configuration=Release
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/test-results/*.trx'
condition: not(canceled())


- job: macOS
variables:
SolutionDir: '$(Build.SourcesDirectory)'
pool:
vmImage: 'macOS-10.15'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1.401'
displayName: 'Use .NET Core SDK 3.1.414'
inputs:
version: 3.1.401
version: 3.1.414

- task: UseDotNet@2
displayName: 'Use .NET Core SDK 5.0.402'
inputs:
version: 5.0.402

- task: CmdLine@2
displayName: 'Install Mono 5.18'
inputs:
Expand All @@ -45,6 +55,7 @@ jobs:
displayName: 'Generate avalonia-native'
inputs:
script: |
export PATH="`pwd`/sdk:$PATH"
cd src/tools/MicroComGenerator; dotnet run -i ../../Avalonia.Native/avn.idl --cpp ../../../native/Avalonia.Native/inc/avalonia-native.h
- task: Xcode@5
Expand All @@ -58,24 +69,16 @@ jobs:
args: '-derivedDataPath ./'

- task: CmdLine@2
displayName: 'Install Nuke'
inputs:
script: |
dotnet tool install --global Nuke.GlobalTool --version 0.24.0
- task: CmdLine@2
displayName: 'Run Nuke'
displayName: 'Run Build'
inputs:
script: |
export COREHOST_TRACE=0
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
which dotnet
dotnet --info
export PATH="$PATH:$HOME/.dotnet/tools"
dotnet --info
printenv
nuke --target CiAzureOSX --configuration Release --skip-previewer
./build.sh --target CiAzureOSX --configuration Release --skip-previewer
- task: PublishTestResults@2
inputs:
Expand All @@ -102,9 +105,14 @@ jobs:
SolutionDir: '$(Build.SourcesDirectory)'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 3.1.401'
displayName: 'Use .NET Core SDK 3.1.414'
inputs:
version: 3.1.414

- task: UseDotNet@2
displayName: 'Use .NET Core SDK 5.0.402'
inputs:
version: 3.1.401
version: 5.0.402

- task: CmdLine@2
displayName: 'Install Nuke'
Expand Down
48 changes: 2 additions & 46 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,55 +20,11 @@ SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
###########################################################################

BUILD_PROJECT_FILE="$SCRIPT_DIR/nukebuild/_build.csproj"
TEMP_DIRECTORY="$SCRIPT_DIR//.tmp"

DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
DOTNET_INSTALL_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh"
DOTNET_CHANNEL="Current"

export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export NUGET_XMLDOC_MODE="skip"

###########################################################################
# EXECUTION
###########################################################################

function FirstJsonValue {
perl -nle 'print $1 if m{"'$1'": "([^"\-]+)",?}' <<< ${@:2}
}

# If global.json exists, load expected version
if [ -f "$DOTNET_GLOBAL_FILE" ]; then
DOTNET_VERSION=$(FirstJsonValue "version" $(cat "$DOTNET_GLOBAL_FILE"))
if [ "$DOTNET_VERSION" == "" ]; then
unset DOTNET_VERSION
fi
fi

# If dotnet is installed locally, and expected version is not set or installation matches the expected version
if [[ -x "$(command -v dotnet)" && (-z ${DOTNET_VERSION+x} || $(dotnet --version) == "$DOTNET_VERSION") || "$SKIP_DOTNET_DOWNLOAD" == "1" ]]; then
export DOTNET_EXE="$(command -v dotnet)"
else
DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix"
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"

# Download install script
DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh"
mkdir -p "$TEMP_DIRECTORY"
curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL"
chmod +x "$DOTNET_INSTALL_FILE"

# Install by channel or version
if [ -z ${DOTNET_VERSION+x} ]; then
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path
else
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
fi
fi

export PATH=$DOTNET_DIRECTORY:$PATH

echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
dotnet --info

"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" -- ${BUILD_ARGUMENTS[@]}
dotnet run --project "$BUILD_PROJECT_FILE" -- ${BUILD_ARGUMENTS[@]}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.1.401"
"version": "5.0.402"
},
"msbuild-sdks": {
"Microsoft.Build.Traversal": "1.0.43",
Expand Down

0 comments on commit 2e1d9b8

Please sign in to comment.