group 'dev.amirzr.flutter_v2ray_client'
version '1.0'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

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

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

apply plugin: 'com.android.library'

android {
    if (project.android.hasProperty("namespace")) {
        namespace 'dev.amirzr.flutter_v2ray_client'
    }

    compileSdkVersion 34
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion 21
    }

    dependencies {
        testImplementation 'junit:junit:4.13.2'
        testImplementation 'org.mockito:mockito-core:5.0.0'
    }

    testOptions {
        unitTests.all {
            testLogging {
               events "passed", "skipped", "failed", "standardOut", "standardError"
               outputs.upToDateWhen {false}
               showStandardStreams = true
            }
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/jniLibs']
        }
    }
}


dependencies {
    implementation(name: "libv2ray", ext: "aar")
    implementation 'androidx.appcompat:appcompat:1.6.1'
}

rootProject.allprojects {
    repositories {
        flatDir {
            // Ensure Gradle looks for libv2ray.aar inside this plugin's libs folder
            dirs project(':flutter_v2ray_client').file('libs')
        }
    }
}
