apply plugin: 'com.android.application'
//for dbflow
//apply plugin: 'com.neenbedankt.android-apt'

def dbflow_version = "3.1.1"


android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.study.benchmarkorm"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    productFlavors{
        //Alex
        realm {
            applicationIdSuffix ".realm"
            versionNameSuffix "-realm"
            resValue "string", "app_name", "RealmBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,40}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,500}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,15}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,15}"
        }
        greenDao {
            applicationIdSuffix ".greenDao"
            versionNameSuffix "-greenDao"
            resValue "string", "app_name", "GeenDaoBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,1000}"
            //uncomment this code to work with GreenDAO
//            apply plugin: 'org.greenrobot.greendao'
//            greendao {
//                schemaVersion 1
//            }
        }

        room {
            applicationIdSuffix ".room"
            versionNameSuffix "-room"
            resValue "string", "app_name", "RoomBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,1000}"
            javaCompileOptions {
                annotationProcessorOptions {
                    arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
                }
            }
        }
        sprinkles {
            applicationIdSuffix ".sprinkles"
            versionNameSuffix "-sprinkles"
            resValue "string", "app_name", "SprinklesBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,2000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,3000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,1000}"
        }
        active {
            applicationIdSuffix ".active"
            versionNameSuffix "-active"
            resValue "string", "app_name", "ActiveAndroidBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,3000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,2000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,2000}"
        }
        sqlite{
            applicationIdSuffix ".sqlite"
            versionNameSuffix "-sqlite"
            resValue "string", "app_name", "SQLiteBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,200}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,200}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,200}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,200}"
        }
        //Vlad
        dbflow {
            applicationIdSuffix ".dbflow"
            versionNameSuffix "-dbflow"
            resValue "string", "app_name", "DBFlowBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,1000}"
        }
        freezer {
            applicationIdSuffix ".freezer"
            versionNameSuffix "-freezer"
            resValue "string", "app_name", "FreezerBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,1000}"
        }
        requery {
            applicationIdSuffix ".requery"
            versionNameSuffix "-requery"
            resValue "string", "app_name", "RequeryBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,1000}"
        }
        ormlite{
            applicationIdSuffix ".ormlite"
            versionNameSuffix "-ormlite"
            resValue "string", "app_name", "ORMLiteBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,1000}"
        }
        sugarOrm{
            applicationIdSuffix ".sugarOrm"
            versionNameSuffix "-sugarOrm"
            resValue "string", "app_name", "SugarORMBenchmark"
            buildConfigField "float[]", "expectedRead", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedWrite", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedUpdate", "{1,2,3,4,5,6,7,8,9,1000}"
            buildConfigField "float[]", "expectedDelete", "{1,2,3,4,5,6,7,8,9,1000}"
        }
    }
    lintOptions {
        abortOnError false
    }
    dataBinding {
        enabled = true
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'

    testCompile 'junit:junit:4.12'

    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.diogobernardino:williamchart:2.4.0'

    //Realm
    realmCompile 'io.realm:realm-android:0.82.1'

    //ActiveAndroid
    activeCompile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'

    //GreenDAO
    greenDaoCompile 'org.greenrobot:greendao:3.2.2'

    //Sprinkles
    sprinklesCompile 'se.emilsjolander:sprinkles:1.0.0'


    //DBFlow
//    apt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
//    dbflowCompile group: 'com.google.code.gson', name: 'gson', version: '2.7'
//    dbflowCompile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
//    dbflowCompile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
//    // sql-cipher database encryption (optional)
//    dbflowCompile "com.github.Raizlabs.DBFlow:dbflow-sqlcipher:${dbflow_version}@aar"

    //ORMLite
    ormliteCompile 'com.j256.ormlite:ormlite-android:4.46'

    //requery and RXJava
    requeryCompile "io.reactivex.rxjava2:rxjava:2.0.8"
    requeryCompile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    requeryCompile 'io.requery:requery:1.2.1'
    requeryCompile 'io.requery:requery-android:1.2.1' // for android
    requeryAnnotationProcessor 'io.requery:requery-processor:1.2.1'

    //Sugar ORM
    sugarOrmCompile 'com.github.satyan:sugar:1.4'

    //Freezer
    freezerCompile 'fr.xebia.android.freezer:freezer:2.0.6'
    freezerProvided 'fr.xebia.android.freezer:freezer-annotations:2.0.6'
    freezerAnnotationProcessor 'fr.xebia.android.freezer:freezer-compiler:2.0.6'

    roomCompile 'android.arch.persistence.room:runtime:1.0.0-alpha1'
    roomAnnotationProcessor 'android.arch.persistence.room:compiler:1.0.0-alpha1'
}