Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install android tools r25.2.3 concurrently #639

Merged

Concurrently install Android r25.2.3 tools

Install a new version of the Android tools along with the old one.
Keep the old version as the current version for now to avoid breaking
builds, but still make the new version available.
This will also make future upgrades more smooth as well.

Switch to the new URL scheme for SDK downloads,
which also has switched to using zip files instead of .tar.gz files.
Note that the new packaging format
no longer has a top-level `android-sdk-linux` folder.

Move the `build_tools` and `platform` attributes under `sdk`,
as they are only used with the SDK-related states.

Reinstate `if_missing` for the SDK `archive.extracted` state to ensure
that the new archive will be extracted if the old one is present,
so that the SDK has the correct directory layout.
This also means ownership will only be updated for that file
(the `android` binary), so add a `file.directory` state to handle
fixing the ownership for the rest of the extracted files,
and fixup the requisites as necessary.
  • Loading branch information
MortimerGoro authored and aneeshusa committed Apr 20, 2017
commit e2a50d5fa26325da65b90ee1119f7efb8b4e58b5
@@ -54,47 +54,61 @@ android-dependencies:
- require:
- pkg: pip
android-sdk:
{% for version, sdk in android.sdk.items() if version != 'current' %}
android-sdk-{{ version }}:
archive.extracted:
- name: {{ common.servo_home }}/android/sdk/{{ android.sdk.version }}
- source: https://dl.google.com/android/android-sdk_{{ android.sdk.version }}-linux.tgz
- source_hash: sha512={{ android.sdk.sha512 }}
- archive_format: tar
- name: {{ common.servo_home }}/android/sdk/{{ version }}
- source: https://dl.google.com/android/repository/tools_{{ version }}-linux.zip
- source_hash: sha512={{ sdk.sha512 }}
- archive_format: zip
# Workaround for https://github.com/saltstack/salt/pull/36552
- archive_user: servo
- user: servo
- group: servo
# Use this to ensure the SDK on disk has the correct directory layout,
# and use the subsequent `file.directory` state to fix ownership.
- if_missing: {{ common.servo_home }}/android/sdk/{{ version }}/tools/android
- require:
- user: servo
file.directory:
- name: {{ common.servo_home }}/android/sdk/{{ version }}
- user: servo
- group: servo
- recurse:
- user
- group
- require:
- pkg: android-dependencies
- user: servo
- archive: android-sdk-{{ version }}
cmd.run:
- name: |
expect -c '
set timeout -1;
spawn {{ common.servo_home }}/android/sdk/{{ android.sdk.version }}/android-sdk-linux/tools/android - update sdk --no-ui --all --filter platform-tools,android-{{ android.platform }},build-tools-{{ android.build_tools }};
spawn {{ common.servo_home }}/android/sdk/{{ version }}/tools/android - update sdk --no-ui --all --filter platform-tools,android-{{ sdk.platform }},build-tools-{{ sdk.build_tools }};
expect {
"Do you accept the license" { exp_send "y\r" ; exp_continue }
eof
}
'
- runas: servo
- creates:
- {{ common.servo_home }}/android/sdk/{{ android.sdk.version }}/android-sdk-linux/platform-tools
- {{ common.servo_home }}/android/sdk/{{ android.sdk.version }}/android-sdk-linux/platforms/android-{{ android.platform }}
- {{ common.servo_home }}/android/sdk/{{ android.sdk.version }}/android-sdk-linux/build-tools/{{ android.build_tools }}
- {{ common.servo_home }}/android/sdk/{{ version }}/platform-tools
- {{ common.servo_home }}/android/sdk/{{ version }}/platforms/android-{{ sdk.platform }}
- {{ common.servo_home }}/android/sdk/{{ version }}/build-tools/{{ sdk.build_tools }}
- require:
- pkg: android-dependencies
- archive: android-sdk
- file: android-sdk-{{ version }}
{% endfor %}
android-sdk-current:
file.symlink:
- name: {{ common.servo_home }}/android/sdk/current
- target: {{ common.servo_home }}/android/sdk/{{ android.sdk.version }}/android-sdk-linux
- target: {{ common.servo_home }}/android/sdk/{{ android.sdk.current }}
- user: servo
- group: servo
- require:
- cmd: android-sdk
- cmd: android-sdk-{{ android.sdk.current }}
android-ndk:
@@ -1,10 +1,17 @@
{%
set android = {
'build_tools': '23.0.3',
'platform': '18',
'sdk': {
'version': 'r24.4.1',
'sha512': '96fb71d78a8c2833afeba6df617edcd6cc4e37ecd0c3bec38c39e78204ed3c2bd54b138a56086bf5ccd95e372e3c36e72c1550c13df8232ec19537da93049284'
'current': 'r24.4.1',
'r24.4.1': {
'build_tools': '23.0.3',
'platform': '18',
'sha512': '778f43ab1d220bdc30087759862d2c0f3fa59e44122cc99666d57f37f69d46b14e4b8583e20234e23aaed4e291f5a21e607d08f69a2a9e73332889091054b8c9',
},
'r25.2.3': {
'build_tools': '25.0.2',
'platform': '25',
'sha512': 'dfc30ee3e2714cf8008ab1f99757deded002d21b23a8d2ab07952e1afd1c93124ddec06660babf6a46c54e5e7e135c8c0cb4cc512378a8509da074dbf7e253d7'
}
},
'ndk': {
'version': 'r12b',
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.