SDK Manager

Gradle plugin which downloads and manages your Android SDK.

License

License

Categories

Categories

Gradle Build Tools
GroupId

GroupId

com.jakewharton.sdkmanager
ArtifactId

ArtifactId

gradle-plugin
Last Version

Last Version

0.12.0
Release Date

Release Date

Type

Type

jar
Description

Description

SDK Manager
Gradle plugin which downloads and manages your Android SDK.
Project URL

Project URL

https://github.com/JakeWharton/sdk-manager-plugin
Source Code Management

Source Code Management

https://github.com/JakeWharton/sdk-manager-plugin

Download gradle-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.jakewharton.sdkmanager/gradle-plugin/ -->
<dependency>
    <groupId>com.jakewharton.sdkmanager</groupId>
    <artifactId>gradle-plugin</artifactId>
    <version>0.12.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.jakewharton.sdkmanager/gradle-plugin/
implementation 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
// https://jarcasting.com/artifacts/com.jakewharton.sdkmanager/gradle-plugin/
implementation ("com.jakewharton.sdkmanager:gradle-plugin:0.12.0")
'com.jakewharton.sdkmanager:gradle-plugin:jar:0.12.0'
<dependency org="com.jakewharton.sdkmanager" name="gradle-plugin" rev="0.12.0">
  <artifact name="gradle-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.jakewharton.sdkmanager', module='gradle-plugin', version='0.12.0')
)
libraryDependencies += "com.jakewharton.sdkmanager" % "gradle-plugin" % "0.12.0"
[com.jakewharton.sdkmanager/gradle-plugin "0.12.0"]

Dependencies

compile (3)

Group / Artifact Type Version
com.android.tools.build : gradle jar 0.12.1
org.rauschig : jarchivelib jar 0.6.0
commons-io : commons-io jar 2.4

test (1)

Group / Artifact Type Version
org.easytesting : fest-assert-core jar 2.0M10

Project Modules

There are no modules declared in this project.

DEPRECATED

This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the Android Gradle plugin or newer.

SDK Manager Plugin

SDK missing? API level not downloaded? Support library out-of-date?

These are all typical problems which you shouldn't have to deal with. This is especially painful when you have multiple developers on a project or a CI machine that you have to keep up-to-date.

This Gradle plugin will manage these SDK dependencies for you automatically.

Supported functionality:

  • local.properties will be created if missing. The ANDROID_HOME environment variable will be used if present. Otherwise ~/.android-sdk will be used.
  • The platform-specific SDK will be downloaded if missing.
  • The build tools and platform tools will be downloaded if missing.
  • Compilation API declared in compileSdkVersion will be downloaded if missing.
  • If any dependencies are declared on support libraries, the support repository will be downloaded if missing. If the revision of the support repository does not contain the version declared it will be updated.
  • If any dependencies are declared on Google Play Services, the Google repository will be downloaded if missing. If the revision of the Google repository does not contain the version declared it will be updated.
  • If an emulator is specified, it will be downloaded if missing. If the emulator revision is less than the available revision, it will be updated.

Note: By using this plugin you acknowledge that associated licenses of the components downloaded are accepted automatically on your behalf. You are required to have accepted the respective licenses of these components prior to using this plugin.

Usage

Apply the plugin in your build.gradle before the regular 'android' plugin:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:0.12.+'
    classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
  }
}

apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'

// optionally including an emulator
sdkManager {
  emulatorVersion 'android-19'
  emulatorArchitecture 'armeabi-v7a' // optional, defaults to arm
}

On an initial run, the output will look something like this:

$ ./gradlew clean assemble
Android SDK not found. Downloading...
SDK extracted at '/Users/jw/.android-sdk'. Writing to local.properties.
Build tools 20.0.0 missing. Downloading...
Compilation API android-19 missing. Downloading...
Support library repository missing. Downloading...
Google Play Services repository missing. Downloading...
Emulator version not installed or outdated. Downloading...

(normal execution output)

Your output likely will be different depending on the varying factors listed above. Subsequent runs will omit this output and proceed directly to normal execution.

How long does this plugin add to the build lifecycle? It currently takes about 100ms on average to check all of the above conditions. This cost is only paid when Gradle is setting up the model for the project. If you use the Gradle daemon or use Android Studio this only happens once.

License

Copyright 2014 Jake Wharton

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.

Versions

Version
0.12.0
0.10.1
0.10.0
0.9.1
0.9.0