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-->
16buildscript {
17    repositories {
18        google()
19        jcenter()
20    }
21
22    dependencies {
23        classpath 'com.android.tools.build:gradle:3.4.2'
24    }
25}
26
27apply plugin: 'com.android.library'
28
29repositories {
30    google()
31    jcenter()
32<#if sample.repository?has_content>
33    <#list sample.repository as rep>
34    ${rep}
35    </#list>
36</#if>
37}
38
39<#if sample.dependency_shared?has_content>
40dependencies {
41<#list sample.dependency_shared as dep>
42    <#-- Output dependency after checking if it is a play services depdency and
43    needs the latest version number attached. -->
44    <@update_play_services_dependency dep="${dep}" />
45</#list>
46}</#if>
47
48// The sample build uses multiple directories to
49// keep boilerplate and common code separate from
50// the main sample code.
51List<String> dirs = [
52    'main',     // main sample code; look here for the interesting stuff.
53    'common',   // components that are reused by multiple samples
54    'template'] // boilerplate code that is generated by the sample template process
55
56android {
57 <#if sample.compileSdkVersion?? && sample.compileSdkVersion?has_content>
58    compileSdkVersion ${sample.compileSdkVersion}
59  <#else>
60    compileSdkVersion ${compile_sdk}
61  </#if>
62
63    buildToolsVersion ${build_tools_version}
64
65    defaultConfig {
66        minSdkVersion ${min_sdk}
67        targetSdkVersion ${compile_sdk}
68    }
69
70    compileOptions {
71        sourceCompatibility JavaVersion.VERSION_1_7
72        targetCompatibility JavaVersion.VERSION_1_7
73    }
74
75    sourceSets {
76        main {
77            dirs.each { dir ->
78<#noparse>
79                java.srcDirs "src/${dir}/java"
80                res.srcDirs "src/${dir}/res"
81</#noparse>
82            }
83        }
84
85    }
86}
87