apply plugin: 'com.android.application'

android {
    compileSdk 35

    defaultConfig {
        applicationId "de.badaix.snapcast"
        minSdkVersion 21
        targetSdkVersion 35
        versionCode 2900
        versionName '0.29.0.0'
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        externalNativeBuild {
            cmake {
                version "3.22.1"
                cppFlags "-std=c++14"
                arguments '-DANDROID_STL=c++_static', '-DBUILD_SERVER=OFF', '-DBUILD_TESTS=OFF'
                abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
            }
        }
    }
    buildFeatures {
        prefab true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path 'src/main/cpp/snapcast/CMakeLists.txt'
        }
    }

    buildToolsVersion = '35.0.0'
    ndkVersion '27.0.12077973'
    lint {
        disable 'MissingTranslation'
    }
    namespace 'de.badaix.snapcast'
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.13.2'
    // https://dl.google.com/dl/android/maven2/index.html
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    // compile 'com.android.support:recyclerview-v7:23.1.1'
    implementation 'com.google.android.material:material:1.12.0'
    implementation 'com.github.badaix:oboe:1.9.0@aar'
    implementation 'com.github.badaix:boost:1.85.0@aar'
    implementation 'com.github.badaix:flac:1.4.2@aar'
    implementation 'com.github.badaix:ogg:1.3.5@aar'
    implementation 'com.github.badaix:opus:1.1.2@aar'
    implementation 'com.github.badaix:soxr:0.1.3@aar'
    implementation 'com.github.badaix:tremor:1.0.1@aar'
    implementation 'com.github.badaix:vorbis:1.3.7@aar'
}


repositories{
    flatDir{
        dirs 'libs'
    }

    maven {
        name = "GithubPackages"
        url = uri("https://maven.pkg.github.com/badaix/snapcast-deps")
        credentials {
            username = project.findProperty("GITHUB_USER") ?: System.getenv("GITHUB_USER")
            password = project.findProperty("GITHUB_TOKEN") ?: System.getenv("GITHUB_TOKEN")
        }
    }
}
