Skip to content

Conversation

<AndroidPreviousFrameworkVersion Condition=" '$(AndroidPreviousFrameworkVersion)' == '' ">v1.0</AndroidPreviousFrameworkVersion>
<AndroidToolchainCacheDirectory Condition=" '$(AndroidToolchainCacheDirectory)' == '' ">$(HOME)\android-archives</AndroidToolchainCacheDirectory>
<AndroidToolchainDirectory Condition=" '$(AndroidToolchainDirectory)' == '' And '$(RunningOnCI)' == 'true' And '$(HostOS)' == 'Darwin' ">$(HOME)\Library\Android</AndroidToolchainDirectory>
<AndroidToolchainDirectory Condition=" '$(AndroidToolchainDirectory)' == '' And '$(RunningOnCI)' == 'true' And '$(HostOS)' == 'Linux' ">/usr/local/lib/android</AndroidToolchainDirectory>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be hardcoding /usr/local/lib/android, or should this instead use the documented environment variable?

diff --git a/Configuration.props b/Configuration.props
index ae219baaf..b9543946a 100644
--- a/Configuration.props
+++ b/Configuration.props
@@ -78,7 +78,9 @@
     <AndroidToolchainDirectory Condition=" '$(AndroidToolchainDirectory)' == '' ">$(HOME)\android-toolchain</AndroidToolchainDirectory>
     <AndroidMxeInstallPrefix Condition=" '$(HostOS)' == 'Linux' ">\usr</AndroidMxeInstallPrefix>
     <AndroidMxeInstallPrefix Condition=" '$(HostOS)' == 'Darwin' ">$(HostHomebrewPrefix)</AndroidMxeInstallPrefix>
+    <AndroidSdkDirectory Condition=" '$(AndroidSdkDirectory)' == '' And Exists($(ANDROID_SDK_ROOT)) ">$(ANDROID_SDK_ROOT)</AndroidSdkDirectory>
     <AndroidSdkDirectory Condition=" '$(AndroidSdkDirectory)' == '' ">$(AndroidToolchainDirectory)\sdk</AndroidSdkDirectory>
+    <AndroidNdkDirectory Condition=" '$(AndroidNdkDirectory)' == '' And Exists($(ANDROID_NDK_ROOT)) ">$(ANDROID_NDK_ROOT)</AndroidNdkDirectory>
     <AndroidNdkDirectory Condition=" '$(AndroidNdkDirectory)' == '' ">$(AndroidToolchainDirectory)\ndk</AndroidNdkDirectory>
     <DotNetPreviewPath Condition=" '$(DotNetPreviewPath)' == '' ">$(AndroidToolchainDirectory)\dotnet\</DotNetPreviewPath>
     <DotNetPreviewTool Condition=" '$(DotNetPreviewTool)' == '' ">$(DotNetPreviewPath)dotnet</DotNetPreviewTool>

This might also warrant checking $(RunningOnCI), but I think it might be reasonable to default to $ANDROID_SDK_ROOT and $ANDROID_NDK_ROOT if those are set.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with $ANDROID_NDK_LATEST_HOME, as it will hopefully continue to be a closer match to the version that we need going forward. Right now this version aligns with ours and allows us to skip installation of the NDK on hosted machines.

@pjcollins pjcollins force-pushed the share-hosted-sdk branch 2 times, most recently from cd05b1e to 9e0f3ca Compare February 9, 2022 19:13
@pjcollins
Copy link
Member Author

This seems to be working on the Linux side, we're no longer installing everything:

