apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'


android {

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    compileSdkVersion 33
    defaultConfig {
        applicationId 'com.ulicae.cinelog'
        minSdkVersion 24
        targetSdkVersion 33
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

        multiDexEnabled true
    }

    buildFeatures {
        viewBinding true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        resources {
            excludes += ['META-INF/DEPENDENCIES.txt', 'META-INF/LICENSE.txt', 'META-INF/NOTICE.txt', 'META-INF/NOTICE', 'META-INF/LICENSE', 'META-INF/DEPENDENCIES', 'META-INF/notice.txt', 'META-INF/license.txt', 'META-INF/dependencies.txt', 'META-INF/LGPL2.1']
        }
    }
    productFlavors {
    }
}

greendao {
    schemaVersion 9
}

dependencies {
    def nav_version = "2.5.2"

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

    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    // see https://stackoverflow.com/questions/75263047/duplicate-class-in-kotlin-android
    constraints {
        implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
            because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
        }
        implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
            because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
        }
    }

    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.viewpager2:viewpager2:1.0.0'

    // Scrolling image loader
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    // Switch icons
    implementation 'com.github.zagum:Android-SwitchIcon:1.4.2'

    // Makes parceling simple
    implementation 'org.parceler:parceler-api:1.1.13'
    annotationProcessor 'org.parceler:parceler:1.1.13'

    // GreenDAO ORM for database
    implementation 'org.greenrobot:greendao:3.2.2'
    // https://mvnrepository.com/artifact/com.uwetrottmann.tmdb2/tmdb-java
    implementation 'com.uwetrottmann.tmdb2:tmdb-java:2.2.0'
    // Add import and export functionnalities
    implementation 'org.apache.commons:commons-csv:1.5'
    implementation group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'

    // color picker for tags
    implementation "com.github.skydoves:colorpickerview:2.2.4"

    // Allow to implements app preferences
    implementation 'androidx.preference:preference:1.2.0'

    // navigation lib
    implementation "androidx.navigation:navigation-fragment:$nav_version"
    implementation "androidx.navigation:navigation-ui:$nav_version"

    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:2.28.2'
    testImplementation group: 'org.hamcrest', name: 'hamcrest-junit', version: '2.0.0.0'
}
