1 2 buildscript { 3 repositories { 4 jcenter() 5 } 6 7 dependencies { 8 classpath 'com.android.tools.build:gradle:2.1.2' 9 } 10 } 11 12 apply plugin: 'com.android.application' 13 14 repositories { 15 jcenter() 16 } 17 18 dependencies { 19 compile "com.android.support:support-v4:24.1.1" 20 compile "com.android.support:support-v13:24.1.1" 21 compile "com.android.support:cardview-v7:24.1.1" 22 compile "com.android.support:appcompat-v7:24.1.1" 23 } 24 25 // The sample build uses multiple directories to 26 // keep boilerplate and common code separate from 27 // the main sample code. 28 List<String> dirs = [ 29 'main', // main sample code; look here for the interesting stuff. 30 'common', // components that are reused by multiple samples 31 'template'] // boilerplate code that is generated by the sample template process 32 33 android { 34 compileSdkVersion 24 35 buildToolsVersion "24.0.1" 36 37 defaultConfig { 38 minSdkVersion 19 39 targetSdkVersion 24 40 } 41 42 compileOptions { 43 sourceCompatibility JavaVersion.VERSION_1_7 44 targetCompatibility JavaVersion.VERSION_1_7 45 } 46 47 sourceSets { 48 main { 49 dirs.each { dir -> 50 java.srcDirs "src/${dir}/java" 51 res.srcDirs "src/${dir}/res" 52 } 53 } 54 androidTest.setRoot('tests') 55 androidTest.java.srcDirs = ['tests/src'] 56 57 } 58 59 } 60