2022-02-09T19:18:44.4536146Z Android SDK location: /usr/local/lib/android/sdk
2022-02-09T19:18:44.4536956Z Android NDK location: /usr/local/lib/android/sdk/ndk/23.1.7779620
2022-02-09T19:18:44.4549696Z   * Checking android-2.3.3_r02
2022-02-09T19:18:44.4801824Z     missing
2022-02-09T19:18:44.4804694Z   * Checking android-15_r05
2022-02-09T19:18:44.4805655Z     missing
2022-02-09T19:18:44.4806403Z   * Checking android-16_r05
2022-02-09T19:18:44.4807011Z     missing
2022-02-09T19:18:44.4807699Z   * Checking android-17_r03
2022-02-09T19:18:44.4808300Z     missing
2022-02-09T19:18:44.4812445Z   * Checking android-18_r03
2022-02-09T19:18:44.4813704Z     missing
2022-02-09T19:18:44.4815063Z   * Checking android-19_r04
2022-02-09T19:18:44.4816129Z     missing
2022-02-09T19:18:44.4817341Z   * Checking android-20_r02
2022-02-09T19:18:44.4818367Z     missing
2022-02-09T19:18:44.4819547Z   * Checking android-21_r02
2022-02-09T19:18:44.4820593Z     missing
2022-02-09T19:18:44.4821858Z   * Checking android-22_r02
2022-02-09T19:18:44.4822892Z     missing
2022-02-09T19:18:44.4824099Z   * Checking platform-23_r03
2022-02-09T19:18:44.4825142Z     missing
2022-02-09T19:18:44.4826334Z   * Checking platform-24_r02
2022-02-09T19:18:44.4827349Z     missing
2022-02-09T19:18:44.4828706Z   * Checking platform-25_r03
2022-02-09T19:18:44.4829715Z     missing
2022-02-09T19:18:44.4830864Z   * Checking platform-26_r02
2022-02-09T19:18:44.4831848Z     missing
2022-02-09T19:18:44.4833019Z   * Checking platform-27_r03
2022-02-09T19:18:44.6073595Z     installed
2022-02-09T19:18:44.6074761Z   * Checking platform-28_r04
2022-02-09T19:18:44.7185619Z     outdated
2022-02-09T19:18:44.7187198Z   * Checking platform-29_r01
2022-02-09T19:18:44.8019269Z     outdated
2022-02-09T19:18:44.8020878Z   * Checking platform-30_r01
2022-02-09T19:18:44.8818372Z     outdated
2022-02-09T19:18:44.8819532Z   * Checking platform-31_r01
2022-02-09T19:18:44.9447530Z     installed
2022-02-09T19:18:44.9449045Z   * Checking platform-32_r01
2022-02-09T19:18:44.9812006Z     installed
2022-02-09T19:18:44.9813607Z   * Checking sources-31_r01
2022-02-09T19:18:44.9814781Z     missing
2022-02-09T19:18:44.9816017Z   * Checking docs-24_r01
2022-02-09T19:18:44.9816784Z     missing
2022-02-09T19:18:44.9817478Z   * Checking android_m2repository_r47
2022-02-09T19:18:45.1190278Z     installed
2022-02-09T19:18:45.1191964Z   * Checking x86_64-29_r07-linux
2022-02-09T19:18:45.1193167Z     missing
2022-02-09T19:18:45.1194364Z   * Checking android-ndk-r23b-linux
2022-02-09T19:18:45.1195401Z     installed
2022-02-09T19:18:45.1196697Z   * Checking build-tools_r32-linux
2022-02-09T19:18:45.1250728Z     installed
2022-02-09T19:18:45.1252592Z   * Checking build-tools_r30.0.3-linux
2022-02-09T19:18:45.1253560Z     installed
2022-02-09T19:18:45.1254620Z   * Checking commandlinetools-linux-7583922_latest
2022-02-09T19:18:45.1255550Z     missing
2022-02-09T19:18:45.1256531Z   * Checking platform-tools_r31.0.3-linux
2022-02-09T19:18:45.1586266Z     outdated
2022-02-09T19:18:45.1587863Z   * Checking sdk-tools-linux-4333796
2022-02-09T19:18:45.1815870Z     installed
2022-02-09T19:18:45.1817344Z   * Checking emulator-linux-7033400
2022-02-09T19:18:45.2070460Z     outdated
2022-02-09T19:18:45.2072027Z   * Checking cmake-3.18.1-linux
2022-02-09T19:18:45.4086552Z     installed

Compared to previous runs:

