Commit 8ee714f0 by stu

add libraries/packages for emulation and more tests

parent eb38e30a
...@@ -11,9 +11,17 @@ android_home: "/opt/android-sdk-linux" ...@@ -11,9 +11,17 @@ android_home: "/opt/android-sdk-linux"
# individual android build targets to be downloaded via the android sdk manager # individual android build targets to be downloaded via the android sdk manager
android_build_targets: android_build_targets:
- android-23 - android-23
# other android dependencies that cannot be tested via the android sdk manager - android-21
# other android dependencies that cannot be tested via the android sdk manager. instead, stat the android_test_path
# to test for presence of the package
android_tools: android_tools:
- platform-tools - { package: 'platform-tools', android_test_path: 'platform-tools' }
- build-tools-23.0.3 - { package: 'build-tools-23.0.3', android_test_path: 'build-tools/23.0.3' }
- extra-google-m2repository - { package: 'extra-google-m2repository', android_test_path: 'extras/google/m2repository' }
- extra-android-m2repository - { package: 'extra-android-m2repository', android_test_path: 'extras/android/m2repository' }
- { package: 'sys-img-armeabi-v7a-android-21', android_test_path: 'system-images/android-21/default/armeabi-v7a/' }
- { package: 'sys-img-armeabi-v7a-android-23', android_test_path: 'system-images/android-23/default/armeabi-v7a/' }
# libraries needed for avd(android virtual device) emulation
android_apt_libraries:
- libstdc++6:i386
- lib32z1
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
- assert: - assert:
that: that:
"'{{ android_checksum }}' in sdk_checksum.stdout" "'{{ android_checksum }}' in sdk_checksum.stdout"
- name: Unarchive tarball to /opt/android-sdk - name: Unarchive tarball to /opt/android-sdk-linux
unarchive: unarchive:
copy: no copy: no
src: /tmp/android-sdk.tgz src: /tmp/android-sdk.tgz
...@@ -34,11 +34,26 @@ ...@@ -34,11 +34,26 @@
become: yes become: yes
# Use the android sdk manager to install the build targets necessary for the edx mobile app # Use the android sdk manager to install the build targets necessary for the edx mobile app
- name: Install Android API levels - name: Install Android API levels
shell: "echo 'y' | {{ android_home }}/tools/android update sdk --no-ui --filter {{ ','.join(android_build_targets) }}" shell: "echo 'y' | {{ android_home }}/tools/android update sdk -a --no-ui --filter {{ android_build_targets | join(',') }}"
become: yes become: yes
become_user: "{{ android_user }}" become_user: "{{ android_user }}"
# Put Android package names into a list for easier installation command
- name: Gather Android packages to download into a list
util_map:
function: 'zip_to_list'
input: "{{ android_tools }}"
args:
- "package"
register: android_packages
# Use the android sdk manager to install the build tools necessary for the edx mobile app # Use the android sdk manager to install the build tools necessary for the edx mobile app
- name: Install other Android tools - name: Install other Android tools
shell: "echo 'y' | {{ android_home }}/tools/android update sdk --no-ui --filter {{ ','.join(android_tools) }}" shell: "echo 'y' | {{ android_home }}/tools/android update sdk -a --no-ui --filter {{ android_packages.function_output | join(',') }}"
become: yes become: yes
become_user: "{{ android_user }}" become_user: "{{ android_user }}"
# The following libraries are only needed to run AVD emulation, not for compiling
- name: Install additional libraries used for Android emulation
apt:
name: "{{ item }}"
update_cache: yes
state: present
with_items: "{{ android_apt_libraries }}"
...@@ -31,9 +31,17 @@ dependencies: ...@@ -31,9 +31,17 @@ dependencies:
# individual android build targets to be downloaded via the android sdk manager # individual android build targets to be downloaded via the android sdk manager
android_build_targets: android_build_targets:
- android-23 - android-23
# other android dependencies that cannot be tested via the android sdk manager - android-21
# other android dependencies that cannot be tested via the android sdk manager. instead, stat the android_test_path
# to test for presence of the package
android_tools: android_tools:
- platform-tools - { package: 'platform-tools', android_test_path: 'platform-tools' }
- build-tools-23.0.3 - { package: 'build-tools-23.0.3', android_test_path: 'build-tools/23.0.3' }
- extra-google-m2repository - { package: 'extra-google-m2repository', android_test_path: 'extras/google/m2repository' }
- extra-android-m2repository - { package: 'extra-android-m2repository', android_test_path: 'extras/android/m2repository' }
- { package: 'sys-img-armeabi-v7a-android-21', android_test_path: 'system-images/android-21/default/armeabi-v7a/' }
- { package: 'sys-img-armeabi-v7a-android-23', android_test_path: 'system-images/android-23/default/armeabi-v7a/' }
# libraries needed for avd(android virtual device) emulation
android_apt_libraries:
- libstdc++6:i386
- lib32z1
...@@ -15,3 +15,21 @@ ...@@ -15,3 +15,21 @@
assert: assert:
that: that:
- "'{{ item }}' in build_targets.stdout" - "'{{ item }}' in build_targets.stdout"
# Put the paths of downloaded packages into a list, so they can be iterated over
# in an assert block
- name: Gather paths of installed Android packages into a list
util_map:
function: 'zip_to_list'
input: "{{ android_tools }}"
args:
- "android_test_path"
register: android_test_paths
# Test that the correct android tools are installed
- name: Verify build tools installed
stat: path={{ android_home }}/{{ item }}
register: android_package_stats
with_items: "{{ android_test_paths.function_output }}"
- with_items: "{{ android_package_stats.results }}"
assert:
that:
- "item.stat.exists == True"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment