-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a0a71a
commit 9815d48
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
- name: Configure Android SDK | ||
hosts: localhost | ||
|
||
########################### | ||
# Android SDK Manager | ||
# https://developer.android.com/studio/command-line/sdkmanager | ||
########################### | ||
# | ||
# sdkmanager "platforms;android-33" | ||
# sdkmanager "platform-tools" | ||
# sdkmanager "build-tools;33.0.2" | ||
# sdkmanager emulator | ||
# sdkmanager "system-images;android-33;google_apis;x86_64" | ||
# sdkmanager --licenses | ||
# | ||
|
||
vars: | ||
android_sdk_root: '/usr/local/share/android-sdk' | ||
|
||
tasks: | ||
- name: Create Android command-line tools' directory | ||
ansible.builtin.file: | ||
path: '{{ android_sdk_root }}/cmdline-tools' | ||
state: directory | ||
mode: 0755 | ||
become: true | ||
|
||
########################### | ||
# Android Command-line Tools | ||
# https://developer.android.com/studio#command-line-tools-only | ||
########################### | ||
- name: MacOS => install command-line tools | ||
when: ansible_distribution == 'MacOSX' | ||
ansible.builtin.unarchive: | ||
src: 'https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip' | ||
dest: '{{ android_sdk_root }}/cmdline-tools' | ||
remote_src: yes | ||
become: true | ||
|
||
- name: Linux => install command-line tools | ||
when: ansible_distribution != 'MacOSX' | ||
ansible.builtin.unarchive: | ||
src: 'https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip' | ||
dest: '{{ android_sdk_root }}/cmdline-tools' | ||
remote_src: yes | ||
become: true | ||
|
||
- name: Rename command-line tools directory to latest | ||
ansible.builtin.shell: | | ||
cd {{ android_sdk_root }}/cmdline-tools | ||
rm -rf latest | ||
mv -f cmdline-tools latest | ||
become: true |