main.name.remal.gradle_plugins.dsl.extensions.kotlin.reflect.KClass-PluginId.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-plugins-kotlin-dsl Show documentation
Show all versions of gradle-plugins-kotlin-dsl Show documentation
Remal Gradle plugins: gradle-plugins-kotlin-dsl
The newest version!
package name.remal.gradle_plugins.dsl.extensions
import name.remal.gradle_plugins.dsl.PluginId
import kotlin.reflect.KClass
fun KClass.getOrInstantiate(): T {
try {
this.objectInstance?.let { return it }
} catch (ignored: IllegalAccessException) {
// do nothing
}
return this.java.getDeclaredConstructor().makeAccessible().newInstance()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy