blob: 090bafe68c3eccfc6a7b440ce246e0642dd7f9d0 [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
Kevinddb9fe12019-03-15 13:39:00 -070012final String ANDROID_TOP = "${rootDir}/../../.."
13final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/"
14
Sunny Goyaledf329a2015-08-29 23:16:27 -070015apply plugin: 'com.android.application'
16apply plugin: 'com.google.protobuf'
17
18android {
Sunny Goyala5de7c72019-01-30 11:40:38 -080019 compileSdkVersion COMPILE_SDK
Hyunyoung Song719eee22018-11-01 23:12:54 -070020 buildToolsVersion BUILD_TOOLS_VERSION
Sunny Goyaledf329a2015-08-29 23:16:27 -070021
22 defaultConfig {
Damian Patel1c016852021-07-28 14:38:39 +000023 minSdkVersion 26
24 targetSdkVersion 30
Sunny Goyaledf329a2015-08-29 23:16:27 -070025 versionCode 1
26 versionName "1.0"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070027
Vadim Trysheva3fd1e52018-08-24 17:48:25 -070028 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Sunny Goyal42137832018-04-23 14:03:04 -070029 vectorDrawables.useSupportLibrary = true
Sunny Goyaledf329a2015-08-29 23:16:27 -070030 }
31 buildTypes {
32 debug {
33 minifyEnabled false
34 }
35 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070036
Sunny Goyal42137832018-04-23 14:03:04 -070037 compileOptions {
38 sourceCompatibility JavaVersion.VERSION_1_8
39 targetCompatibility JavaVersion.VERSION_1_8
40 }
41
Kevin61ad3012019-01-04 16:30:24 -080042 // The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep)
43 // See: https://developer.android.com/studio/build/build-variants#flavor-dimensions
44 flavorDimensions "app", "recents"
Sunny Goyal42137832018-04-23 14:03:04 -070045
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070046 productFlavors {
47 aosp {
Kevin61ad3012019-01-04 16:30:24 -080048 dimension "app"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070049 applicationId 'com.android.launcher3'
50 testApplicationId 'com.android.launcher3.tests'
51 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070052
53 l3go {
Kevin61ad3012019-01-04 16:30:24 -080054 dimension "app"
Sunny Goyal64a75aa2017-07-03 13:50:52 -070055 applicationId 'com.android.launcher3'
56 testApplicationId 'com.android.launcher3.tests'
57 }
Sunny Goyal9d341962017-10-30 10:03:34 -070058
Kevin61ad3012019-01-04 16:30:24 -080059 withQuickstep {
60 dimension "recents"
Sunny Goyald2303072018-08-14 15:21:45 -070061
62 minSdkVersion 28
Sunny Goyal9d341962017-10-30 10:03:34 -070063 }
Kevin61ad3012019-01-04 16:30:24 -080064
65 withoutQuickstep {
66 dimension "recents"
67 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070068 }
Sunny Goyal9d341962017-10-30 10:03:34 -070069
70 // Disable release builds for now
71 android.variantFilter { variant ->
72 if (variant.buildType.name.endsWith('release')) {
Kevin28578712019-01-04 17:54:51 -080073 variant.setIgnore(true)
74 }
Sunny Goyal9d341962017-10-30 10:03:34 -070075 }
76
Sunny Goyaledf329a2015-08-29 23:16:27 -070077 sourceSets {
78 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080079 res.srcDirs = ['res']
Kevinab874002019-01-04 15:55:42 -080080 java.srcDirs = ['src', 'src_plugins']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070081 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070082 proto {
thiruramcbeb13d2021-01-27 14:45:58 -080083 srcDirs = ['protos/', 'protos_overrides/']
Sunny Goyal2385ebe2017-07-19 01:24:07 -070084 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070085 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070086
87 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070088 res.srcDirs = ['tests/res']
Sunny Goyald2303072018-08-14 15:21:45 -070089 java.srcDirs = ['tests/src', 'tests/tapl']
Sunny Goyal658058b2017-01-21 01:33:02 -080090 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070091 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070092
Sunny Goyal9d341962017-10-30 10:03:34 -070093 androidTestDebug {
94 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070095 }
Sunny Goyal658058b2017-01-21 01:33:02 -080096
Sunny Goyal9d341962017-10-30 10:03:34 -070097 aosp {
Kevin61ad3012019-01-04 16:30:24 -080098 java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
Amos Bianchidda74902020-01-15 12:27:36 -080099 }
100
101 aospWithoutQuickstep {
Kevin61ad3012019-01-04 16:30:24 -0800102 manifest.srcFile "AndroidManifest.xml"
Sunny Goyal658058b2017-01-21 01:33:02 -0800103 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700104
Amos Bianchidda74902020-01-15 12:27:36 -0800105 aospWithQuickstep {
106 manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
107 }
108
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700109 l3go {
110 res.srcDirs = ['go/res']
Kevin61ad3012019-01-04 16:30:24 -0800111 java.srcDirs = ['go/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700112 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700113 }
114
Amos Bianchidda74902020-01-15 12:27:36 -0800115 l3goWithoutQuickstepDebug {
116 manifest.srcFile "AndroidManifest.xml"
117 }
118
119 l3goWithQuickstepDebug {
120 manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
121 }
122
Kevin61ad3012019-01-04 16:30:24 -0800123 withoutQuickstep {
124 java.srcDirs = ['src_ui_overrides']
125 }
126
127 withQuickstep {
Kevin28578712019-01-04 17:54:51 -0800128 res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
129 java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
130 manifest.srcFile "quickstep/AndroidManifest.xml"
131 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700132 }
133}
134
Amos Bianchidda74902020-01-15 12:27:36 -0800135allprojects {
136 repositories {
137 maven { url "../../../prebuilts/sdk/current/androidx/m2repository" }
138 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
139 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
140 mavenCentral()
141 google()
142 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700143}
144
145dependencies {
Hyunyoung Song719eee22018-11-01 23:12:54 -0700146 implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
147 implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
148 implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
Hyunyoung Song719eee22018-11-01 23:12:54 -0700149 implementation project(':IconLoader')
Nicolo' Mazzucato2e16aa82023-02-07 21:41:07 +0000150 implementation project(':UiTestsLibLauncher')
Amos Bianchidda74902020-01-15 12:27:36 -0800151 withQuickstepImplementation project(':SharedLibWrapper')
Hyunyoung Song719eee22018-11-01 23:12:54 -0700152
Kevin61ad3012019-01-04 16:30:24 -0800153 // Recents lib dependency
Kevinddb9fe12019-03-15 13:39:00 -0700154 withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700155
Kevin61ad3012019-01-04 16:30:24 -0800156 // Required for AOSP to compile. This is already included in the sysui_shared.jar
Kevinddb9fe12019-03-15 13:39:00 -0700157 withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
Sunny Goyal73133392017-11-02 11:04:49 -0700158
Sunny Goyal42137832018-04-23 14:03:04 -0700159 testImplementation 'junit:junit:4.12'
160 androidTestImplementation "org.mockito:mockito-core:1.9.5"
161 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
162 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
163 androidTestImplementation 'com.android.support.test:runner:1.0.0'
164 androidTestImplementation 'com.android.support.test:rules:1.0.0'
165 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Hyunyoung Song719eee22018-11-01 23:12:54 -0700166 androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
Schneider Victor-tuliasd0865f82021-11-09 13:19:21 -0800167
168 api 'com.airbnb.android:lottie:3.3.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -0700169}
170
171protobuf {
172 // Configure the protoc executable
173 protoc {
Brian Isganitis8ef29782022-03-18 14:19:30 -0700174 artifact = "com.google.protobuf:protoc:${protocVersion}${PROTO_ARCH_SUFFIX}"
Winson Chungf9935182020-10-23 09:26:44 -0700175 }
176 generateProtoTasks {
177 all().each { task ->
178 task.builtins {
179 remove java
180 java {
181 option "lite"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700182 }
183 }
184 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700185 }
thiruramcbeb13d2021-01-27 14:45:58 -0800186}