Fix project reference in task

This commit is contained in:
andrew
2023-08-15 18:42:49 +09:30
parent b09b6836d4
commit 7c8882e1f3
2 changed files with 4 additions and 3 deletions

View File

@@ -42,8 +42,9 @@ def abiPostFix = ['armeabi-v7a' : 1,
'universal' : 5]
tasks.register('checkHuaweiEnabled') {
ext.huaweiEnabled = project.hasProperty('huawei')
doFirst {
if (!project.hasProperty('huawei')) {
if (!huaweiEnabled) {
def message = 'Huawei is not enabled. Please add -Phuawei command line arg. See README.'
logger.error(message)
throw new GradleException(message)
@@ -194,7 +195,7 @@ android {
applicationVariants.all { variant ->
if (variant.flavorName == 'huawei') {
variant.preBuild.dependsOn checkHuaweiEnabled
variant.getPreBuildProvider().get().dependsOn checkHuaweiEnabled
}
}
}