
plugins {
    id 'com.android.library'
    id 'maven-publish'
    id 'signing'
}
android {
    compileSdk 35

    defaultConfig {
        minSdkVersion 14
        aarMetadata {
         minCompileSdk = 21
        }
    }
    buildTypes {
        release {
            minifyEnabled false
        }
    }
    namespace 'com.yoctopuce.yoctolib'
    publishing {
        singleVariant("release") {
            // if you don't want sources/javadoc, remove these lines
            withSourcesJar()
        }
    }
    signingConfigs {
        release {
            storeFile file("~/AndroidKeyStore")
            storePassword System.getenv("ANDROID_KSTORE_PWD")
            keyPassword System.getenv("ANDROID_KEY_PWD")
            keyAlias  System.getenv("ANDROID_KEY_NAME")
        }
    }
    lint {
        targetSdk 35
    }
    testOptions {
        targetSdk 35
    }
}

afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                groupId 'com.yoctopuce.android'
                artifactId 'YoctoLib'
                version '2.1.15129'

                afterEvaluate {
                    from components.release
                }
            }
        }
        repositories {
            maven {
                name 'nexus'
                url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
                credentials {
                    username System.getenv("OSSRH_USERNAME")
                    password System.getenv("OSSRH_PASSWORD")
                }
            }
        }
    }
}

signing {
    sign configurations.archives
}
dependencies {
    implementation 'androidx.core:core:1.16.0'
}
