Android SDK Download as part of Gradle Build

I'm trying to build an Android app with Jenkins, and I have little control over Jenkins subordinate machines.

To create the application, I need the Android SDK installed on the slave, otherwise I get as expected:

"SDK location not found. Locate using sdk.dir in local.properties file or with ANDROID_HOME environment variable."

In that case, is it possible to gradle configure the SDK loading as part of the build process and use it as a normal dependency?

Does that even make sense?

Thanks for the help.

+6
source share
2 answers

Android Gradle ; , , Android SDK, , .

, Android Studio (, -), , Android SDK Jenkins.

license/ Android SDK, licenses/.

+2

, . gradle , SDK

gradle

classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'

build.gradle "android":

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

: .

+1

All Articles