apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"
    defaultConfig {
        applicationId "com.gongluck.webrtc_android"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        //Invoke-customs are only supported starting with Android O (--min-api 26)
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    flatDir {
        dirs '../../../../3rdparty/webrtc/aar'   // aar目录
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    //注释下面这个，否则webrtc引入失败
    //androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.1'
    //webrtc
    //implementation 'org.webrtc:google-webrtc:latest.release'
    compile(name: 'libwebrtc', ext: 'aar') //add port constraints
    //websocket
    implementation 'org.java-websocket:Java-WebSocket:latest.release'
    implementation 'org.slf4j:slf4j-simple:latest.release'
}
