Home | History | Annotate | Download | only in _MODULE_
      1 <#ftl>
      2 <#--
      3         Copyright 2013 The Android Open Source Project
      4 
      5         Licensed under the Apache License, Version 2.0 (the "License");
      6         you may not use this file except in compliance with the License.
      7         You may obtain a copy of the License at
      8 
      9         http://www.apache.org/licenses/LICENSE-2.0
     10 
     11         Unless required by applicable law or agreed to in writing, software
     12         distributed under the License is distributed on an "AS IS" BASIS,
     13         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14         See the License for the specific language governing permissions and
     15         limitations under the License.
     16 -->
     17 
     18 <#-- This build script is a bootstrapper for the "real" android build script that
     19 is contained in templates/base. It includes only what's necessary for Android Studio
     20 to recognize this as an Android project and start the template engine. -->
     21 
     22 buildscript {
     23     repositories {
     24         mavenCentral()
     25     }
     26 
     27     dependencies {
     28         classpath 'com.android.tools.build:gradle:0.8.+'
     29     }
     30 }
     31 
     32 apply plugin: 'android'
     33 
     34 
     35 android {
     36      <#-- Note that target SDK is hardcoded in this template. We expect all samples
     37           to always use the most current SDK as their target. -->
     38     compileSdkVersion ${compile_sdk}
     39     buildToolsVersion ${build_tools_version}
     40 }
     41 
     42 task preflight (dependsOn: parent.preflight) {
     43     project.afterEvaluate {
     44         <#noparse>
     45         // Inject a preflight task into each variant so we have a place to hook tasks
     46         // that need to run before any of the android build tasks.
     47         //
     48         android.applicationVariants.each { variant ->
     49             println variant.name
     50             tasks.getByPath("prepare${variant.name.capitalize()}Dependencies").dependsOn preflight
     51         }
     52         </#noparse>
     53     }
     54 }
     55 
     56 
     57 
     58