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