apply plugin: 'com.android.application'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId rootProject.ext.sampleArchivesBaseName
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "0.1"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }
    dexOptions {
        preDexLibraries = false
    }
}

repositories {
    maven { url rootProject.ext.mavenUrl }
}



dependencies {
    //compile fileTree(dir: '../org.eclipse.paho.android/service/libs', excludes: ["org.eclipse.paho.client.mqttv3-${rootProject.ext.clientVersion}.jar"], include: '')
    compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
    compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
    compile (project(':org.eclipse.paho.android.service')){
        //exclude module: "org.eclipse.paho.client.mqttv3"
        transitive=true
    }
}

task publishAPK(type: Copy) {
    from file("${project.buildDir}/outputs/apk/" + rootProject.ext.sampleArchivesBaseName + "-debug.apk");
    into '/shared/technology/paho/Android/' + rootProject.ext.sampleVersion + '/debug/';
}


configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3'
task debug << {
    configurations.compile.each { println it}
}
