Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.cookpad:gradle-android-sdk-manager:'
}
dependencies {
implementation("com.github.cookpad:gradle-android-sdk-manager:")
}
<dependency>
<groupId>com.github.cookpad</groupId>
<artifactId>gradle-android-sdk-manager</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.cookpad" % "gradle-android-sdk-manager" % ""
:dependencies [[com.github.cookpad/gradle-android-sdk-manager ""]]
This library is no longer maintained. Use https://github.com/JakeWharton/sdk-manager-plugin instead.
This plugin manages Android SDK and build tools for gradle.
apply from: 'https://raw2.github.com/cookpad/gradle-android-sdk-manager/master/sdk_manager.gradle'
readLocalPropertiesValue("sdk.dir") // => /usr/local/opt/android-sdk
readLocalPropertiesValue("ndk.dir") // => /usr/local/opt/android-ndk
guessSdkDir()
guessNdkDir()
Find the following paths for a SDK directory in the following order:
android(1)
has a headless mode to install android development tools from terminals.
installRequiredSdk()
installs build tools with specified versions declared in build.gradle
.
android {
compileSdkVersion 18
buildToolsVersion '19.0.1'
// installs Android SDK 18 and build tools 19.0.1
// with "sdk.dir" value from local.properties
installRequiredSdk(android)
// or you can pass the sdk dir explicitly
installRequiredSdk(android, "/Applications/Android Studio.app/sdk")
...
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)