-
Notifications
You must be signed in to change notification settings - Fork 221
Expand file tree
/
Copy pathbuild.gradle
More file actions
executable file
·78 lines (67 loc) · 2.42 KB
/
build.gradle
File metadata and controls
executable file
·78 lines (67 loc) · 2.42 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
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
buildscript {
repositories {
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10" // Kotlin plugin
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' // Apply Kotlin Android plugin
def includeConnector = project.hasProperty('appsflyer.enable_purchase_connector') ? project.property('appsflyer.enable_purchase_connector').toBoolean() : false // Moved outside of android block
android {
namespace "com.appsflyer.reactnative"
compileSdkVersion safeExtGet('compileSdkVersion', 34)
buildToolsVersion safeExtGet('buildToolsVersion', '34.0.0')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 21)
targetSdkVersion safeExtGet('targetSdkVersion', 34)
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
buildConfigField 'boolean', 'INCLUDE_CONNECTOR', includeConnector.toString()
}
sourceSets {
main {
java.srcDirs = ['src/main/java', 'src/main/kotlin'] // Add Kotlin source directory
java.srcDirs += includeConnector ? ['src/main/includeConnector'] : ['src/main/excludeConnector']
}
}
lintOptions {
warning 'InvalidPackage'
}
testOptions {
unitTests.includeAndroidResources = true
unitTests.returnDefaultValues = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions { // Configure Kotlin-specific options
jvmTarget = "17"
}
}
repositories {
mavenCentral()
maven { url "https://maven.google.com" }
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.7.10" // Add Kotlin standard library
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
api "com.appsflyer:af-android-sdk:${safeExtGet('appsflyerVersion', '6.17.6')}"
implementation "com.android.installreferrer:installreferrer:${safeExtGet('installReferrerVersion', '2.2')}"
if (includeConnector){
implementation 'com.appsflyer:purchase-connector:2.1.1'
}
}