• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2018 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
17
18/*
19 * Experimental gradle configuration.  This file may not be up to date.
20 */
21
22apply plugin: 'com.android.library'
23apply plugin: 'com.google.protobuf'
24buildscript {
25    repositories {
26        mavenCentral()
27        google()
28    }
29    dependencies {
30        classpath 'com.android.tools.build:gradle:3.1.4'
31        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6'
32    }
33}
34android {
35    compileSdkVersion 28
36    buildToolsVersion '28.0.3'
37    dexOptions {
38        preDexLibraries = false
39        additionalParameters = ['--core-library']
40        javaMaxHeapSize "6g"
41    }
42
43    android {
44        defaultConfig {
45            resConfigs "en"
46        }
47    }
48
49    defaultConfig {
50        minSdkVersion 23
51        targetSdkVersion 28
52        versionCode 1
53        versionName "1.0"
54    }
55    buildTypes {
56        debug {
57            minifyEnabled false
58            buildConfigField "boolean", "AOSP", "true"
59            buildConfigField "boolean", "ENG", "true"
60            buildConfigField "boolean", "NO_JNI_TEST", "false"
61        }
62        release {
63            minifyEnabled true
64            buildConfigField "boolean", "AOSP", "true"
65            buildConfigField "boolean", "ENG", "false"
66            buildConfigField "boolean", "NO_JNI_TEST", "false"
67        }
68    }
69    compileOptions() {
70        sourceCompatibility JavaVersion.VERSION_1_8
71        targetCompatibility JavaVersion.VERSION_1_8
72    }
73
74    sourceSets {
75        main {
76            res.srcDirs = ['res']
77            java.srcDirs = ['src']
78            manifest.srcFile 'AndroidManifest.xml'
79            proto {
80                srcDir 'src/com/android/tv/common/compat/internal'
81            }
82        }
83    }
84}
85
86repositories {
87    mavenCentral()
88    google()
89}
90
91dependencies {
92    implementation 'androidx.appcompat:appcompat:1.0.2'
93    implementation 'androidx.palette:palette:1.0.0'
94    implementation 'androidx.leanback:leanback:1.0.0'
95    implementation "androidx.tvprovider:tvprovider:1.0.0"
96    implementation "androidx.recyclerview:recyclerview:1.0.0"
97    implementation "androidx.recyclerview:recyclerview-selection:1.0.0"
98    implementation "androidx.palette:palette:1.0.0"
99    implementation 'com.google.guava:guava:26.0-android'
100    implementation 'com.google.protobuf:protobuf-java:3.0.0'
101    implementation 'com.google.dagger:dagger:2.18'
102    implementation 'com.google.dagger:dagger-android:2.18'
103    annotationProcessor 'com.google.dagger:dagger-compiler:2.18'
104    annotationProcessor 'com.google.dagger:dagger-android-processor:2.18'
105}
106protobuf {
107    // Configure the protoc executable
108    protoc {
109        artifact = 'com.google.protobuf:protoc:3.0.0'
110
111        plugins {
112            javalite {
113                // The codegen for lite comes as a separate artifact
114                artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
115            }
116        }
117
118        generateProtoTasks {
119            all().each {
120                task -> task.builtins {
121                    remove java
122                }
123                task.plugins {
124                    javalite {}
125                }
126            }
127        }
128    }
129}