blob: af54c5b6d181042abdd02d82f48fbd2f94476bb3 [file] [log] [blame]
Sunny Goyaledf329a2015-08-29 23:16:27 -07001buildscript {
2 repositories {
3 mavenCentral()
Sunny Goyal42137832018-04-23 14:03:04 -07004 google()
Sunny Goyaledf329a2015-08-29 23:16:27 -07005 }
6 dependencies {
Hyunyoung Song719eee22018-11-01 23:12:54 -07007 classpath GRADLE_CLASS_PATH
8 classpath PROTOBUF_CLASS_PATH
Sunny Goyaledf329a2015-08-29 23:16:27 -07009 }
10}
11
12apply plugin: 'com.android.application'
13apply plugin: 'com.google.protobuf'
14
15android {
Hyunyoung Song719eee22018-11-01 23:12:54 -070016 compileSdkVersion COMPILE_SDK.toInteger()
17 buildToolsVersion BUILD_TOOLS_VERSION
Sunny Goyaledf329a2015-08-29 23:16:27 -070018
19 defaultConfig {
Sunny Goyald297be22016-05-10 15:35:02 -070020 minSdkVersion 21
Sunny Goyale1ebc082018-01-26 12:24:10 -080021 targetSdkVersion 28
Sunny Goyaledf329a2015-08-29 23:16:27 -070022 versionCode 1
23 versionName "1.0"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070024
Vadim Trysheva3fd1e52018-08-24 17:48:25 -070025 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Sunny Goyal42137832018-04-23 14:03:04 -070026 vectorDrawables.useSupportLibrary = true
Sunny Goyaledf329a2015-08-29 23:16:27 -070027 }
28 buildTypes {
29 debug {
30 minifyEnabled false
31 }
32 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070033
Sunny Goyal42137832018-04-23 14:03:04 -070034 compileOptions {
35 sourceCompatibility JavaVersion.VERSION_1_8
36 targetCompatibility JavaVersion.VERSION_1_8
37 }
38
39 flavorDimensions "default"
40
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070041 productFlavors {
42 aosp {
Sunny Goyal42137832018-04-23 14:03:04 -070043 dimension "default"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070044 applicationId 'com.android.launcher3'
45 testApplicationId 'com.android.launcher3.tests'
46 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070047
48 l3go {
Sunny Goyal42137832018-04-23 14:03:04 -070049 dimension "default"
Sunny Goyal64a75aa2017-07-03 13:50:52 -070050 applicationId 'com.android.launcher3'
51 testApplicationId 'com.android.launcher3.tests'
52 }
Sunny Goyal9d341962017-10-30 10:03:34 -070053
54 quickstep {
Sunny Goyal42137832018-04-23 14:03:04 -070055 dimension "default"
Sunny Goyal9d341962017-10-30 10:03:34 -070056 applicationId 'com.android.launcher3'
57 testApplicationId 'com.android.launcher3.tests'
Sunny Goyald2303072018-08-14 15:21:45 -070058
59 minSdkVersion 28
Sunny Goyal9d341962017-10-30 10:03:34 -070060 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070061 }
Sunny Goyal9d341962017-10-30 10:03:34 -070062
63 // Disable release builds for now
64 android.variantFilter { variant ->
65 if (variant.buildType.name.endsWith('release')) {
66 variant.setIgnore(true);
67 }
68 }
69
Sunny Goyaledf329a2015-08-29 23:16:27 -070070 sourceSets {
71 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080072 res.srcDirs = ['res']
Rajeev Kumar51ca6032018-10-31 12:54:15 -070073 java.srcDirs = ['src', 'src_shortcuts_overrides']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070074 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070075 proto {
76 srcDir 'protos/'
77 srcDir 'proto_overrides/'
78 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070079 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070080
Sunny Goyal9d341962017-10-30 10:03:34 -070081 debug {
82 manifest.srcFile "AndroidManifest.xml"
83 }
84
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070085 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070086 res.srcDirs = ['tests/res']
Sunny Goyald2303072018-08-14 15:21:45 -070087 java.srcDirs = ['tests/src', 'tests/tapl']
Sunny Goyal658058b2017-01-21 01:33:02 -080088 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070089 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070090
Sunny Goyal9d341962017-10-30 10:03:34 -070091 androidTestDebug {
92 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070093 }
Sunny Goyal658058b2017-01-21 01:33:02 -080094
Sunny Goyal9d341962017-10-30 10:03:34 -070095 aosp {
Sunny Goyal8b0a6472017-11-06 21:09:23 -080096 java.srcDirs = ['src_flags', "src_ui_overrides"]
Sunny Goyal658058b2017-01-21 01:33:02 -080097 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070098
99 l3go {
100 res.srcDirs = ['go/res']
Rajeev Kumarc00a2592018-10-30 17:16:25 -0700101 java.srcDirs = ['go/src', "src_ui_overrides"]
Sunny Goyal9d341962017-10-30 10:03:34 -0700102 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700103 }
104
Sunny Goyal9d341962017-10-30 10:03:34 -0700105 quickstep {
106 res.srcDirs = ['quickstep/res']
Sunny Goyal8b0a6472017-11-06 21:09:23 -0800107 java.srcDirs = ['src_flags', 'quickstep/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700108 manifest.srcFile "quickstep/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700109 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700110 }
111}
112
113repositories {
Sunny Goyal42137832018-04-23 14:03:04 -0700114 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
115 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700116 mavenCentral()
Sunny Goyal42137832018-04-23 14:03:04 -0700117 google()
Sunny Goyaledf329a2015-08-29 23:16:27 -0700118}
119
120dependencies {
Hyunyoung Song719eee22018-11-01 23:12:54 -0700121 implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
122 implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
123 implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
Hyunyoung Song719eee22018-11-01 23:12:54 -0700124 implementation project(':IconLoader')
Kevin34380b42019-01-04 16:00:36 -0800125 implementation fileTree(dir: "libs", include: 'launcher_protos.jar')
Hyunyoung Song719eee22018-11-01 23:12:54 -0700126
127 // This is already included in sysui_shared
128 aospImplementation fileTree(dir: "libs", include: 'plugin_core.jar')
129 l3goImplementation fileTree(dir: "libs", include: 'plugin_core.jar')
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700130
Sunny Goyal42137832018-04-23 14:03:04 -0700131 quickstepImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
Sunny Goyal73133392017-11-02 11:04:49 -0700132
Sunny Goyal42137832018-04-23 14:03:04 -0700133 testImplementation 'junit:junit:4.12'
134 androidTestImplementation "org.mockito:mockito-core:1.9.5"
135 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
136 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
137 androidTestImplementation 'com.android.support.test:runner:1.0.0'
138 androidTestImplementation 'com.android.support.test:rules:1.0.0'
139 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Hyunyoung Song719eee22018-11-01 23:12:54 -0700140 androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700141}
142
143protobuf {
144 // Configure the protoc executable
145 protoc {
146 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700147
148 generateProtoTasks {
149 all().each { task ->
150 task.builtins {
151 remove java
152 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700153 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800154 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800155 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530156 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700157 }
158 }
159 }
160 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700161 }
162}