1 2 3 4buildscript { 5 repositories { 6 mavenCentral() 7 } 8 9 dependencies { 10 classpath 'com.android.tools.build:gradle:0.8.+' 11 } 12} 13 14apply plugin: 'android' 15 16dependencies { 17 // Add the support lib that is appropriate for SDK 8 18 compile "com.android.support:support-v4:19.0.+" 19 compile "com.android.support:gridlayout-v7:19.0.+" 20 compile files('renderscript-v8.jar') 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 19 33 buildToolsVersion "19.0.1" 34 35 sourceSets { 36 main { 37 dirs.each { dir -> 38 java.srcDirs "src/${dir}/java" 39 res.srcDirs "src/${dir}/res" 40 } 41 } 42 instrumentTest.setRoot('tests') 43 instrumentTest.java.srcDirs = ['tests/src'] 44 45 defaultConfig { 46 47 renderscriptTargetApi 18 48 renderscriptSupportMode true 49 50 } 51 } 52} 53// BEGIN_EXCLUDE 54// Tasks below this line will be hidden from release output 55 56task preflight (dependsOn: parent.preflight) { 57 project.afterEvaluate { 58 // Inject a preflight task into each variant so we have a place to hook tasks 59 // that need to run before any of the android build tasks. 60 // 61 android.applicationVariants.each { variant -> 62 tasks.getByPath("prepare${variant.name.capitalize()}Dependencies").dependsOn preflight 63 } 64 } 65} 66 67// END_EXCLUDE 68