buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.2'
    }
}
apply plugin: 'com.android.library'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 23
    }

    repositories {
        mavenCentral()
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.google.android.gms:play-services-auth:9.4.0'
        compile('com.google.api-client:google-api-client-android:1.21.0') {
            exclude group: 'org.apache.httpcomponents'
        }
        compile('com.google.apis:google-api-services-drive:v3-rev33-1.21.0') {
            exclude group: 'org.apache.httpcomponents'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFile getDefaultProguardFile('proguard-android.txt')
        }
    }
}

task jar(type: Jar, dependsOn: ['clean','compileReleaseSources']) {
    from fileTree(dir: 'build/intermediates/classes/release')
    exclude('com/google/**') // this prevents the resource stuff from getting into the jar file and causing collisions in Unity
}

task deployToUnity(type: Copy, dependsOn: ['jar']) {
    from(jar.archivePath)
    into('../../Sprayscape/Assets/Plugins/Android')
}
