-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathbuild.gradle
54 lines (46 loc) · 1.31 KB
/
build.gradle
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
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
def isNewArchitectureEnabled() {
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}
if (isNewArchitectureEnabled()) {
apply plugin: 'com.facebook.react'
}
android {
compileSdk safeExtGet('compileSdkVersion', 33)
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace "com.braze.reactbridge"
buildFeatures {
buildConfig true
}
}
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 33)
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
versionCode 1
versionName '1.0'
}
sourceSets {
main {
if (isNewArchitectureEnabled()) {
java.srcDirs += ['src/newarch']
res.srcDirs += ['src/newarch/res']
} else {
java.srcDirs += ['src/oldarch']
res.srcDirs += ['src/oldarch/res']
}
}
}
kotlinOptions {
freeCompilerArgs = ['-Xjvm-default=all']
}
}
dependencies {
api 'com.braze:android-sdk-ui:31.1.0'
api 'com.facebook.react:react-native:+'
}