buildscript {
    repositories {
        google()
        jcenter()
        // maven {
        //     url 'https://mvnrepository.com/artifact/com.android.tools.lint/lint-gradle-api'
        // }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
        // classpath 'com.android.tools.lint:lint-gradle:26.1.3'
    }
}

allprojects{
     repositories {
        google()
        jcenter()
        mavenCentral()
    }
}

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26

    defaultConfig {
        ndk {
            // We get targetArchitectures from names of dirs in $projectDir/jni/src, as that's where naketools put nimcache
            def targetArchitectures = file("$projectDir/jni/src").listFiles().findAll { it.isDirectory() }.collect { it.name }
            abiFilters = targetArchitectures
        }

        externalNativeBuild {
            ndkBuild {
                arguments "-j8"
                if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
                    arguments "LOCAL_SHORT_COMMANDS=true"
                }
            }
        }
    }

    externalNativeBuild {
        ndkBuild {
            path "jni/Android.mk"
        }
    }

    buildTypes {
        debug {
            jniDebuggable true
        }
    }
}
