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