apply plugin: 'com.android.application'

System.setProperty("appName", "gvr-x3d-demo")

if(file("../../common.gradle").exists()) {
    apply from: '../../common.gradle'
}
else if(file("../../../../GearVRf-Demos/common.gradle").exists()) {
    apply from: '../../../../GearVRf-Demos/common.gradle'
}

dependencies {
    if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
        if (findProject(':script')) {
			implementation project (':script')
		} else {
			debugImplementation(name: 'script-debug', ext: 'aar')
			releaseImplementation(name: 'script-release', ext: 'aar')
		}
    } else {
        implementation "org.gearvrf:script:$gearvrfVersion"
    }

    if (project.hasProperty("useLocalDependencies") && project.useLocalDependencies) {
        if (findProject(':x3d')) {
            implementation project(':x3d')
        } else {
            debugImplementation(name: 'x3d-debug', ext: 'aar')
            releaseImplementation(name: 'x3d-release', ext: 'aar')
        }
    } else {
        implementation "org.gearvrf:x3d:$gearvrfVersion"
    }
    implementation 'com.google.android.exoplayer:exoplayer:2.6.0'
}

android {
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    sourceSets.main {
        jni.srcDirs = [] // no auto generation of Android.mk
        jniLibs.srcDir 'libs' // pre-compiled libraries
    }
    compileSdkVersion 23
}
