subprojects {
  buildscript {
    repositories {
      jcenter()
    }
    dependencies {
      classpath 'com.android.tools.build:gradle:1.5.0'
    }
  }

  repositories {
    jcenter()
  }

  group = GROUP
  version = VERSION_NAME
}

ext {
  minSdkVersion = 9
  compileSdkVersion = 23
  buildToolsVersion = '23.0.2'

  assertj = 'org.assertj:assertj-core:1.7.1'
  supportAnnotations = 'com.android.support:support-annotations:23.1.1'
  supportV4 = 'com.android.support:support-v4:23.1.1'
  supportAppCompat = 'com.android.support:appcompat-v7:23.1.1'
  supportCardView = 'com.android.support:cardview-v7:23.1.1'
  supportDesign = 'com.android.support:design:23.1.1'
  supportGridLayout = 'com.android.support:gridlayout-v7:23.1.1'
  supportMediaRouter = 'com.android.support:mediarouter-v7:23.1.1'
  supportPalette = 'com.android.support:palette-v7:23.1.1'
  supportRecyclerView = 'com.android.support:recyclerview-v7:23.1.1'

  playServices = 'com.google.android.gms:play-services:7.5.0'

}

subprojects {
  afterEvaluate {
    android.libraryVariants.all { variant ->
      def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
      task.description = "Create jar artifact for ${variant.name}"
      task.dependsOn variant.javaCompile
      task.from variant.javaCompile.destinationDir
      task.destinationDir = project.file("${project.buildDir}/outputs/jar")
      task.archiveName = "${project.name}-${variant.baseName}.jar"
      artifacts.add('archives', task);
    }
  }
}
