buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
    }
}

group 'eu.simonbinder.moor_ffi'
version '1.0'

rootProject.allprojects {
    repositories {
        google()
        jcenter()
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 16
    }

    externalNativeBuild {
        cmake {
            path "cpp/CMakeLists.txt"
        }
    }

    lintOptions {
        disable 'InvalidPackage'
    }
}

task extractSqlite(type: Copy) {
    from zipTree('sqlite.zip').matching {
        include '*/sqlite3.c'
        eachFile { it.setPath(it.getName()) } // Don't use top-level folder in zip
    }
    into 'cpp'
}

preBuild.dependsOn extractSqlite