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