Giter VIP home page Giter VIP logo

puppet-android's Introduction

Puppet Module for Android SDK

Build Status

This Puppet module is used to install the Android SDK and NDK, along with platforms and other add-ons. You may need to install Java separately.

Supported platforms:

  • Linux (RedHat, Debian families)
  • Mac OS X

Examples

To install the Android SDK in the default location (/usr/local/android on both Linux and Mac OS X) you simply include the android class like so.

class { 'java': } ->
class { 'android': }

You can also change the default parameters like so:

  class { 'android':
    user       => 'someuser',
    group      => 'somegroup',
    installdir => '/path/to/your/dir',
  }

You can install the Android NDK like so:

class { 'android::ndk' :
  ndk_version => 'android-ndk-r10c-linux-x86_64.bin'
}

Note that the NDK is downloaded and executed, so only newer NDK versions are supported. The older tar archives will not work properly.

To install an android platform, do it like so:

  android::platform { 'android-16': }

You can also install add-ons:

  android::addon { 'addon-google_apis-google-16': }

Or extra's:

  android::extra { 'extra-google-play_billing': }

To install Android SDK Build-tools, revision 19.0.1

  android::build_tools { 'build-tools-19.0.1': }

Tip: to get the appropriate name of the add-ons/extras run the following command:

/usr/local/android/android-sdk-macosx/tools/android list sdk -u --all --extended|grep " or "

License

  Copyright 2012-2014 MaestroDev

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

puppet-android's People

Contributors

brettporter avatar carlossg avatar gildor478 avatar hameno avatar hco avatar ijansch avatar jlambert121 avatar mykter avatar paulccarey avatar quiffman avatar stkerr avatar xadh00m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

puppet-android's Issues

Installer doesn't recognize installed extra's

If I include any of the 'extra' add-ons, then they are installed every time puppet runs. It's as if the manifest doesn't recognize that they are already installed.

Manifest:

android::addon { 'extra-google-play_billing': }

Run 1:
Android::Addon[extra-google-play_billing]/Android::Package[extra-google-play_billing]/Exec[update-android-package-extra-google-play_billing]/returns: executed successfully

Run 2:
Android::Addon[extra-google-play_billing]/Android::Package[extra-google-play_billing]/Exec[update-android-package-extra-google-play_billing]/returns: executed successfully

(I verified that it has indeed installed, it just continues to run it)

Add resource for system images

Currently there are resources to install platforms, platform tools, build tools, addons, and extras. A resource should be added allow installing system images (ABIs).

Failed download still registered as success

  1. Use a non-existing add-on name, e.g. 'something-that-doesnt-exist'
  2. Run puppet agent

Expected -> Task fails
Actual -> Task seems to succeed (but nothing is downloaded and on the next run it will retry).

Tested on osx.

Source error on OSX

I'm trying to install android sdks using this plugin, but am getting this error message:

Error: Mac OS X PKG DMG's must specify a package source

I'm using 1.6.1 (installed using puppet's module install method).

This is the relevant part of my manifest:

include 'android'

class buildozer::osx {
android::platform { 'android-16': }
}

Server is running Puppet 3.4.2, Client is OSX Mavericks.

Forge release?

There seems to be some work here, specifically the android::ndk class, that isn't present in the latest release. Would it be possible to get a release cut?

Unable to download certain add-ons

This works:

android::addon { 'addon-google_apis-google-19': }

But this doesn't:

android::addon { 'addon-google_apis-google-14': }

It seems only 16 - 19 can be downloaded this way, but I can't seem to get lower versions to download. The name as it appears in android-sdk-macosx/add-ons does seem to match the download, but still it doesn't download anything.

forge module update

The latest version of this module on the Forge is 1.2.0, which is a year old. Would it be possible to get the current version released?

Thanks.

Multilib Issue with zlib

Trying to install on CentOS 7 and keep running into:

`Error: /Stage[main]/Xm_jenkins_common::Slave/Package[zlib.i686]/ensure: change from absent to present failed: Execution of '/bin/yum -d 0 -e 0 -y install zlib.i686' returned 1: Error: Multilib version problems found. This often means that the root
cause is something else and multilib version checking is just
pointing out that there is a problem. Eg.:

     1. You have an upgrade for zlib which is missing some
        dependency that another package requires. Yum is trying to
        solve this by installing an older version of zlib of the
        different architecture. If you exclude the bad architecture
        yum will tell you what the root cause is (which package
        requires what). You can try redoing the upgrade with
        --exclude zlib.otherarch ... this should give you an error
        message showing the root cause of the problem.

     2. You have multiple architectures of zlib installed, but
        yum can only see an upgrade for one of those architectures.
        If you don't want/need both architectures anymore then you
        can remove the one with the missing update and everything
        will work.

     3. You have duplicate versions of zlib installed already.
        You can use "yum check" to get yum show these errors.

   ...you can also use --setopt=protected_multilib=false to remove
   this checking, however this is almost never the correct thing to
   do as something else is very likely to go wrong (often causing
   much more problems).

   Protected multilib versions: zlib-1.2.7-17.el7.i686 != zlib-1.2.7-15.el7.x86_64`

Found a way to update packages to certain revision, pull request?

Hi!

I've been using your module for a while to support a dozen Linux build servers with Android SDK.

