-
Notifications
You must be signed in to change notification settings - Fork 378
Expand file tree
/
Copy pathbuild.gradle
More file actions
122 lines (108 loc) · 3.88 KB
/
Copy pathbuild.gradle
File metadata and controls
122 lines (108 loc) · 3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
namespace 'com.onesignal.sdktest'
compileSdkVersion 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 34
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
flavorDimensions "default"
}
// signingConfigs {
// huawei {
// storeFile file('SdkTest.jks')
// keyAlias 'SdkTest'
// keyPassword ''
// storePassword ''
// v1SigningEnabled true
// v2SigningEnabled true
// }
// }
productFlavors {
gms {
dimension "default"
applicationId "com.onesignal.sdktest"
}
huawei {
dimension "default"
minSdkVersion 21
applicationId "com.onesignal.sdktest"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
// signingConfig null
// productFlavors.huawei.signingConfig signingConfigs.huawei
debuggable true
// Note: profileable is automatically enabled when debuggable=true
// Enable method tracing for detailed performance analysis
testCoverageEnabled false
}
// Profileable release build for performance testing
profileable {
initWith release
debuggable false
profileable true
minifyEnabled false
signingConfig signingConfigs.debug
matchingFallbacks = ['release']
}
}
kotlinOptions {
jvmTarget = '1.8'
}
// Forced downgrade to Java 1.8 for compiling the application due to Android N error when building
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'androidsupportmultidexversion.txt'
}
task flavorSelection() {
def tasksList = gradle.startParameter.taskRequests.toString()
if (tasksList.contains('Gms')) {
apply plugin: 'com.google.gms.google-services'
googleServices { disableVersionCheck = true }
} else if (tasksList.contains('Huawei')) {
apply plugin: 'com.huawei.agconnect'
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'com.google.android.gms:play-services-location:21.0.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
/** START - Google Play Builds **/
gmsImplementation("com.onesignal:OneSignal:$SDK_VERSION")
/** END - Google Play Builds **/
/** START - Huawei Builds **/
// Omit Google / Firebase libraries for Huawei builds.
huaweiImplementation("com.onesignal:OneSignal:$SDK_VERSION") {
exclude group: 'com.google.android.gms', module: 'play-services-gcm'
exclude group: 'com.google.android.gms', module: 'play-services-analytics'
exclude group: 'com.google.android.gms', module: 'play-services-location'
exclude group: 'com.google.firebase', module: 'firebase-messaging'
}
// Add HMS Push library
huaweiImplementation 'com.huawei.hms:push:6.3.0.304'
// Optionally add HMS location
huaweiImplementation 'com.huawei.hms:location:4.0.0.300'
/** END - Huawei Builds **/
}