From dfe0b26498a90bccfe7079fb0a114152d60bd19e Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 23 Jul 2025 06:44:35 -0700 Subject: [PATCH] Add more Android versions for testing. Only download them on devices marked for additional sdks. Move the lists into facts so that they can be reused. Add uninstallation tasks. --- tasks/general/acct_mgmt/provision_config.yml | 3 + tasks/workstation/linux/software/android.yml | 215 +++++++++++-------- 2 files changed, 133 insertions(+), 85 deletions(-) diff --git a/tasks/general/acct_mgmt/provision_config.yml b/tasks/general/acct_mgmt/provision_config.yml index 0092149..d24efac 100644 --- a/tasks/general/acct_mgmt/provision_config.yml +++ b/tasks/general/acct_mgmt/provision_config.yml @@ -179,6 +179,7 @@ ; enable : Set to true for system to be considered a workstation. ; ; coding : Set to true for installation of code editors (VSCode, PyCharm, Android Studio) + ; - sdks : Set to true to download additional SDKs to test against. ; ; editing : Set to true for installation of Audio/Video editors (Shotcut, Audacity, OBS Stdio, GIMP) ; Set to video for only the video related portions. @@ -213,6 +214,7 @@ set_fact: workstation: "{{ lookup('ini', 'enable file={{wrk_file}} default=false') }}" coding: "{{ lookup('ini', 'coding file={{wrk_file}} default=false') }}" + sdks: "{{ lookup('ini', 'sdks file={{wrk_file}} default=false') }}" editing: "{{ lookup('ini', 'editing file={{wrk_file}} default=false') }}" gaming: "{{ lookup('ini', 'gaming file={{wrk_file}} default=false') }}" rdp: "{{ lookup('ini', 'rdp file={{wrk_file}} default=false') }}" @@ -227,6 +229,7 @@ loop: - { 'workstation': "{{ workstation }}" } - { 'coding': "{{ coding }}" } + - { 'sdks': "{{ sdks }}" } - { 'editing': "{{ editing }}" } - { 'gaming': "{{ gaming }}" } - { 'rdp': "{{ rdp }}" } diff --git a/tasks/workstation/linux/software/android.yml b/tasks/workstation/linux/software/android.yml index 5722b0e..a26b28d 100644 --- a/tasks/workstation/linux/software/android.yml +++ b/tasks/workstation/linux/software/android.yml @@ -30,6 +30,116 @@ android_sdkmanager_temp: "{{ android_sdk_cmdline_temp }}/cmdline-tools/bin/sdkmanager" android_sdkmanager_final: "{{ android_sdk_cmdline_final }}/sdkmanager" +# Regarding images to download; the `default` is the smallest, then `playstore`. +# The `google_apis` images are significantly larger than the `playstore` option. +# +# This script was used to download and test the sizes: +# +### #!/bin/bash +### +### cd /home/ling/SDKs/Android/Sdk/cmdline-tools/latest/bin +### +### # Actually to be used +### echo "35 Play Store" +### ./sdkmanager --install "system-images;android-35;google_apis_playstore;x86_64" +### echo "36 Play Store" +### ./sdkmanager --install "system-images;android-36;google_apis_playstore;x86_64" +### +### # FORTESTING file size +### echo "35 AOSP" +### ./sdkmanager --install "system-images;android-35;default;x86_64" +### echo "36 APIs Only" +### ./sdkmanager --install "system-images;android-36;google_apis;x86_64" +### echo "35 APIs Only" +### ./sdkmanager --install "system-images;android-35;google_apis;x86_64" +### +### exit 0 +# +# These were the results: +# +### ~/SDKs/Android/Sdk/system-images]$ du -had2 | sort -h +### 1.7G ./android-35/default +### 2.2G ./android-35/google_apis_playstore +### 2.3G ./android-36/google_apis_playstore +### 3.5G ./android-35/google_apis +### 4.3G ./android-36/google_apis +### 6.6G ./android-36 +### 7.3G ./android-35 +### 14G . + +- name: Workstation | Linux | Software | Android | Facts [Downloads] + set_fact: + android_downloads_required: + ### 36 ### + - build-tools;36.0.0 + - platforms;android-36 + - sources;android-36 + # Images + #- system-images;android-35;default;x86_64 # TODO: Switch once it exists. + - system-images;android-36;google_apis_playstore;x86_64 + ### 16 ### + - platforms;android-16 + - sources;android-16 + # Images + - system-images;android-16;default;x86 + android_downloads_additional: + ### 35 ### + - platforms;android-35 + - sources;android-35 + # Images + - system-images;android-35;default;x86_64 + ### 34 ### + - platforms;android-34 + - sources;android-34 + # Images + - system-images;android-34;default;x86_64 + ### 33 ### + - platforms;android-33 + - sources;android-33 + # Images + - system-images;android-33;default;x86_64 + ### 30 ### + - platforms;android-30 + - sources;android-30 + # Images + - system-images;android-30;default;x86_64 + ### 27 ### + - platforms;android-27 + - sources;android-27 + # Images + - system-images;android-27;default;x86_64 + ### 21 ### + - platforms;android-21 + - sources;android-21 + # Images + - system-images;android-21;default;x86_64 + android_downloads_unused: + ### 36 ### + # Images + - system-images;android-36;google_apis;x86_64 + ### 35 ### + - build-tools;35.0.0 + - build-tools;35.0.1 + # Images + - system-images;android-35;aosp_atd;x86_64 # ATD = Automated Test Device + - system-images;android-35;google_apis;x86_64 + - system-images;android-35;google_apis_playstore;x86_64 + ### 34 ### + - build-tools;34.0.0 + - platforms;android-34 + - sources;android-34 + # Images + - system-images;android-34;google_apis;x86_64 + - system-images;android-34;google_apis_playstore;x86_64 + ### 16 ### + # Images + - system-images;android-16;google_apis;x86 + ### 15 ### + - platforms;android-15 + - sources;android-15 + # Images + - system-images;android-15;default;x86 # Not working in Android AVDs + ## Checks ## - name: Workstation | Linux | Software | Android | Check SDK Manager Exists [1/2] @@ -112,7 +222,7 @@ ## Configure Modules ## # This can only be run once, otherwise cmdline-tools creates latest-* folders. -- name: Workstation | Linux | Software | Android | Install Consistent Modules +- name: Workstation | Linux | Software | Android | Install | Consistent Modules shell: "yes | {{ android_sdkmanager_temp }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}" loop: # Current @@ -122,96 +232,31 @@ become_user: "{{ user }}" when: coding == true and not android_sdkmanager_final_stat.stat.exists -# Regarding images to download; the `default` is the smallest, then `playstore`. -# The `google_apis` images are significantly larger than the `playstore` option. -# -# This script was used to download and test the sizes: -# -### #!/bin/bash -### -### cd /home/ling/SDKs/Android/Sdk/cmdline-tools/latest/bin -### -### # Actually to be used -### echo "35 Play Store" -### ./sdkmanager --install "system-images;android-35;google_apis_playstore;x86_64" -### echo "36 Play Store" -### ./sdkmanager --install "system-images;android-36;google_apis_playstore;x86_64" -### -### # FORTESTING file size -### echo "35 AOSP" -### ./sdkmanager --install "system-images;android-35;default;x86_64" -### echo "36 APIs Only" -### ./sdkmanager --install "system-images;android-36;google_apis;x86_64" -### echo "35 APIs Only" -### ./sdkmanager --install "system-images;android-35;google_apis;x86_64" -### -### exit 0 -# -# These were the results: -# -### ~/SDKs/Android/Sdk/system-images]$ du -had2 | sort -h -### 1.7G ./android-35/default -### 2.2G ./android-35/google_apis_playstore -### 2.3G ./android-36/google_apis_playstore -### 3.5G ./android-35/google_apis -### 4.3G ./android-36/google_apis -### 6.6G ./android-36 -### 7.3G ./android-35 -### 14G . - # These are safe to run multiple times, and uses the new `latest` version. -- name: Workstation | Linux | Software | Android | Install Modules +- name: Workstation | Linux | Software | Android | Install | Required Modules shell: "yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}" - loop: - ### 36 ### - - build-tools;36.0.0 - - platforms;android-36 - - sources;android-36 - # Images - #- system-images;android-35;default;x86_64 # TODO: Switch once it exists. - - system-images;android-36;google_apis_playstore;x86_64 - ### 35 ### - - platforms;android-35 - - sources;android-35 - # Images - - system-images;android-35;default;x86_64 - ### 16 ### - - platforms;android-16 - - sources;android-16 - # Images - - system-images;android-16;default;x86 + loop: "{{ android_downloads_required }}" become_user: "{{ user }}" when: coding == true -# Remove any versions which used to be part of this script and no longer used. -- name: Workstation | Linux | Software | Android | Remove Modules +# Add more versions for testing across all the important platforms. +- name: Workstation | Linux | Software | Android | Install | Additional Modules + shell: "yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}" + loop: "{{ android_downloads_additional }}" + become_user: "{{ user }}" + when: coding == true and sdks == true + +# Remove extra downloads if system is not meant for full amount of testing. +- name: Workstation | Linux | Software | Android | Uninstall | Additional Modules shell: "yes | {{ android_sdkmanager_final }} --uninstall '{{ item }}' --sdk_root={{ android_sdk_location }}" - loop: - ### 36 ### - # Images - - system-images;android-36;google_apis;x86_64 - ### 35 ### - - build-tools;35.0.0 - - build-tools;35.0.1 - # Images - - system-images;android-35;aosp_atd;x86_64 # ATD = Automated Test Device - - system-images;android-35;google_apis;x86_64 - - system-images;android-35;google_apis_playstore;x86_64 - ### 34 ### - - build-tools;34.0.0 - - platforms;android-34 - - sources;android-34 - # Images - - system-images;android-34;google_apis;x86_64 - - system-images;android-34;google_apis_playstore;x86_64 - ### 16 ### - # Images - - system-images;android-16;google_apis;x86 - ### 15 ### - - platforms;android-15 - - sources;android-15 - # Images - - system-images;android-15;default;x86 # Not working in Android AVDs + loop: "{{ android_downloads_additional }}" + become_user: "{{ user }}" + when: coding != true or sdks != true + +# Remove any versions which used to be part of this script and no longer used. +- name: Workstation | Linux | Software | Android | Uninstall | Unused Modules + shell: "yes | {{ android_sdkmanager_final }} --uninstall '{{ item }}' --sdk_root={{ android_sdk_location }}" + loop: "{{ android_downloads_unused }}" become_user: "{{ user }}" when: coding == true