We have some legacy apps to support, so we need different versions of build tools, and the developers would often ask me to update this or that package (but not all of them).

To keep track on this, I've tweaked package.pp adding $revision parameter and an unless for exec:

unless  => "grep 'Pkg.Revision=${revision}' ${creates}/source.properties",

So my Android SDK definition looks a bit noisier:

  android::platform { 'android-13': revision => '1' }
  android::platform { 'android-12': revision => '3' }
  android::platform { 'android-11': revision => '2' }
  android::platform { 'android-10': revision => '2' }

  android::extra { 'extra-android-m2repository':              revision => '14.0.0' }
  android::extra { 'extra-android-support':                   revision => '22.1.1' }
  android::extra { 'extra-google-admob_ads_sdk':              revision => '11.0.0' }
  android::extra { 'extra-google-analytics_sdk_v2':           revision => '3.0.0' }
  android::extra { 'extra-google-gcm':                        revision => '3.0.0' }

It also requires some familiarity with command-line package manager, but it made the whole process A LOT easier for me as a sysadmin.

It adds one extra grep per package defined, but with around three dozens of these I'm having roughly the same agent run time as without them.

Should I create a pull request for that or does it make things unnecessarily complicated?

installdir adds /android

Setting installdir to /home/user/Android/Sdk, puts sdk in /home//Android/Sdk/android
Android Studio 2.0 wants to find sdk in /home/user/Android/Sdk (no trailing android)

You can change the default SDK install dir in Android Studio after it comes up, but the default is
/home/user/Android/Sdk so it assumes this location.

Also, Is there a way to tell Android Studio/SDK Manager these downloads, extras, addons, ... have been installed by some tool other than it? I installed via puppet-android, and moved the android dir to Android/Sdk but Studio was not able to detect items were already installed.

NDK ownership

Android::ndk sets the ownership (user and group) to android::user and android::group for the downloaded installer executable, but the actual installed NDK ends up still owned root:root and un-executable by other users.

OS X doesn't have wget by default

Simply. OS X doesn't have wget. It does not come packaged by default. The only way to have wget install on OS X is by using brew or macports. curl is typically included with all distributions and should be used over wget.

This module's documentation makes reference to installing the Android SDK (ADT) on OS X so I would have assumed this was sorted. But even the dependency module maestrodev-wget conditionally doesn't attempt to install wget on OS X (Darwin). Which means this module could never work with OS X.

ia32-libs doesn't get installed in Debian

In sdk.pp there is the following code:

# For 64bit systems, we need to install some 32bit libraries for the SDK
# to work.
if ($::kernel == 'Linux') and ($::architecture == 'x86_64') {
    case $::osfamily {
        'RedHat': {
            $32bit_packages =  [ 'glibc.i686', 'zlib.i686', 'libstdc++.i686' ]
        }
        'Debian': {
            $32bit_packages =  [ 'ia32-libs' ]
        }

I'm using Debian Squeeze with puppet 3.1.1-1puppetlabs1 installed from the APT official repository. The problem comes from facter $architecture variable:

# facter|grep archi 
architecture => amd64

And like 'x86_64' != 'amd64' then ia32-libs package doesn't get installed.

Problems on Ruby 1.8.7

Hey,

I got a brand new MacBook Pro and what I'm trying to do is setting it up from scratch with github boxen.

The standard Ruby on this machine is 1.8.7 which makes the newer syntax unusable. But I do have to use 1.8.7 since Ruby and Rbenv is not set up at this point.

I'm trying to install multiple Android Versions with following code:

  [9, 10, 14, 15, 16, 17].each { |version| android::platform { "android-#{version}": } }

and get the following error:

  Error: Could not parse for environment production: Syntax error at '.'; expected '}'

New puppet support

New puppet version(3.4.3) changed syntax:

The given name Android:Sdk does not conform to the naming rule /^((::)?[a-z_]w_)(::[a-z]w_)*$/ at /etc/puppet/modules/android/manifests/package.pp:67:23
63 exec { "update-android-package-${title}":
64 command => "/usr/bin/expect -f ${android::installdir}/expect-install-${title}",
65 creates => $creates,
66 timeout => 0,
67 require => [Class['Android::Sdk']],
68 }

SDK update not working for old archives

Some packages are not installing. When run the command manually, I get:
Error: Ignoring unknown package filter (package name)

-a / --all switch is missing when running android update

system images will be reinstalled on every puppet run

So, I'm installing:

android::system_images { ['sys-img-armeabi-v7a-android-22', 'sys-img-x86_64-android-22', 'sys-img-x86-android-22']: }

This is the logic to run the exec package.pp#L35:

   'system-images': {
      $title_parts = split($title, '-')
      $creates = "${android::paths::sdk_home}/system-images/android-${title_parts[1]}"
    }

title_parts[1] is resolved to img, or something which is not the platform of android. The paths you want are, instead:

  • ${android::paths::sdk_home}/system-images/android-22/default/armeabi-v7a
  • ${android::paths::sdk_home}/system-images/android-22/default/x86
  • ${android::paths::sdk_home}/system-images/android-22/default/x86_64

I tried with system images of other platforms too, and they were all installed on the same place. I'm using SDK '24.3.3', maybe that's the reason why it changed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.