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:2.1.2' 23 } 24 } 25 26 apply plugin: 'com.android.application' 27 28 <#if sample.repository?has_content> 29 repositories { 30 <#list sample.repository as rep> 31 ${rep} 32 </#list> 33 }</#if> 34 35 repositories { 36 jcenter() 37 } 38 39 dependencies { 40 <#list sample.dependency_wearable as dep> 41 <#-- Output dependency after checking if it is a play services depdency and 42 needs the latest version number attached. --> 43 <@update_play_services_dependency dep="${dep}" /> 44 </#list> 45 compile ${play_services_wearable_dependency} 46 compile ${android_support_v13_dependency} 47 48 <#if sample.preview_wearable_support_dependency?? && sample.preview_wearable_support_dependency?has_content> 49 compile '${sample.preview_wearable_support_dependency}' 50 <#else> 51 compile ${wearable_support_dependency} 52 </#if> 53 54 compile project(':Shared') 55 } 56 57 // The sample build uses multiple directories to 58 // keep boilerplate and common code separate from 59 // the main sample code. 60 List<String> dirs = [ 61 'main', // main sample code; look here for the interesting stuff. 62 'common', // components that are reused by multiple samples 63 'template'] // boilerplate code that is generated by the sample template process 64 65 android { 66 compileSdkVersion ${compile_sdk} 67 68 buildToolsVersion ${build_tools_version} 69 70 defaultConfig { 71 versionCode 1 72 versionName "1.0" 73 74 <#if sample.targetSdkVersionWear?? && sample.targetSdkVersionWear?has_content> 75 targetSdkVersion ${sample.targetSdkVersionWear} 76 <#else> 77 targetSdkVersion ${compile_sdk} 78 </#if> 79 80 } 81 82 compileOptions { 83 sourceCompatibility JavaVersion.VERSION_1_7 84 targetCompatibility JavaVersion.VERSION_1_7 85 } 86 87 sourceSets { 88 main { 89 dirs.each { dir -> 90 <#noparse> 91 java.srcDirs "src/${dir}/java" 92 res.srcDirs "src/${dir}/res" 93 </#noparse> 94 } 95 } 96 androidTest.setRoot('tests') 97 androidTest.java.srcDirs = ['tests/src'] 98 99 <#if sample.defaultConfig?has_content> 100 defaultConfig { 101 ${sample.defaultConfig} 102 } 103 <#else> 104 </#if> 105 } 106 } 107