-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature #1 | Ionic, Cordova and Android SDK
- Loading branch information
Showing
16 changed files
with
321 additions
and
7 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,26 @@ | ||
--- | ||
- hosts: hosts | ||
|
||
vars_files: ["vars/default.yml"] | ||
|
||
become: true | ||
|
||
pre_tasks: | ||
- name: Install node & npm | ||
apt: | ||
name: "{{item}}" | ||
state: present | ||
with_items: | ||
- nodejs | ||
- npm | ||
|
||
- name: Install cordova and ionic globally | ||
npm: | ||
name: "{{item}}" | ||
global: yes | ||
with_items: | ||
- ionic | ||
- cordova | ||
|
||
roles: | ||
- { role: nickpack.android-sdk } |
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
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,26 @@ | ||
Copyright (c) 2015, Nikki James Pack | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
The views and conclusions contained in the software and documentation are those | ||
of the authors and should not be interpreted as representing official policies, | ||
either expressed or implied, of the FreeBSD Project. |
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,103 @@ | ||
# Ansible Role: Android SDK | ||
|
||
An Ansible Role that installs the Android SDK tools, SDK packages and dependencies on Ubuntu and RedHat based OS'. | ||
|
||
## Requirements | ||
|
||
A recent version of Ubuntu. | ||
|
||
## Role Variables | ||
|
||
Available variables are listed below, along with default values (see `defaults/main.yml`): | ||
|
||
android_sdk_download_location: http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz | ||
|
||
The location to the Android SDK tools package to be installed. | ||
|
||
android_sdk_install_location: /opt | ||
|
||
The location on disk where you'd like to SDK to be installed. | ||
|
||
ubuntu_dependency_packages: | ||
- "libncurses5" | ||
- "libstdc++6" | ||
- "zlib1g" | ||
- "imagemagick" | ||
- "expect" | ||
- "gradle" | ||
- "ant" | ||
- "ccache" | ||
- "autoconf" | ||
- "automake" | ||
- "ant" | ||
- "ccache" | ||
- "python-dev" | ||
- "zlibc" | ||
|
||
A list of aptitude installable build dependency packages. | ||
|
||
ubuntu_precise_dependency_packages: | ||
- "libgd2-xpm" | ||
- "libgphoto2-2" | ||
- "libsane" | ||
- "ia32-libs-multiarch" | ||
|
||
A list of aptitude installable build dependencies for Ubuntu Precise. | ||
|
||
rh_dependency_packages: | ||
- expect | ||
- libstdc++.i686 | ||
- mesa-libGL-devel | ||
- ncurses-libs.i686 | ||
- zlib.i686 | ||
|
||
A list of yum installable build dependencies for RedHat based OS. | ||
|
||
android_sdk_update_path: true | ||
|
||
Whether or not the role should update the PATH in /etc/environment with the relevant android SDK locations | ||
|
||
android_sdk_base_buildtools_version: 20.0.0 | ||
|
||
The main build tools version from the SDK to use, mainly useful for PATH updates. | ||
|
||
android_sdk_tools_to_install: | ||
- build-tools-20.0.0 | ||
- build-tools-19.1.0 | ||
- platform-tools | ||
- tools | ||
- extra-android-support | ||
- extra-google-m2repository | ||
- extra-android-m2repository | ||
android_sdks_to_install: | ||
- android-21 | ||
- android-20 | ||
- android-19 | ||
- android-18 | ||
- android-17 | ||
- android-16 | ||
|
||
The actual Android SDK packages to install using the SDK manager. | ||
|
||
## Example Playbook | ||
|
||
- hosts: appbuild | ||
vars_files: | ||
- vars/main.yml | ||
roles: | ||
- { role: nickp666.android-sdk } | ||
|
||
## License | ||
|
||
BSD | ||
|
||
## Author Information | ||
|
||
This role was created in 2015 by [Nick Pack](https://github.com/nickpack). | ||
|
||
## Contributors | ||
|
||
* @halkeye - Seperated SDK tools, fixed 64bit environment | ||
* @edunham - Fixed 32bit support | ||
* @peterjanes - Added RedHat family support | ||
* @conorsch - Changed conditionals to allow > 14.04 support |
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 @@ | ||
--- | ||
# defaults file for android-sdk | ||
|
||
android_sdk_download_location: http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz | ||
android_sdk_install_location: /opt | ||
|
||
ubuntu_dependency_packages: | ||
- "libncurses5:i386" | ||
- "libstdc++6:i386" | ||
- "zlib1g:i386" | ||
- "imagemagick" | ||
- "expect" | ||
- "gradle" | ||
- "ant" | ||
- "ccache" | ||
- "autoconf" | ||
- "automake" | ||
- "ant" | ||
- "ccache" | ||
- "python-dev" | ||
- "zlibc" | ||
|
||
ubuntu_precise_dependency_packages: | ||
- "libgd2-xpm" | ||
- "libgphoto2-2" | ||
- "libsane" | ||
- "ia32-libs-multiarch" | ||
|
||
rh_dependency_packages: | ||
- expect | ||
- libstdc++.i686 | ||
- mesa-libGL-devel | ||
- ncurses-libs.i686 | ||
- zlib.i686 | ||
|
||
android_sdk_update_path: true | ||
|
||
android_sdk_base_buildtools_version: 23.0.2 # Used for PATH when android_sdk_update_path is true | ||
|
||
android_sdk_tools_to_install: | ||
- "build-tools-{{ android_sdk_base_buildtools_version }}" | ||
- build-tools-19.1.0 | ||
- platform-tools | ||
- tools | ||
- extra-android-support | ||
- extra-google-m2repository | ||
- extra-android-m2repository | ||
android_sdks_to_install: | ||
- android-21 | ||
- android-20 | ||
- android-19 | ||
- android-18 | ||
- android-17 | ||
- android-16 |
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,2 @@ | ||
--- | ||
# handlers file for android-sdk |
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 @@ | ||
{install_date: 'Sat Dec 24 10:47:01 2016', version: v0.0.7} |
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,30 @@ | ||
--- | ||
galaxy_info: | ||
author: Nick Pack | ||
description: "Installs the Android SDK tools, SDKs themselves and applicable application build dependencies" | ||
company: 0xDEADFA11 Ltd | ||
license: BSD | ||
min_ansible_version: 1.2 | ||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- raring | ||
- saucy | ||
- trusty | ||
- xenial | ||
- name: Fedora | ||
versions: | ||
- 18 | ||
- 22 | ||
- 23 | ||
- name: EL | ||
versions: | ||
- 6 | ||
- 7 | ||
galaxy_tags: | ||
- development | ||
- system | ||
- android | ||
- android-sdk | ||
- adb | ||
dependencies: [] |
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,31 @@ | ||
--- | ||
|
||
- name: Check if i386 is enabled | ||
shell: dpkg --print-foreign-architectures | grep i386 | ||
register: result_i386_check | ||
changed_when: result_i386_check.rc == 1 | ||
failed_when: result_i386_check.rc > 1 | ||
when: (ansible_distribution == "Ubuntu" or ansible_distribution == "Linuxmint") and ansible_distribution_version >= "14.04" | ||
|
||
- name: Enable i386 arch in aptitude | ||
command: dpkg --add-architecture i386 | ||
when: (ansible_distribution == "Ubuntu" or ansible_distribution == "Linuxmint") and ansible_distribution_version >= "14.04" and result_i386_check.rc == 1 | ||
|
||
- name: Ensure apt cache is up to date | ||
apt: update_cache=yes | ||
when: (ansible_distribution == "Ubuntu" or ansible_distribution == "Linuxmint") and result_i386_check.rc == 1 | ||
|
||
- name: Install ia32-libs on Ubuntu 12.04 | ||
apt: pkg={{ item }} state=latest | ||
when: (ansible_distribution == "Ubuntu" or ansible_distribution == "Linuxmint") and ansible_distribution_version == "12.04" | ||
with_items: ubuntu_precise_dependency_packages | ||
|
||
- name: Install build dependencies on Ubuntu | ||
apt: pkg={{ item }} state=latest | ||
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Linuxmint" | ||
with_items: "{{ubuntu_dependency_packages}}" | ||
|
||
- name: Install i386 dependencies on RH family | ||
yum: pkg={{ item }} state=latest | ||
when: ansible_distribution == "Fedora" or ansible_distribution == "CentOS" or ansible_distribution == "RedHat" | ||
with_items: rh_dependency_packages |
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,5 @@ | ||
--- | ||
# tasks file for android-sdk | ||
- include: dependencies.yml | ||
- include: sdktools.yml | ||
- include: sdksinstall.yml |
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,4 @@ | ||
--- | ||
|
||
- name: Install Android SDKs for applicable releases | ||
command: "{{ android_sdk_install_location }}/sdk-install.expect" |
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,23 @@ | ||
--- | ||
|
||
- name: Ensure Android SDK tools directory exists | ||
file: path={{ android_sdk_install_location }} state=directory | ||
|
||
- name: Download Android SDK tools | ||
get_url: url={{ android_sdk_download_location }} dest={{ android_sdk_install_location }}/sdk-download.tgz | ||
|
||
- name: Extract Android SDK tools | ||
unarchive: src={{ android_sdk_install_location }}/sdk-download.tgz dest={{ android_sdk_install_location }} copy=no | ||
|
||
- name: Put the SDK install expect script in place | ||
template: src=sdk-install.expect.j2 dest={{ android_sdk_install_location }}/sdk-install.expect mode=0755 | ||
|
||
- name: Change permissions on SDK tools | ||
file: path={{ android_sdk_install_location }}/android-sdk-linux recurse=yes mode=0755 | ||
|
||
- name: Set system wide PATH to contain Android SDK tools | ||
lineinfile: dest=/etc/environment regexp=^PATH line='PATH="/usr/local/sbin:/usr/local/bin:{{ android_sdk_install_location }}/android-sdk-linux/build-tools/{{ android_sdk_base_buildtools_version }}:{{ android_sdk_install_location }}/android-sdk-linux/tools/:{{ android_sdk_install_location }}/android-sdk-linux/build-tools/:{{ android_sdk_install_location }}/android-sdk-linux/platform-tools/:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"' | ||
when: android_sdk_update_path | ||
|
||
- name: Set system wide ANDROID_HOME environment variable | ||
lineinfile: dest=/etc/environment regexp=^ANDROID_HOME line='ANDROID_HOME="{{ android_sdk_install_location }}/android-sdk-linux/"' |
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,8 @@ | ||
#!/usr/bin/expect | ||
|
||
set timeout -1; | ||
spawn {{ android_sdk_install_location }}/android-sdk-linux/tools/android update sdk --all -u -t "{{ (android_sdk_tools_to_install + android_sdks_to_install) | join(',') }}"; | ||
expect { | ||
"Do you accept the license" { exp_send "y\r" ; exp_continue } | ||
eof | ||
} |
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,2 @@ | ||
--- | ||
# vars file for android-sdk |
Submodule nickpack.android-sdk
deleted from
f4a8de
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