fixed HMS dependency in non-huawei flavor
This commit is contained in:
parent
3db806eabe
commit
754b155576
2 changed files with 12 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'com.huawei.agconnect'
|
|
||||||
id 'kotlin-android'
|
id 'kotlin-android'
|
||||||
id 'kotlin-kapt'
|
id 'kotlin-kapt'
|
||||||
}
|
}
|
||||||
|
@ -82,6 +81,7 @@ android {
|
||||||
// Google Play
|
// Google Play
|
||||||
dimension "store"
|
dimension "store"
|
||||||
ext.useCrashlytics = true
|
ext.useCrashlytics = true
|
||||||
|
ext.useHMS = false
|
||||||
// generate a universal APK without x86 native libs
|
// generate a universal APK without x86 native libs
|
||||||
ext.useNdkAbiFilters = true
|
ext.useNdkAbiFilters = true
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,7 @@ android {
|
||||||
// Huawei AppGallery
|
// Huawei AppGallery
|
||||||
dimension "store"
|
dimension "store"
|
||||||
ext.useCrashlytics = false
|
ext.useCrashlytics = false
|
||||||
|
ext.useHMS = true
|
||||||
// generate a universal APK without x86 native libs
|
// generate a universal APK without x86 native libs
|
||||||
ext.useNdkAbiFilters = true
|
ext.useNdkAbiFilters = true
|
||||||
}
|
}
|
||||||
|
@ -100,6 +101,7 @@ android {
|
||||||
// cf https://android.izzysoft.de/articles/named/app-modules-2
|
// cf https://android.izzysoft.de/articles/named/app-modules-2
|
||||||
dimension "store"
|
dimension "store"
|
||||||
ext.useCrashlytics = false
|
ext.useCrashlytics = false
|
||||||
|
ext.useHMS = false
|
||||||
// generate APK by ABI, but NDK ABI filters are incompatible with split APK generation
|
// generate APK by ABI, but NDK ABI filters are incompatible with split APK generation
|
||||||
ext.useNdkAbiFilters = false
|
ext.useNdkAbiFilters = false
|
||||||
}
|
}
|
||||||
|
@ -162,7 +164,9 @@ dependencies {
|
||||||
// forked, built by JitPack, cf https://jitpack.io/p/deckerst/pixymeta-android
|
// forked, built by JitPack, cf https://jitpack.io/p/deckerst/pixymeta-android
|
||||||
implementation 'com.github.deckerst:pixymeta-android:706bd73d6e'
|
implementation 'com.github.deckerst:pixymeta-android:706bd73d6e'
|
||||||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||||||
implementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
|
|
||||||
|
// huawei flavor only
|
||||||
|
huaweiImplementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
|
||||||
|
|
||||||
kapt 'androidx.annotation:annotation:1.3.0'
|
kapt 'androidx.annotation:annotation:1.3.0'
|
||||||
kapt 'com.github.bumptech.glide:compiler:4.13.0'
|
kapt 'com.github.bumptech.glide:compiler:4.13.0'
|
||||||
|
@ -177,4 +181,8 @@ android.productFlavors.each { flavor ->
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
}
|
}
|
||||||
|
if (tasks.contains(flavor.name) && flavor.ext.useHMS) {
|
||||||
|
println("Building flavor with HMS [${flavor.name}] - applying plugin")
|
||||||
|
apply plugin: 'com.huawei.agconnect'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,10 @@ buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.1.3'
|
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
// GMS & Firebase Crashlytics are not actually used by all flavors
|
// GMS & Firebase Crashlytics (used by some flavors only)
|
||||||
classpath 'com.google.gms:google-services:4.3.10'
|
classpath 'com.google.gms:google-services:4.3.10'
|
||||||
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
|
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
|
||||||
// HMS
|
// HMS (used by some flavors only)
|
||||||
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
|
classpath 'com.huawei.agconnect:agcp:1.5.2.300'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue