apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'


android {
    signingConfigs {
        debug {
            keyAlias 'mcare-plus-severance'
            keyPassword 'mcare-plus-severance'
            storePassword 'mcare-plus-severance'
            storeFile file('../mcare-plus-severance.jks')
        }
    }
    compileSdkVersion 28
    flavorDimensions "mcareplus"
    defaultConfig {
        applicationId "com.lemonhc.mplus"
        minSdkVersion 21
        targetSdkVersion 28
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        testInstrumentationRunnerArguments clearPackageData: 'true'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/notice'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license'
        exclude 'META-INF/license.txt'
    }
    productFlavors {
        // 파티마 개발 .fatima.dev // 운영 .fatima
        //사내개발
        fatima_dev {
            applicationIdSuffix ".fatima.standard.dev"
            versionCode = 4
            versionName = "4"
        }
        //파티마개발
        fatima_inhouse {
            applicationIdSuffix ".fatima.local"
            versionCode = 8
            versionName = "8"
        }
        //파티마운영
        fatima_product {
            applicationIdSuffix ".fatima.standard"
            versionCode = 4
            versionName = "4"
        }

    }
    sourceSets {
        fatima_dev {
            manifest.srcFile("src/fatima_product/AndroidManifest.xml")
            java.srcDirs = ['src/main/java', 'src/fatima_dev/java', 'src/barcode_m3mobile/java']
            res.srcDirs = ['src/fatima_dev/res', 'src/stt_naver/res']
        }
        fatima_inhouse {
            manifest.srcFile("src/fatima_product/AndroidManifest.xml")
            java.srcDirs = ['src/main/java', 'src/fatima_local/java', 'src/barcode_m3mobile/java']
            res.srcDirs = ['src/fatima_local/res' ]
        }
        fatima_product {
            manifest.srcFile("src/fatima_product/AndroidManifest.xml")
            java.srcDirs = ['src/main/java', 'src/fatima_product/java', 'src/barcode_m3mobile/java']
            res.srcDirs = ['src/fatima_product/res']
        }

        main {
            java.srcDirs = ['src/main/java', 'src/test/java']
            resources.srcDirs = ['src/main/resources', 'src/androidTest/resources/']
        }


    }
    buildTypes {
        debug{
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.debug // 서명 설정
            ndk {
                abiFilters "armeabi-v7a", "armeabi" // includes ARM SO files only, so no x86 SO file
            }
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            ndk {
                abiFilters "armeabi-v7a", "armeabi" // includes ARM SO files only, so no x86 SO file
            }
        }
    }
    testOptions {
        unitTests.returnDefaultValues = true
    }
    lintOptions {
        abortOnError false
    }
}


dependencies {

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

    // test implementation
    implementation 'junit:junit:4.12'
    implementation 'androidx.annotation:annotation:1.0.0'
    testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
    testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test:rules:1.1.1'
    androidTestUtil 'androidx.test:orchestrator:1.1.1'

    // https://mvnrepository.com/artifact/commons-codec/commons-codec
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
        transitive = true
    }
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.google.android.gms:play-services:12.0.1'
    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'org.apache.maven:maven-artifact:3.3.9'
    implementation 'commons-codec:commons-codec:1.9'
    implementation 'com.github.beyka:androidtiffbitmapfactory:0.9.1'
//    implementation 'com.github.ajalt.reprint:core:3.2.1@aar'
    implementation 'androidx.multidex:multidex:2.0.0'

    implementation 'com.github.ajalt.reprint:core:3.3.2@aar' // required: supports marshmallow devices
    implementation 'com.github.ajalt.reprint:reprint_spass:3.3.2@aar' // optional: deprecated support for pre-marshmallow Samsung devices
    implementation 'com.github.ajalt.reprint:rxjava:3.3.2@aar' // optional: the RxJava 1 interface
    implementation 'com.github.ajalt.reprint:rxjava2:3.3.2@aar' // optional: the RxJava 2 interface

    //zxing
    implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
    implementation 'com.google.zxing:core:3.3.3'

    //kotlin and logger
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "org.jetbrains.anko:anko-commons:$anko_version"

    //picasso is imageLoader
    implementation 'com.squareup.picasso:picasso:2.71828'

    //coroutines
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.1'

    //constraint
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

    //photoView - is pinch zoom
    implementation 'com.github.chrisbanes:PhotoView:1.3.0'

    //network library
    implementation "com.github.kittinunf.fuel:fuel-android:$fuel_version"

    //livedata is rx programing
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'

    implementation 'com.sdsmdg.harjot:vectormaster:1.1.3'

    // 빈생성 헬프를 위한 롬복
    compileOnly 'org.projectlombok:lombok:1.18.10'
    annotationProcessor 'org.projectlombok:lombok:1.18.10'

    //파티마병원 전용단말 (M3Mobile)
    fatima_devImplementation files(
            'libs/M3SDK.jar'
    )
    fatima_inhouseImplementation files(
            'libs/M3SDK.jar'
    )
    fatima_productImplementation files(
            'libs/M3SDK.jar'
    )

    //http 통신
    implementation('com.squareup.retrofit2:retrofit:2.6.2') {
        exclude module: 'okhttp'
    }
    implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
    implementation 'com.squareup.okhttp3:okhttp:4.2.2'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2' // logging-interceptor는 반환된 모든 응답에 대해 로그 문자열을 생성합니다.
    implementation 'org.conscrypt:conscrypt-android:2.2.1'

    // 뷰바인딩을 위한 버터나이프
    implementation 'com.jakewharton:butterknife:10.2.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'

    // 빈생성 헬프를 위한 롬복
    compileOnly 'org.projectlombok:lombok:1.18.10'
    annotationProcessor 'org.projectlombok:lombok:1.18.10'

    // http 통신
    implementation('com.squareup.retrofit2:retrofit:2.6.2') {
        exclude module: 'okhttp'
    }

    // Logging
    implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'

    // permissionCheck
    implementation 'gun0912.ted:tedpermission:2.0.0'
}
