Skip to content

Instantly share code, notes, and snippets.

View nkraev's full-sized avatar

Nikita Kraev nkraev

View GitHub Profile
anonymous
anonymous / build.gradle
Created December 25, 2017 14:13
Variant-aware configuration for replacing strings in manifest (as placeholders) and resources
android.applicationVariants.all { variant ->
String propsName = "../local/${variant.baseName}.properties"
Properties props = new Properties()
props.load(new FileInputStream(file(propsName)))
println "Building \"${variant.baseName}\" tag..."
props.stringPropertyNames().forEach {
variant.resValue("string", it, props[it])
}