ru.astrainteractive.gradleplugin.AndroidNamespacePlugin.kt Maven / Gradle / Ivy
package ru.astrainteractive.gradleplugin
import com.android.build.gradle.BaseExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.findByType
import ru.astrainteractive.gradleplugin.property.extension.ModelPropertyValueExt.hierarchyGroup
class AndroidNamespacePlugin : Plugin {
override fun apply(target: Project) {
val baseExtension = target.extensions.findByType()
if (baseExtension?.namespace.isNullOrBlank()) {
baseExtension?.namespace = target.hierarchyGroup
}
}
}