Skip to content

Instantly share code, notes, and snippets.

@billmote
Forked from PhoenixIllusion/build.gradle
Created December 4, 2015 16:22
Show Gist options
  • Save billmote/cedf1e2771613ac36009 to your computer and use it in GitHub Desktop.
Save billmote/cedf1e2771613ac36009 to your computer and use it in GitHub Desktop.
Using the local.properties file of an Android Studio project to select the latest BuildTools version
apply plugin: 'com.android.library'
android {
compileSdkVersion 'Google Inc.:Google APIs:22'
Properties localProps = new Properties()
localProps.load(new FileInputStream(file('../local.properties')))
def buildToolVer = file("${localProps['sdk.dir']}/build-tools/").listFiles().sort().reverse().first().name;
buildToolsVersion buildToolVer;
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
publishNonDefault true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment