Application package from manifest file has a higher priority than the applicationId value in build.gradle (KT-10320)

This commit is contained in:
Yan Zhulanow
2015-12-08 18:05:44 +03:00
parent 009e3f9cd7
commit ac9a1350c2
@@ -38,8 +38,11 @@ public class AndroidSubplugin : KotlinGradleSubplugin {
val mainSourceSet = sourceSets.getByName("main")
val manifestFile = mainSourceSet.manifest.srcFile
val applicationPackage = androidExtension.defaultConfig.applicationId
?: getApplicationPackageFromManifest(manifestFile) ?: ""
val applicationPackage = getApplicationPackageFromManifest(manifestFile) ?: run {
project.logger.warn(
"Application package name is not present in the manifest file (${manifestFile.absolutePath})")
""
}
pluginOptions += SubpluginOption("package", applicationPackage)
fun addVariant(sourceSet: AndroidSourceSet) {