1 <#-- 2 Copyright 2014 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 --> 16 buildscript { 17 repositories { 18 jcenter() 19 } 20 21 dependencies { 22 classpath 'com.android.tools.build:gradle:1.0.0' 23 } 24 } 25 26 apply plugin: 'android-library' 27 28 repositories { 29 jcenter() 30 } 31 32 <#if sample.dependency_shared?has_content> 33 dependencies { 34 35 <#list sample.dependency_shared as dep> 36 compile "${dep}" 37 </#list> 38 39 }</#if> 40 41 // The sample build uses multiple directories to 42 // keep boilerplate and common code separate from 43 // the main sample code. 44 List<String> dirs = [ 45 'main', // main sample code; look here for the interesting stuff. 46 'common', // components that are reused by multiple samples 47 'template'] // boilerplate code that is generated by the sample template process 48 49 android { 50 compileSdkVersion ${compile_sdk} 51 52 buildToolsVersion ${build_tools_version} 53 54 defaultConfig { 55 minSdkVersion ${min_sdk} 56 targetSdkVersion ${compile_sdk} 57 } 58 59 sourceSets { 60 main { 61 dirs.each { dir -> 62 <#noparse> 63 java.srcDirs "src/${dir}/java" 64 res.srcDirs "src/${dir}/res" 65 </#noparse> 66 } 67 } 68 69 } 70 } 71