Home | History | Annotate | Download | only in Wearable
      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: '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 
     41 <#list sample.dependency_wearable as dep>
     42     compile "${dep}"
     43 </#list>
     44 
     45     compile ${play_services_wearable_dependency}
     46     compile ${android_support_v13_dependency}
     47     compile ${wearable_support_dependency}
     48     compile project(':Shared')
     49 }
     50 
     51 // The sample build uses multiple directories to
     52 // keep boilerplate and common code separate from
     53 // the main sample code.
     54 List<String> dirs = [
     55     'main',     // main sample code; look here for the interesting stuff.
     56     'common',   // components that are reused by multiple samples
     57     'template'] // boilerplate code that is generated by the sample template process
     58 
     59 android {
     60     compileSdkVersion ${compile_sdk}
     61 
     62     buildToolsVersion ${build_tools_version}
     63 
     64     defaultConfig {
     65         versionCode 1
     66         versionName "1.0"
     67     }
     68 
     69     buildTypes {
     70         release {
     71             minifyEnabled false
     72             proguardFiles getDefaultProguardFile('proguard-android.txt')
     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         androidTest.setRoot('tests')
     85         androidTest.java.srcDirs = ['tests/src']
     86 
     87 <#if sample.defaultConfig?has_content>
     88         defaultConfig {
     89         ${sample.defaultConfig}
     90         }
     91 <#else>
     92 </#if>
     93     }
     94 }
     95 
     96 // BEGIN_EXCLUDE
     97 // Tasks below this line will be hidden from release output
     98 
     99 task preflight (dependsOn: parent.preflight) {
    100     project.afterEvaluate {
    101         // Inject a preflight task into each variant so we have a place to hook tasks
    102         // that need to run before any of the android build tasks.
    103         //
    104         android.applicationVariants.each { variant ->
    105         <#noparse>
    106             tasks.getByPath("prepare${variant.name.capitalize()}Dependencies").dependsOn preflight
    107         </#noparse>
    108         }
    109     }
    110 }
    111 
    112 // END_EXCLUDE
    113