plugins {
    id 'com.android.application'
}

repositories {
    mavenLocal()
    maven {
        url 'https://repo.eclipse.org/content/repositories/californium/'
    }
}

android {
    signingConfigs {
        cali {

            // requires a "gradle.properties" file with the
            // RELEASE_??? properties below in the ".gradle" folder.         

            storeFile file(RELEASE_STORE_FILE)
            storePassword RELEASE_STORE_PASSWORD
            keyPassword RELEASE_KEY_PASSWORD
            keyAlias RELEASE_KEY_ALIAS
        }
    }
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "org.eclipse.californium.examples.android"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.cali
        }
    }

    packagingOptions {
        pickFirst 'META-INF/INDEX.LIST'
        pickFirst 'META-INF/io.netty.versions.properties'
        pickFirst 'META-INF/legal/**'
        exclude '**/*.jks'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}


dependencies {
    def californiumVersion = '4.0.0-M6'

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'org.eclipse.californium:californium-core:' + californiumVersion
    implementation 'org.eclipse.californium:element-connector:' + californiumVersion
    implementation 'org.eclipse.californium:scandium:' + californiumVersion
    implementation 'org.eclipse.californium:demo-certs:' + californiumVersion
    implementation 'com.github.tony19:logback-android:1.3.0-3'
}
