Update android/build.gradle
This commit is contained in:
+10
-5
@@ -28,12 +28,12 @@ subprojects {
|
|||||||
tasks.register("clean", Delete) {
|
tasks.register("clean", Delete) {
|
||||||
delete rootProject.buildDir
|
delete rootProject.buildDir
|
||||||
}
|
}
|
||||||
subprojects {
|
subprojects { proj ->
|
||||||
afterEvaluate { project ->
|
def fixNamespace = {
|
||||||
if (project.hasProperty('android')) {
|
if (proj.hasProperty('android')) {
|
||||||
def androidExt = project.extensions.findByName('android')
|
def androidExt = proj.extensions.findByName('android')
|
||||||
if (androidExt != null && androidExt.hasProperty('namespace') && (androidExt.namespace == null || androidExt.namespace == '')) {
|
if (androidExt != null && androidExt.hasProperty('namespace') && (androidExt.namespace == null || androidExt.namespace == '')) {
|
||||||
def manifestFile = project.file('src/main/AndroidManifest.xml')
|
def manifestFile = proj.file('src/main/AndroidManifest.xml')
|
||||||
if (manifestFile.exists()) {
|
if (manifestFile.exists()) {
|
||||||
def manifestText = manifestFile.text
|
def manifestText = manifestFile.text
|
||||||
def matcher = manifestText =~ /package="([^"]+)"/
|
def matcher = manifestText =~ /package="([^"]+)"/
|
||||||
@@ -44,4 +44,9 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (proj.state.executed) {
|
||||||
|
fixNamespace()
|
||||||
|
} else {
|
||||||
|
proj.afterEvaluate { fixNamespace() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user