Skip to content

Commit f6dc8fb

Browse files
committed
[ci] Move .NET SDK installation to xaprepare
1 parent d1df638 commit f6dc8fb

13 files changed

+142
-76
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Configuration.OperatingSystem.props
66
obj
77
packages
88
.DS_Store
9+
.dotnet
910
.nuget
1011
*.nupkg
1112
TestResult.xml

build-tools/automation/azure-pipelines-oss.yaml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ variables:
2626
InstallerArtifactName: Installers
2727
EXTRA_MSBUILD_ARGS: /p:AutoProvision=True /p:AutoProvisionUsesSudo=True /p:IgnoreMaxMonoVersion=False
2828
PREPARE_FLAGS: PREPARE_CI=1 PREPARE_CI_PR=1
29-
DotNetCoreVersion: 3.1.201
30-
# Version number from: https://github.com/dotnet/installer#installers-and-binaries
31-
DotNetCorePreviewVersion: 5.0.100-rc.2.20459.1
3229
GitHub.Token: $(github--pat--vs-mobiletools-engineering-service2)
3330

34-
3531
stages:
3632
- stage: mac_stage
3733
displayName: Mac
@@ -52,15 +48,6 @@ stages:
5248
clean: true # Executes: git clean -ffdx && git reset --hard HEAD
5349
submodules: recursive
5450

55-
- template: yaml-templates/use-dot-net.yaml
56-
parameters:
57-
version: $(DotNetCorePreviewVersion)
58-
remove_dotnet: true
59-
60-
- template: yaml-templates/use-dot-net.yaml
61-
parameters:
62-
version: $(DotNetCoreVersion)
63-
6451
- bash: |
6552
keychains=`security list-keychains`
6653
if [[ "$keychains" =~ "\"/Users/${USER}/Library/Keychains/builder.keychain-db\"" ]]; then
@@ -90,6 +77,9 @@ stages:
9077
fi
9178
displayName: restore default keychain
9279
80+
- script: echo "##vso[task.setvariable variable=PATH]$(Build.SourcesDirectory)/.dotnet:$PATH"
81+
displayName: add local dotnet installation to PATH
82+
9383
# Prepare and build everything
9484
- script: >
9585
echo "make prepare-update-mono V=1 CONFIGURATION=$(XA.Build.Configuration) $(PREPARE_FLAGS) MSBUILD_ARGS='$(EXTRA_MSBUILD_ARGS)'" &&

build-tools/automation/azure-pipelines.yaml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ variables:
5151
InstallerArtifactName: installers
5252
TestAssembliesArtifactName: test-assemblies
5353
NUnitConsoleVersion: 3.11.1
54-
DotNetCoreVersion: 3.1.201
55-
# Version number from: https://github.com/dotnet/installer#installers-and-binaries
56-
DotNetCorePreviewVersion: 5.0.100-rc.2.20480.7
5754
HostedMacMojave: Hosted Mac Internal Mojave
5855
HostedMac: Hosted Mac Internal
5956
HostedWinVS2019: Hosted Windows 2019 with VS2019
@@ -137,15 +134,6 @@ stages:
137134
- script: echo "##vso[task.setvariable variable=JI_JAVA_HOME]$HOME/Library/Android/$(XA.Jdk11.Folder)"
138135
displayName: set JI_JAVA_HOME
139136

140-
- template: yaml-templates/use-dot-net.yaml
141-
parameters:
142-
version: $(DotNetCorePreviewVersion)
143-
remove_dotnet: true
144-
145-
- template: yaml-templates/use-dot-net.yaml
146-
parameters:
147-
version: $(DotNetCoreVersion)
148-
149137
- template: install-certificates.yml@yaml
150138
parameters:
151139
DeveloperIdApplication: $(developer-id-application)
@@ -161,6 +149,9 @@ stages:
161149
provisioning_script: $(System.DefaultWorkingDirectory)/xamarin-android/build-tools/provisioning/xcode.csx
162150
provisioning_extra_args: '-v -v -v -v'
163151

152+
- script: echo "##vso[task.setvariable variable=PATH]$(System.DefaultWorkingDirectory)/xamarin-android/.dotnet:$PATH"
153+
displayName: add local dotnet installation to PATH
154+
164155
# Prepare and build everything
165156
- script: make prepare-update-mono V=1 CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1
166157
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android
@@ -287,15 +278,6 @@ stages:
287278
echo ##vso[task.setvariable variable=JI_JAVA_HOME]%USERPROFILE%\android-toolchain\$(XA.Jdk11.Folder)
288279
displayName: set JI_JAVA_HOME
289280
290-
- template: yaml-templates\use-dot-net.yaml
291-
parameters:
292-
version: $(DotNetCorePreviewVersion)
293-
remove_dotnet: true
294-
295-
- template: yaml-templates\use-dot-net.yaml
296-
parameters:
297-
version: $(DotNetCoreVersion)
298-
299281
# Downgrade the XA .vsix installed into the instance of VS that we are building with so that we don't restore/build against a test version.
300282
# The VS installer will attempt to resume any failed or partial installation before trying to downgrade Xamarin.Android.
301283
# VSIXInstaller.exe will exit non-zero when the downgrade attempt is a no-op, so we will allow this step to fail silently.
@@ -323,6 +305,10 @@ stages:
323305
324306
- template: environment/win/vs-msbuild.v1.yml@yaml # Display (in log) VS installation(s) including installation status with associated MSBuild location(s)
325307

