From 10ff873b4a5247f064e2476debe4358755c85479 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Sun, 20 Aug 2023 16:19:19 +0200 Subject: [PATCH] Update flutter role Install system-image Set android-sdk dir in flutter --- roles/flutter/tasks/install-android-sdk.yml | 1 + roles/flutter/tasks/install-flutter.yml | 4 ++++ roles/flutter/tasks/main.yml | 17 +++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/roles/flutter/tasks/install-android-sdk.yml b/roles/flutter/tasks/install-android-sdk.yml index c58ec10..fabd660 100644 --- a/roles/flutter/tasks/install-android-sdk.yml +++ b/roles/flutter/tasks/install-android-sdk.yml @@ -59,3 +59,4 @@ sdkmanager --install "platform-tools" sdkmanager --install "platforms;android-{{ android.sdk.version }}" sdkmanager --install "sources;android-{{ android.sdk.version }}" + sdkmanager --install "system-images;android-{{ android.sdk.version }};google_apis;x86_64" diff --git a/roles/flutter/tasks/install-flutter.yml b/roles/flutter/tasks/install-flutter.yml index a0e91eb..ce2569b 100644 --- a/roles/flutter/tasks/install-flutter.yml +++ b/roles/flutter/tasks/install-flutter.yml @@ -37,3 +37,7 @@ src: "{{ flutter.dir }}/bin/dart" dest: "/usr/local/bin/dart" state: link + +- name: Set flutter android sdk dir + shell: + cmd: flutter config --android-sdk {{ android.dir }} diff --git a/roles/flutter/tasks/main.yml b/roles/flutter/tasks/main.yml index 211ea5e..fd7c575 100644 --- a/roles/flutter/tasks/main.yml +++ b/roles/flutter/tasks/main.yml @@ -4,6 +4,15 @@ pkg: - python3-jmespath +- name: Check if android-sdk has been installed + stat: + path: "{{ android.dir }}" + register: android_sdk_dir_status + +- import_tasks: install-android-sdk.yml + when: + - not android_sdk_dir_status.stat.exists + - name: Check if flutter has been installed stat: path: "{{ flutter.dir }}" @@ -13,11 +22,3 @@ when: - not flutter_dir_status.stat.exists -- name: Check if android-sdk has been installed - stat: - path: "{{ android.dir }}" - register: android_sdk_dir_status - -- import_tasks: install-android-sdk.yml - when: - - not android_sdk_dir_status.stat.exists \ No newline at end of file