Sha256: c5665e0416a6250f63cbd0cb413b6f8eb55bb638c84706a757a86735679e1e21

Contents?: true

Size: 1006 Bytes

Versions: 20

Compression:

Stored size: 1006 Bytes

Contents

require 'pathname'
require 'ruboto/util/setup'

module Ruboto
  module SdkLocations
    extend Ruboto::Util::Setup
    if ENV['ANDROID_HOME']
      ANDROID_HOME = ENV['ANDROID_HOME']
    else
      adb_location = which('adb')
      unless adb_location
        raise 'Unable to locate the "adb" command.  Either set the ANDROID_HOME environment variable or add the location of the "adb" command to your path.'
      end
      ANDROID_HOME = File.dirname(File.dirname(Pathname.new(adb_location).realpath))
      unless File.exists? "#{ANDROID_HOME}/tools"
        puts "Found '#{adb_location}' but it is not in a proper Android SDK installation."
      end
    end
    unless File.exists? "#{ANDROID_HOME}/tools"
      raise "The '<ANDROID_HOME>/tools' directory is missing.
Please set the ANDROID_HOME environment variable to a proper Android SDK installation."
    end
    ANDROID_TOOLS_REVISION = File.read("#{ANDROID_HOME}/tools/source.properties").slice(/Pkg.Revision=\d+/).slice(/\d+$/).to_i
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ruboto-1.6.1 lib/ruboto/sdk_locations.rb
ruboto-1.6.0 lib/ruboto/sdk_locations.rb
ruboto-1.5.0 lib/ruboto/sdk_locations.rb
ruboto-1.4.1 lib/ruboto/sdk_locations.rb
ruboto-1.4.0 lib/ruboto/sdk_locations.rb
ruboto-1.3.1 lib/ruboto/sdk_locations.rb
ruboto-1.3.0 lib/ruboto/sdk_locations.rb
ruboto-1.2.0 lib/ruboto/sdk_locations.rb
ruboto-1.1.2 lib/ruboto/sdk_locations.rb
ruboto-1.1.1 lib/ruboto/sdk_locations.rb
ruboto-1.1.0 lib/ruboto/sdk_locations.rb
ruboto-1.0.3 lib/ruboto/sdk_locations.rb
ruboto-1.0.2 lib/ruboto/sdk_locations.rb
ruboto-1.0.1 lib/ruboto/sdk_locations.rb
ruboto-1.0.0 lib/ruboto/sdk_locations.rb
ruboto-0.16.0 lib/ruboto/sdk_locations.rb
ruboto-0.15.0 lib/ruboto/sdk_locations.rb
ruboto-0.14.0 lib/ruboto/sdk_locations.rb
ruboto-0.13.0 lib/ruboto/sdk_locations.rb
ruboto-0.13.0.rc.0 lib/ruboto/sdk_locations.rb