Created
July 25, 2014 14:06
-
-
Save Sefford/0f360cc38b3898335710 to your computer and use it in GitHub Desktop.
This method will switch minSDKVersion of RecyclerLibrary on compile time for version 13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
applicationVariants.all{ variant -> | |
// This is a terrible hacky way of compile-time changing all the libraries | |
// minSDKs to SDK 13. This script has to be mantained everytime you update | |
// any of these libraries or the plugin updates. | |
variant.processManifest.doFirst { | |
File manifestFile = file("${buildDir}/intermediates/exploded-aar/com.android.support/recyclerview-v7/21.0.0-rc1/AndroidManifest.xml") | |
if (manifestFile.exists()) { | |
println("Replacing minSdkVersion of RecyclerView-V7 library") | |
String content = manifestFile.getText('UTF-8') | |
content = content.replaceAll(/minSdkVersion="L"/, 'minSdkVersion=\"13\"') | |
manifestFile.write(content, 'UTF-8') | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment