blob: a7eef13a3d36f9b63101177159610618162c36c0 [file] [log] [blame]
Sunny Goyaledf329a2015-08-29 23:16:27 -07001buildscript {
2 repositories {
3 mavenCentral()
Sunny Goyal42137832018-04-23 14:03:04 -07004 google()
Amos Bianchidda74902020-01-15 12:27:36 -08005 jcenter()
Sunny Goyaledf329a2015-08-29 23:16:27 -07006 }
7 dependencies {
Hyunyoung Song719eee22018-11-01 23:12:54 -07008 classpath GRADLE_CLASS_PATH
9 classpath PROTOBUF_CLASS_PATH
Sunny Goyaledf329a2015-08-29 23:16:27 -070010 }
11}
12
Kevinddb9fe12019-03-15 13:39:00 -070013final String ANDROID_TOP = "${rootDir}/../../.."
14final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/"
15
Sunny Goyaledf329a2015-08-29 23:16:27 -070016apply plugin: 'com.android.application'
17apply plugin: 'com.google.protobuf'
18
19android {
Sunny Goyala5de7c72019-01-30 11:40:38 -080020 compileSdkVersion COMPILE_SDK
Hyunyoung Song719eee22018-11-01 23:12:54 -070021 buildToolsVersion BUILD_TOOLS_VERSION
Sunny Goyaledf329a2015-08-29 23:16:27 -070022
23 defaultConfig {
Sunny Goyal8c48d8b2019-01-25 15:10:18 -080024 minSdkVersion 25
Sunny Goyale1ebc082018-01-26 12:24:10 -080025 targetSdkVersion 28
Sunny Goyaledf329a2015-08-29 23:16:27 -070026 versionCode 1
27 versionName "1.0"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070028
Vadim Trysheva3fd1e52018-08-24 17:48:25 -070029 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Sunny Goyal42137832018-04-23 14:03:04 -070030 vectorDrawables.useSupportLibrary = true
Sunny Goyaledf329a2015-08-29 23:16:27 -070031 }
32 buildTypes {
33 debug {
34 minifyEnabled false
35 }
36 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070037
Sunny Goyal42137832018-04-23 14:03:04 -070038 compileOptions {
39 sourceCompatibility JavaVersion.VERSION_1_8
40 targetCompatibility JavaVersion.VERSION_1_8
41 }
42
Kevin61ad3012019-01-04 16:30:24 -080043 // The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep)
44 // See: https://developer.android.com/studio/build/build-variants#flavor-dimensions
45 flavorDimensions "app", "recents"
Sunny Goyal42137832018-04-23 14:03:04 -070046
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070047 productFlavors {
48 aosp {
Kevin61ad3012019-01-04 16:30:24 -080049 dimension "app"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070050 applicationId 'com.android.launcher3'
51 testApplicationId 'com.android.launcher3.tests'
52 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070053
54 l3go {
Kevin61ad3012019-01-04 16:30:24 -080055 dimension "app"
Sunny Goyal64a75aa2017-07-03 13:50:52 -070056 applicationId 'com.android.launcher3'
57 testApplicationId 'com.android.launcher3.tests'
58 }
Sunny Goyal9d341962017-10-30 10:03:34 -070059
Kevin61ad3012019-01-04 16:30:24 -080060 withQuickstep {
61 dimension "recents"
Sunny Goyald2303072018-08-14 15:21:45 -070062
63 minSdkVersion 28
Sunny Goyal9d341962017-10-30 10:03:34 -070064 }
Kevin61ad3012019-01-04 16:30:24 -080065
66 withoutQuickstep {
67 dimension "recents"
68 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070069 }
Sunny Goyal9d341962017-10-30 10:03:34 -070070
71 // Disable release builds for now
72 android.variantFilter { variant ->
73 if (variant.buildType.name.endsWith('release')) {
Kevin28578712019-01-04 17:54:51 -080074 variant.setIgnore(true)
75 }
Sunny Goyal9d341962017-10-30 10:03:34 -070076 }
77
Sunny Goyaledf329a2015-08-29 23:16:27 -070078 sourceSets {
79 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080080 res.srcDirs = ['res']
Kevinab874002019-01-04 15:55:42 -080081 java.srcDirs = ['src', 'src_plugins']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070082 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070083 proto {
thiruramcbeb13d2021-01-27 14:45:58 -080084 srcDirs = ['protos/', 'protos_overrides/']
Sunny Goyal2385ebe2017-07-19 01:24:07 -070085 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070086 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070087
88 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070089 res.srcDirs = ['tests/res']
Sunny Goyald2303072018-08-14 15:21:45 -070090 java.srcDirs = ['tests/src', 'tests/tapl']
Sunny Goyal658058b2017-01-21 01:33:02 -080091 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070092 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070093
Sunny Goyal9d341962017-10-30 10:03:34 -070094 androidTestDebug {
95 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070096 }
Sunny Goyal658058b2017-01-21 01:33:02 -080097
Sunny Goyal9d341962017-10-30 10:03:34 -070098 aosp {
Kevin61ad3012019-01-04 16:30:24 -080099 java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
Amos Bianchidda74902020-01-15 12:27:36 -0800100 }
101
102 aospWithoutQuickstep {
Kevin61ad3012019-01-04 16:30:24 -0800103 manifest.srcFile "AndroidManifest.xml"
Sunny Goyal658058b2017-01-21 01:33:02 -0800104 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700105
Amos Bianchidda74902020-01-15 12:27:36 -0800106 aospWithQuickstep {
107 manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
108 }
109
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700110 l3go {
111 res.srcDirs = ['go/res']
Kevin61ad3012019-01-04 16:30:24 -0800112 java.srcDirs = ['go/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700113 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700114 }
115
Amos Bianchidda74902020-01-15 12:27:36 -0800116 l3goWithoutQuickstepDebug {
117 manifest.srcFile "AndroidManifest.xml"
118 }
119
120 l3goWithQuickstepDebug {
121 manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
122 }
123
Kevin61ad3012019-01-04 16:30:24 -0800124 withoutQuickstep {
125 java.srcDirs = ['src_ui_overrides']
126 }
127
128 withQuickstep {
Kevin28578712019-01-04 17:54:51 -0800129 res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
130 java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
131 manifest.srcFile "quickstep/AndroidManifest.xml"
132 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700133 }
134}
135
Amos Bianchidda74902020-01-15 12:27:36 -0800136allprojects {
137 repositories {
138 maven { url "../../../prebuilts/sdk/current/androidx/m2repository" }
139 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
140 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
141 mavenCentral()
142 google()
143 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700144}
145
146dependencies {
Hyunyoung Song719eee22018-11-01 23:12:54 -0700147 implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
148 implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
149 implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
Hyunyoung Song719eee22018-11-01 23:12:54 -0700150 implementation project(':IconLoader')
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}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700167}
168
169protobuf {
170 // Configure the protoc executable
171 protoc {
Winson Chungf9935182020-10-23 09:26:44 -0700172 artifact = "com.google.protobuf:protoc:${protocVersion}"
173 }
174 generateProtoTasks {
175 all().each { task ->
176 task.builtins {
177 remove java
178 java {
179 option "lite"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700180 }
181 }
182 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700183 }
thiruramcbeb13d2021-01-27 14:45:58 -0800184}