plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    buildToolsVersion = versions.buildTools
    compileSdkVersion versions.compileSdk
    ndkVersion versions.ndkVersion

    defaultConfig {
        // The default ignore pattern for the 'assets' directory includes hidden files and directories which are used by Godot projects.
        // We also ignore the 'android' build directory which is generated by the Godot editor.
        aaptOptions {
            ignoreAssetsPattern "!.svn:!.git:!.ds_store:!*.scc:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~:<dir>android"
        }

        applicationId "org.godotengine.plugin.vr.oculus.mobile.demo"
        minSdkVersion versions.minSdk
        targetSdkVersion versions.targetSdk
        versionCode 1
        versionName "1.0"
    }

    sourceSets {
        main {
            assets.srcDirs += ['godot/']
        }
    }

    compileOptions {
        sourceCompatibility versions.javaVersion
        targetCompatibility versions.javaVersion
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }

    flavorDimensions "xrMode"
    productFlavors {
        ovr {
            applicationIdSuffix ".ovr"
            versionNameSuffix "-ovr"
            ndk {
                abiFilters "arm64-v8a", "armeabi-v7a"
            }
            missingDimensionStrategy 'functionality', 'full'
        }
        pancake {
            applicationIdSuffix ".pancake"
            versionNameSuffix "-pancake"
            missingDimensionStrategy 'functionality', 'stub'
        }
    }
}

dependencies {

    implementation project(":OVRMobile")
    implementation(fileTree(dir: "../../plugin/libs", include: ["godot-lib*.aar"]))
    implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlinVersion}"
    implementation 'androidx.appcompat:appcompat:1.3.1'
}
