group 'com.example.flutter_opengl'
version '1.0'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
//        classpath 'com.android.tools.build:gradle:7.1.3'
        classpath 'com.android.tools.build:gradle:7.3.1'
    }
}

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

apply plugin: 'com.android.library'

android {
    compileSdkVersion 33

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion 24
        targetSdkVersion 33

        packagingOptions {
            doNotStrip '**.so'
        }

        sourceSets {
            main {
                jniLibs.srcDirs = ['src/opencv/libs']
            }
        }

        externalNativeBuild {
            cmake {
                arguments '-DBUILD_TESTING=OFF',
                        '-DANDROID_TOOLCHAIN=clang',
                        '-DCMAKE_VERBOSE_MAKEFILE=ON',
                        '-DANDROID_STL=c++_shared'
                cppFlags "-std=c++17 -fexceptions -frtti -stdlib=libc++ -v"
            }
        }
    }

    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
//            version "3.22.1"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
    buildToolsVersion '32.0.0'
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

