apply plugin: 'com.android.application'

android {
    defaultConfig {
        applicationId "com.fabienli.dokuwiki"
        minSdkVersion 21
        targetSdkVersion 35
        versionCode 80
        versionName "v1.2.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    testOptions {
        unitTests.returnDefaultValues = true
    }

    useLibrary 'org.apache.http.legacy'
}

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

    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.12.0'
    implementation 'androidx.recyclerview:recyclerview:1.4.0'
    implementation "androidx.preference:preference-ktx:1.2.1"
    implementation "androidx.legacy:legacy-preference-v14:1.0.0"

    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.2.1'

    // excluding junit from xmlrpc, as an older version is linked here
    implementation('org.apache.xmlrpc:xmlrpc-client:3.1.3'){
        exclude group: 'junit', module: 'junit'
    }
    implementation 'androidx.preference:preference:1.2.1'

    // room on sqlite
    def room_version = "2.7.1"
    api "androidx.room:room-runtime:$room_version"
    implementation 'androidx.vectordrawable:vectordrawable:1.2.0'
    annotationProcessor "androidx.room:room-compiler:$room_version"

    // Test helpers
    testImplementation "androidx.room:room-testing:$room_version"
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    // https://site.mockito.org/
    testImplementation "org.mockito:mockito-core:5.18.0"
}


android {


    compileSdk 35
    packagingOptions {
        resources {
            excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/license.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt', 'META-INF/notice.txt', 'META-INF/ASL2.0']
        }
    }
    lint {
        abortOnError false
    }
    namespace 'com.fabienli.dokuwiki'
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
    }
}
