com.likethesalad.placeholder.data.helpers.wrappers.ApplicationVariantWrapper.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of string-reference Show documentation
Show all versions of string-reference Show documentation
This is a Gradle plugin for Android applications which resolves XML string references in other XML strings.
package com.likethesalad.placeholder.data.helpers.wrappers
class ApplicationVariantWrapper(private val applicationVariant: Any) {
private val clazz = applicationVariant.javaClass
private val getNameMethod by lazy { clazz.getMethod("getName") }
private val getFlavorNameMethod by lazy { clazz.getMethod("getFlavorName") }
fun getName(): String {
return getNameMethod.invoke(applicationVariant) as String
}
fun getFlavorName(): String {
return getFlavorNameMethod.invoke(applicationVariant) as String
}
}