Home | History | Annotate | Download | only in Shared
      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.3.2'
     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 <#list sample.dependency_shared as dep>
     35     <#-- Output dependency after checking if it is a play services depdency and
     36     needs the latest version number attached. -->
     37     <@update_play_services_dependency dep="${dep}" />
     38 </#list>
     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     compileOptions {
     60         sourceCompatibility JavaVersion.VERSION_1_7
     61         targetCompatibility JavaVersion.VERSION_1_7
     62     }
     63 
     64     sourceSets {
     65         main {
     66             dirs.each { dir ->
     67 <#noparse>
     68                 java.srcDirs "src/${dir}/java"
     69                 res.srcDirs "src/${dir}/res"
     70 </#noparse>
     71             }
     72         }
     73 
     74     }
     75 }
     76