apply plugin: 'com.android.application'

android {
    compileSdkVersion 32
    buildToolsVersion "30.0.3"
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    defaultConfig {
        applicationId "org.freenetproject.mobile"
        minSdkVersion 22
        targetSdkVersion 32
        versionCode 308
        versionName '0.3.7-beta'

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        ndk {
            abiFilters 'arm64-v8a', 'x86_64', 'x86', 'armeabi-v7a'
        }

        setProperty("archivesBaseName", "freenet-mobile-v$versionName")
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.navigation:navigation-fragment:2.5.0'
    implementation 'androidx.navigation:navigation-ui:2.5.0'
    implementation 'com.android.support:multidex:1.0.3'

    // ViewModel
    implementation "androidx.lifecycle:lifecycle-viewmodel:2.5.0"
    // LiveData
    implementation "androidx.lifecycle:lifecycle-livedata:2.5.0"
    implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.0"

    implementation 'com.jakewharton:process-phoenix:2.0.0'
    implementation 'com.google.guava:guava:30.0-android'

    // Freenet dependencies
    implementation ('com.github.freenet-mobile:node-wrapper:0.12') {
        exclude group: 'org.freenetproject', module: 'freenet-ext'
        exclude group: 'net.java.dev.jna', module: 'jna'
        exclude group: 'net.java.dev.jna', module: 'jna-platform'
    }
    implementation 'net.java.dev.jna:jna:5.6.0@aar'
    // End Freenet dependencies

    // For running a locally built freenet.jar
    //implementation "net.java.dev.jna:jna:4.5.2"
    //implementation "net.java.dev.jna:jna-platform:4.5.2"
    //implementation files('libs/freenet.jar')

    implementation 'androidx.preference:preference:1.2.0'

    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