308+
- script: |
309+
echo ##vso[task.setvariable variable=PATH]$(Build.SourcesDirectory)\.dotnet;%PATH%
310+
displayName: add local dotnet installation to PATH
311+
326312
- task: MSBuild@1
327313
displayName: msbuild Xamarin.Android /t:Prepare
328314
inputs:

build-tools/automation/yaml-templates/setup-test-environment.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ steps:
2121
displayName: set JI_JAVA_HOME
2222
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))
2323

24-
- template: use-dot-net.yaml
25-
parameters:
26-
version: $(DotNetCorePreviewVersion)
27-
remove_dotnet: true
28-
29-
- template: use-dot-net.yaml
30-
parameters:
31-
version: $(DotNetCoreVersion)
32-
3324
- script: |
3425
dotnet tool install --global boots
3526
displayName: install boots

build-tools/automation/yaml-templates/use-dot-net.yaml

Lines changed: 0 additions & 33 deletions
This file was deleted.

build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Linux.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ partial class Paths
1515
{
1616
public const string NdkToolchainOSTag = "linux-x86_64";
1717
}
18+
19+
partial class Urls
20+
{
21+
public static readonly Uri DotNetInstallScript = new Uri ("https://dot.net/v1/dotnet-install.sh");
22+
}
1823
}
1924
}

build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,10 @@ partial class Paths
2121
public static readonly string UnstrippedLibMonoSgenName = $"{LibMonoSgenBaseName}.d{Defaults.NativeLibraryExtension}";
2222
public static readonly string StrippedLibMonoSgenName = $"{LibMonoSgenBaseName}{Defaults.NativeLibraryExtension}";
2323
}
24+
25+
partial class Urls
26+
{
27+
public static readonly Uri DotNetInstallScript = new Uri ("https://dot.net/v1/dotnet-install.sh");
28+
}
2429
}
2530
}

build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.Windows.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,10 @@ partial class Paths
1919
public static readonly string MonoRuntimeHostMingwNativeLibraryPrefix = Path.Combine ("..", "bin");
2020
public const string NdkToolchainOSTag = "windows-x86_64";
2121
}
22+
23+
partial class Urls
24+
{
25+
public static readonly Uri DotNetInstallScript = new Uri ("https://dot.net/v1/dotnet-install.ps1");
26+
}
2227
}
2328
}

build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ public static partial class Defaults
6464
public static readonly Version JetBrainsOpenJDK8Version = new Version (Configurables.JetBrainsOpenJDK8VersionFull);
6565
public static readonly Version JetBrainsOpenJDK8Release = new Version (Configurables.JetBrainsOpenJDK8Release);
6666

67+
public const string DotNetVersion = "3.1.201";
68+
// Version number from: https://github.com/dotnet/installer#installers-and-binaries
69+
public const string DotNetPreviewVersion = "5.0.100-rc.2.20480.7";
70+
6771
// Mono runtimes
6872
public const string DebugFileExtension = ".pdb";
6973
public const string MonoHostMingwRuntimeNativeLibraryExtension = WindowsDLLSuffix;
@@ -274,6 +278,7 @@ public static partial class Paths
274278
public static readonly string BuildToolsDir = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "build-tools");
275279
public static readonly string BuildToolsScriptsDir = Path.Combine (BuildToolsDir, "scripts");
276280
public static readonly string BinDirRoot = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "bin");
281+
public static readonly string DotNetRoot = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, ".dotnet");
277282
public static readonly string ExternalDir = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "external");
278283
public static readonly string LocalNugetPath = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, ".nuget", "NuGet.exe");
279284
public static readonly string ExternalGitDepsFilePath = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, ".external");

build-tools/xaprepare/xaprepare/Scenarios/Scenario_Required.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ protected override void AddSteps (Context context)
2121
// Install essential tools, should they be missing
2222
context.SetCondition (KnownConditions.EnsureEssential, true);
2323

24+
Steps.Add (new Step_InstallDotNetSDKs ());
2425
Steps.Add (new Step_GenerateFiles (atBuildStart: true, onlyRequired: true));
2526
Steps.Add (new Step_PrepareExternalJavaInterop ());
2627
}

0 commit comments

Comments
 (0)