// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.0.2'
        classpath 'com.google.gms:google-services:4.3.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

apply plugin: 'com.android.library'

def DEFAULT_MIN_SDK_VERSION = 23
def DEFAULT_COMPILE_SDK_VERSION = 34
def DEFAULT_BUILD_TOOLS_VERSION = "30.0.3"
def DEFAULT_TARGET_SDK_VERSION = 29
def DEFAULT_SUPPORT_LIB_VERSION = "30.0.3"

android {
    namespace 'com.hoxfon.react.RNTwilioVoice'
    compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
    buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
    compileOptions {
        sourceCompatibility 11
        targetCompatibility 11
    }
    defaultConfig {
        minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.minSdkVersion : DEFAULT_MIN_SDK_VERSION
        targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    def supportLibVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION

    implementation fileTree(include: ['*.jar'], dir: 'libs')

    implementation('com.twilio:voice-android:4.5.0') {
        exclude group: 'com.getkeepsafe.relinker', module: 'relinker'
    }
    implementation 'com.getkeepsafe.relinker:relinker:1.4.4'

    implementation "com.android.support:appcompat-v7:$supportLibVersion"
    implementation 'com.facebook.react:react-android:0.75.3'
    implementation 'com.google.firebase:firebase-messaging:23.1.1'
    compileOnly 'org.projectlombok:lombok:1.18.30'
    annotationProcessor 'org.projectlombok:lombok:1.18.30'
    testImplementation 'junit:junit:4.12'
}
