• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1buildscript {
2    repositories {
3        mavenCentral()
4        google()
5    }
6    dependencies {
7        classpath 'com.android.tools.build:gradle:3.2.0-alpha12'
8        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
9    }
10}
11
12final String SUPPORT_LIBS_VERSION = '28.0.0-SNAPSHOT'
13
14apply plugin: 'com.android.application'
15apply plugin: 'com.google.protobuf'
16
17android {
18    compileSdkVersion 28
19    buildToolsVersion '28.0.0'
20
21    defaultConfig {
22        minSdkVersion 21
23        targetSdkVersion 28
24        versionCode 1
25        versionName "1.0"
26
27        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
28        vectorDrawables.useSupportLibrary = true
29    }
30    buildTypes {
31        debug {
32            minifyEnabled false
33        }
34    }
35
36    compileOptions {
37        sourceCompatibility JavaVersion.VERSION_1_8
38        targetCompatibility JavaVersion.VERSION_1_8
39    }
40
41    flavorDimensions "default"
42
43    productFlavors {
44        aosp {
45            dimension "default"
46            applicationId 'com.android.launcher3'
47            testApplicationId 'com.android.launcher3.tests'
48        }
49
50        l3go {
51            dimension "default"
52            applicationId 'com.android.launcher3'
53            testApplicationId 'com.android.launcher3.tests'
54        }
55
56        quickstep {
57            dimension "default"
58            applicationId 'com.android.launcher3'
59            testApplicationId 'com.android.launcher3.tests'
60        }
61    }
62
63    // Disable release builds for now
64    android.variantFilter { variant ->
65        if (variant.buildType.name.endsWith('release')) {
66            variant.setIgnore(true);
67        }
68    }
69
70    sourceSets {
71        main {
72            res.srcDirs = ['res']
73            java.srcDirs = ['src']
74            manifest.srcFile 'AndroidManifest-common.xml'
75            proto {
76                srcDir 'protos/'
77                srcDir 'proto_overrides/'
78            }
79        }
80
81        debug {
82            manifest.srcFile "AndroidManifest.xml"
83        }
84
85        androidTest {
86            res.srcDirs = ['tests/res']
87            java.srcDirs = ['tests/src']
88            manifest.srcFile "tests/AndroidManifest-common.xml"
89        }
90
91        androidTestDebug {
92            manifest.srcFile "tests/AndroidManifest.xml"
93        }
94
95        aosp {
96            java.srcDirs = ['src_flags', "src_ui_overrides"]
97        }
98
99        l3go {
100            res.srcDirs = ['go/res']
101            java.srcDirs = ['go/src_flags', "src_ui_overrides"]
102            manifest.srcFile "go/AndroidManifest.xml"
103        }
104
105        quickstep {
106            res.srcDirs = ['quickstep/res']
107            java.srcDirs = ['src_flags', 'quickstep/src']
108            manifest.srcFile "quickstep/AndroidManifest.xml"
109        }
110    }
111}
112
113repositories {
114    maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
115    maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
116    mavenCentral()
117    google()
118}
119
120dependencies {
121    implementation "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
122    implementation "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
123    implementation "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
124    implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
125
126    quickstepImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
127
128    testImplementation 'junit:junit:4.12'
129    androidTestImplementation "org.mockito:mockito-core:1.9.5"
130    androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
131    androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
132    androidTestImplementation 'com.android.support.test:runner:1.0.0'
133    androidTestImplementation 'com.android.support.test:rules:1.0.0'
134    androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
135    androidTestImplementation "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
136}
137
138protobuf {
139    // Configure the protoc executable
140    protoc {
141        artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
142
143        generateProtoTasks {
144            all().each { task ->
145                task.builtins {
146                    remove java
147                    javanano {
148                        option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
149                        option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
150                        option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
151                        option "enum_style=java"
152                    }
153                }
154            }
155        }
156    }
157}
158