diff --git a/script/todo/todo.py b/script/todo/todo.py index d7999e4..0979224 100755 --- a/script/todo/todo.py +++ b/script/todo/todo.py @@ -5452,8 +5452,22 @@ class TODO: "/opt/android-studio/bin/studio.svg", "Development;IDE;", ) + + + # Le SDK partagé, vu depuis la SESSION graphique. install-android.sh + # écrit ses exports dans ~/.bashrc, que GNOME ne lit pas : Android + # Studio lancé depuis le menu ne verrait donc pas le SDK et + # proposerait d'en télécharger un second. environment.d est le + # canal que la session utilisateur lit vraiment. + "mkdir -p ~/.config/environment.d && " + "printf 'ANDROID_HOME=%s/android\\nANDROID_SDK_ROOT=%s/android\\n'" + ' "$HOME" "$HOME" ' + "> ~/.config/environment.d/10-erplibre-android.conf; " + # repositories.cfg absent, et l'assistant de première ouverture + # s'arrête sur une erreur au lieu de proposer quoi que ce soit. + "mkdir -p ~/.android && touch ~/.android/repositories.cfg; " + f'echo " {t("Android Studio installed:")} /opt/android-studio ' f'({t("command")} studio / android-studio)"; ' + f'echo " {t("SDK shared through ANDROID_HOME:")} $HOME/android"; ' "grep -q vmx /proc/cpuinfo 2>/dev/null " "|| grep -q svm /proc/cpuinfo 2>/dev/null " f'|| echo " {t("no nested KVM: the emulator will not run")}"; ' @@ -6267,7 +6281,24 @@ class TODO: # plutôt que d'écrêter, contrairement au multiplicateur x1..x4 qui, lui, # est un calcul automatique et se borne aux cœurs de l'hôte. _QEMU_CPU_PRESETS = ( - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 24, 32 + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 24, + 32, ) @staticmethod diff --git a/script/todo/todo_i18n.py b/script/todo/todo_i18n.py index 0b8770d..55da492 100644 --- a/script/todo/todo_i18n.py +++ b/script/todo/todo_i18n.py @@ -7627,6 +7627,10 @@ TRANSLATIONS = { "fr": "Android Studio : Google ne publie que du x86_64", "en": "Android Studio: Google publishes x86_64 only", }, + "SDK shared through ANDROID_HOME:": { + "fr": "SDK partagé via ANDROID_HOME :", + "en": "SDK shared through ANDROID_HOME:", + }, "Android Studio installed:": { "fr": "Android Studio installé :", "en": "Android Studio installed:", diff --git a/test/test_qemu_desktop_tools.py b/test/test_qemu_desktop_tools.py index 1c279ed..1a318b3 100644 --- a/test/test_qemu_desktop_tools.py +++ b/test/test_qemu_desktop_tools.py @@ -229,6 +229,17 @@ class TestToolDiscoverability(unittest.TestCase): self.assertIn("/usr/local/bin/studio;", cmd) self.assertIn("/usr/local/bin/android-studio;", cmd) + def test_the_sdk_is_shared_with_the_desktop_session(self): + """install-android.sh écrit ses exports dans ~/.bashrc, que GNOME ne + lit pas : sans environment.d, Android Studio lancé depuis le menu + proposerait de télécharger un SECOND SDK.""" + cmd = self.todo._qemu_android_studio_remote_cmd() + self.assertIn(".config/environment.d", cmd) + self.assertIn("ANDROID_HOME=", cmd) + # Le même emplacement que celui où la compilation mobile l'installe. + self.assertIn("/android", cmd) + self.assertIn("ANDROID_HOME", self.todo._qemu_mobile_remote_cmd()) + def test_the_log_says_where_it_landed(self): pycharm = self.todo._qemu_pycharm_remote_cmd() android = self.todo._qemu_android_studio_remote_cmd()