apply plugin: 'com.android.application'
apply plugin: 'groovyx.android'

repositories {
  jcenter()
}

android {
  compileSdkVersion project.compileSdkVersion
  buildToolsVersion project.buildToolsVersion

  defaultConfig {
    minSdkVersion project.minSdkVersion
    targetSdkVersion project.compileSdkVersion
    versionCode 1
    versionName project.version

    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  }

  packagingOptions {
    exclude 'META-INF/LICENSE'
  }

  buildTypes {
    debug {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    release {
      minifyEnabled true
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
  }

  // in order to bring memory usage down on CI
  dexOptions {
    preDexLibraries false
    javaMaxHeapSize '1538M'
  }

  lintOptions {
    abortOnError true
    disable 'InvalidPackage'
  }
}

dependencies {
  compile "org.codehaus.groovy:groovy:$groovyVersion:grooid"

  androidTestCompile project(':spock-android')
}

// The default 'assemble' task only applies to normal variants. Add test variants as well.
android.testVariants.all { variant ->
  tasks.getByName('assemble').dependsOn variant.assemble
}