2022-02-09T16:56:16.0129226Z Android SDK location: /home/cloudtest/android-toolchain/sdk
2022-02-09T16:56:16.0130640Z Android NDK location: /home/cloudtest/android-toolchain/ndk
2022-02-09T16:56:16.0147826Z   * Checking android-2.3.3_r02
2022-02-09T16:56:16.0159236Z     missing
2022-02-09T16:56:16.0162710Z   * Checking android-15_r05
2022-02-09T16:56:16.0163817Z     missing
2022-02-09T16:56:16.0164998Z   * Checking android-16_r05
2022-02-09T16:56:16.0165913Z     missing
2022-02-09T16:56:16.0166859Z   * Checking android-17_r03
2022-02-09T16:56:16.0167589Z     missing
2022-02-09T16:56:16.0168405Z   * Checking android-18_r03
2022-02-09T16:56:16.0169102Z     missing
2022-02-09T16:56:16.0169903Z   * Checking android-19_r04
2022-02-09T16:56:16.0170614Z     missing
2022-02-09T16:56:16.0171678Z   * Checking android-20_r02
2022-02-09T16:56:16.0172395Z     missing
2022-02-09T16:56:16.0173229Z   * Checking android-21_r02
2022-02-09T16:56:16.0173967Z     missing
2022-02-09T16:56:16.0174885Z   * Checking android-22_r02
2022-02-09T16:56:16.0175925Z     missing
2022-02-09T16:56:16.0176972Z   * Checking platform-23_r03
2022-02-09T16:56:16.0177766Z     missing
2022-02-09T16:56:16.0178569Z   * Checking platform-24_r02
2022-02-09T16:56:16.0179243Z     missing
2022-02-09T16:56:16.0180189Z   * Checking platform-25_r03
2022-02-09T16:56:16.0180857Z     missing
2022-02-09T16:56:16.0181621Z   * Checking platform-26_r02
2022-02-09T16:56:16.0182584Z     missing
2022-02-09T16:56:16.0183426Z   * Checking platform-27_r03
2022-02-09T16:56:16.0184156Z     missing
2022-02-09T16:56:16.0184969Z   * Checking platform-28_r04
2022-02-09T16:56:16.0185670Z     missing
2022-02-09T16:56:16.0186474Z   * Checking platform-29_r01
2022-02-09T16:56:16.0187186Z     missing
2022-02-09T16:56:16.0187979Z   * Checking platform-30_r01
2022-02-09T16:56:16.0188693Z     missing
2022-02-09T16:56:16.0189502Z   * Checking platform-31_r01
2022-02-09T16:56:16.0190210Z     missing
2022-02-09T16:56:16.0190993Z   * Checking platform-32_r01
2022-02-09T16:56:16.0191757Z     missing
2022-02-09T16:56:16.0192567Z   * Checking sources-31_r01
2022-02-09T16:56:16.0193278Z     missing
2022-02-09T16:56:16.0194064Z   * Checking docs-24_r01
2022-02-09T16:56:16.0194788Z     missing
2022-02-09T16:56:16.0195493Z   * Checking android_m2repository_r47
2022-02-09T16:56:16.0196206Z     missing
2022-02-09T16:56:16.0197015Z   * Checking x86_64-29_r07-linux
2022-02-09T16:56:16.0197736Z     missing
2022-02-09T16:56:16.0198557Z   * Checking android-ndk-r23b-linux
2022-02-09T16:56:16.0199263Z     missing
2022-02-09T16:56:16.0200083Z   * Checking build-tools_r32-linux
2022-02-09T16:56:16.0200811Z     missing
2022-02-09T16:56:16.0201640Z   * Checking build-tools_r30.0.3-linux
2022-02-09T16:56:16.0202379Z     missing
2022-02-09T16:56:16.0203260Z   * Checking commandlinetools-linux-7583922_latest
2022-02-09T16:56:16.0204047Z     missing
2022-02-09T16:56:16.0204884Z   * Checking platform-tools_r31.0.3-linux
2022-02-09T16:56:16.0205637Z     missing
2022-02-09T16:56:16.0206459Z   * Checking sdk-tools-linux-4333796
2022-02-09T16:56:16.0207169Z     missing
2022-02-09T16:56:16.0207991Z   * Checking emulator-linux-7033400
2022-02-09T16:56:16.0208718Z     missing
2022-02-09T16:56:16.0209513Z   * Checking cmake-3.18.1-linux
2022-02-09T16:56:16.0210222Z     missing

Windows test environments are also using the preinstalled paths:

Android SDK location: C:\Android\android-sdk
Android NDK location: C:\Android\android-sdk\ndk\23.1.7779620

@pjcollins pjcollins changed the title Test sharing Android SDK path usage on Linux [build] Use Azure Pipelines vars for Android SDK/NDK paths Feb 9, 2022
@pjcollins pjcollins marked this pull request as ready for review February 10, 2022 01:54
@pjcollins pjcollins requested a review from jonpryor February 11, 2022 00:20
@jonpryor jonpryor merged commit 70272db into dotnet:main Feb 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants