Home | History | Annotate | Download | only in _MODULE_
      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         google()
     19         jcenter()
     20     }
     21 
     22     dependencies {
     23         classpath 'com.android.tools.build:gradle:3.3.2'
     24     }
     25 }
     26 
     27 apply plugin: 'com.android.application'
     28 
     29 repositories {
     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 dependencies {
     40 <#list sample.dependency 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 <#list sample.dependency_external as dep>
     46     implementation files(${dep})
     47 </#list>
     48     implementation ${play_services_wearable_dependency}
     49 
     50     <#-- TODO (jewalker): Revise once androidX is released to production. -->
     51     <#if !sample.androidX?? || !sample.androidX?has_content || sample.androidX == "false">
     52       implementation ${android_support_v13_dependency}
     53     </#if>
     54 
     55     implementation project(':Shared')
     56     wearApp project(':Wearable')
     57 }
     58 
     59 // The sample build uses multiple directories to
     60 // keep boilerplate and common code separate from
     61 // the main sample code.
     62 List<String> dirs = [
     63     'main',     // main sample code; look here for the interesting stuff.
     64     'common',   // components that are reused by multiple samples
     65     'template'] // boilerplate code that is generated by the sample template process
     66 
     67 android {
     68  <#if sample.compileSdkVersion?? && sample.compileSdkVersion?has_content>
     69     compileSdkVersion ${sample.compileSdkVersion}
     70   <#else>
     71     compileSdkVersion ${compile_sdk}
     72   </#if>
     73 
     74     buildToolsVersion ${build_tools_version}
     75 
     76     defaultConfig {
     77         minSdkVersion ${min_sdk}
     78         targetSdkVersion ${compile_sdk}
     79         versionCode 1
     80         versionName "1.0"
     81     }
     82 
     83     compileOptions {
     84         sourceCompatibility JavaVersion.VERSION_1_7
     85         targetCompatibility JavaVersion.VERSION_1_7
     86     }
     87 
     88     sourceSets {
     89         main {
     90             dirs.each { dir ->
     91 <#noparse>
     92                 java.srcDirs "src/${dir}/java"
     93                 res.srcDirs "src/${dir}/res"
     94 </#noparse>
     95             }
     96         }
     97         androidTest.setRoot('tests')
     98         androidTest.java.srcDirs = ['tests/src']
     99 
    100 <#if sample.defaultConfig?has_content>
    101         defaultConfig {
    102         ${sample.defaultConfig}
    103         }
    104 <#else>
    105 </#if>
    106     }
    107 
    108 }
    109