apply plugin: 'com.android.application'

android {

    //Required to support the old folder structure
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
            jniLibs.srcDirs = ['libs']
        }
        androidTest.setRoot('tests')
    }

    //Required to support builds although lint errors exist
    lintOptions {
        abortOnError false
    }

    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion

    defaultConfig {
        applicationId "com.orangelabs.rcs.tts"
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        versionCode 1
        versionName "2.0"
        archivesBaseName = "tts"
    }
}

dependencies {
    compile project(':api')
    compile 'com.android.support:support-v4:25.0.1'
}

//Below install dependecy was added to always install RCS service before
//a RCS client to secure that Android handles RCS permissions correctly.
task installServiceFirst(dependsOn: ':core:installDebug') << {
    println 'RCS core service was installed first!'
}
tasks.whenTaskAdded { task ->
    if (task.name == 'installDebug') {
        task.dependsOn installServiceFirst
    }
}