Skip to content

Instantly share code, notes, and snippets.

@PhoenixIllusion
Created December 3, 2015 18:32
Show Gist options
  • Save PhoenixIllusion/483382e7177241297ed7 to your computer and use it in GitHub Desktop.
Save PhoenixIllusion/483382e7177241297ed7 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