Application package from manifest file has a higher priority than the applicationId value in build.gradle (KT-10320)
This commit is contained in:
+5
-2
@@ -38,8 +38,11 @@ public class AndroidSubplugin : KotlinGradleSubplugin {
|
|||||||
|
|
||||||
val mainSourceSet = sourceSets.getByName("main")
|
val mainSourceSet = sourceSets.getByName("main")
|
||||||
val manifestFile = mainSourceSet.manifest.srcFile
|
val manifestFile = mainSourceSet.manifest.srcFile
|
||||||
val applicationPackage = androidExtension.defaultConfig.applicationId
|
val applicationPackage = getApplicationPackageFromManifest(manifestFile) ?: run {
|
||||||
?: getApplicationPackageFromManifest(manifestFile) ?: ""
|
project.logger.warn(
|
||||||
|
"Application package name is not present in the manifest file (${manifestFile.absolutePath})")
|
||||||
|
""
|
||||||
|
}
|
||||||
pluginOptions += SubpluginOption("package", applicationPackage)
|
pluginOptions += SubpluginOption("package", applicationPackage)
|
||||||
|
|
||||||
fun addVariant(sourceSet: AndroidSourceSet) {
|
fun addVariant(sourceSet: AndroidSourceSet) {
|
||||||
|
|||||||
Reference in New Issue
Block a user