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
19is contained in templates/base. It includes only what's necessary for Android Studio
20to recognize this as an Android project and start the template engine. -->
21
22buildscript {
23    repositories {
24        google()
25        jcenter()
26    }
27
28    dependencies {
29        classpath 'com.android.tools.build:gradle:3.4.2'
30    }
31}
32
33apply plugin: 'android'
34
35
36android {
37     <#-- Note that target SDK is hardcoded in this template. We expect all samples
38          to always use the most current SDK as their target. -->
39    compileSdkVersion ${compile_sdk}
40}
41
42task 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