1 2 buildscript { 3 repositories { 4 jcenter() 5 } 6 7 dependencies { 8 classpath 'com.android.tools.build:gradle:2.3.3' 9 } 10 } 11 12 apply plugin: 'android-library' 13 14 repositories { 15 jcenter() 16 maven { 17 url 'https://maven.google.com' 18 } 19 } 20 21 22 23 // The sample build uses multiple directories to 24 // keep boilerplate and common code separate from 25 // the main sample code. 26 List<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 31 android { 32 compileSdkVersion 25 33 34 buildToolsVersion "25.0.3" 35 36 defaultConfig { 37 minSdkVersion 18 38 targetSdkVersion 25 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 54 } 55 } 56