Skip to content

Instantly share code, notes, and snippets.

@lifuzu
Forked from goldierox/build.gradle
Created May 8, 2014 23:27
Show Gist options
  • Select an option

  • Save lifuzu/fbe5ecb0857e37cdd3ad to your computer and use it in GitHub Desktop.

Select an option

Save lifuzu/fbe5ecb0857e37cdd3ad to your computer and use it in GitHub Desktop.
android.applicationVariants.all{ variant ->
// This is an annoying hack to get around the fact that the Gradle plugin does not support
// having libraries with different minSdkVersions. Play Services has a min version of 9 (Gingerbread)
// but Android Maps Utils supports 8 (Froyo) still
variant.processManifest.doFirst {
File manifestFile = file("${buildDir}/exploded-bundles/ComGoogleMapsAndroidAndroidMapsUtils03.aar/AndroidManifest.xml")
if (manifestFile.exists()) {
println("Replacing minSdkVersion in Android Maps Utils")
String content = manifestFile.getText('UTF-8')
content = content.replaceAll(/minSdkVersion="8"/, 'minSdkVersion=\"9\"')
manifestFile.write(content, 'UTF-8')
println(content)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment