blob: 534ca6511568bbdde3af2f296f32c3a604641b7c [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 {
84 srcDir 'protos/'
85 srcDir 'proto_overrides/'
86 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070087 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070088
89 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070090 res.srcDirs = ['tests/res']
Sunny Goyald2303072018-08-14 15:21:45 -070091 java.srcDirs = ['tests/src', 'tests/tapl']
Sunny Goyal658058b2017-01-21 01:33:02 -080092 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070093 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070094
Sunny Goyal9d341962017-10-30 10:03:34 -070095 androidTestDebug {
96 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070097 }
Sunny Goyal658058b2017-01-21 01:33:02 -080098
Sunny Goyal9d341962017-10-30 10:03:34 -070099 aosp {
Kevin61ad3012019-01-04 16:30:24 -0800100 java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
Amos Bianchidda74902020-01-15 12:27:36 -0800101 }
102
103 aospWithoutQuickstep {
Kevin61ad3012019-01-04 16:30:24 -0800104 manifest.srcFile "AndroidManifest.xml"
Sunny Goyal658058b2017-01-21 01:33:02 -0800105 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700106
Amos Bianchidda74902020-01-15 12:27:36 -0800107 aospWithQuickstep {
108 manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
109 }
110
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700111 l3go {
112 res.srcDirs = ['go/res']
Kevin61ad3012019-01-04 16:30:24 -0800113 java.srcDirs = ['go/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700114 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700115 }
116
Amos Bianchidda74902020-01-15 12:27:36 -0800117 l3goWithoutQuickstepDebug {
118 manifest.srcFile "AndroidManifest.xml"
119 }
120
121 l3goWithQuickstepDebug {
122 manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
123 }
124
Kevin61ad3012019-01-04 16:30:24 -0800125 withoutQuickstep {
126 java.srcDirs = ['src_ui_overrides']
127 }
128
129 withQuickstep {
Kevin28578712019-01-04 17:54:51 -0800130 res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
131 java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
132 manifest.srcFile "quickstep/AndroidManifest.xml"
133 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700134 }
135}
136
Amos Bianchidda74902020-01-15 12:27:36 -0800137allprojects {
138 repositories {
139 maven { url "../../../prebuilts/sdk/current/androidx/m2repository" }
140 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
141 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
142 mavenCentral()
143 google()
144 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700145}
146
147dependencies {
Hyunyoung Song719eee22018-11-01 23:12:54 -0700148 implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
149 implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
150 implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
Hyunyoung Song719eee22018-11-01 23:12:54 -0700151 implementation project(':IconLoader')
Amos Bianchidda74902020-01-15 12:27:36 -0800152 withQuickstepImplementation project(':SharedLibWrapper')
Kevinddb9fe12019-03-15 13:39:00 -0700153 implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'launcher_protos.jar')
Hyunyoung Song719eee22018-11-01 23:12:54 -0700154
Kevin61ad3012019-01-04 16:30:24 -0800155 // Recents lib dependency
Kevinddb9fe12019-03-15 13:39:00 -0700156 withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700157
Kevin61ad3012019-01-04 16:30:24 -0800158 // Required for AOSP to compile. This is already included in the sysui_shared.jar
Kevinddb9fe12019-03-15 13:39:00 -0700159 withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
Sunny Goyal73133392017-11-02 11:04:49 -0700160
Sunny Goyal42137832018-04-23 14:03:04 -0700161 testImplementation 'junit:junit:4.12'
162 androidTestImplementation "org.mockito:mockito-core:1.9.5"
163 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
164 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
165 androidTestImplementation 'com.android.support.test:runner:1.0.0'
166 androidTestImplementation 'com.android.support.test:rules:1.0.0'
167 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Hyunyoung Song719eee22018-11-01 23:12:54 -0700168 androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700169}
170
171protobuf {
172 // Configure the protoc executable
173 protoc {
Amos Bianchidda74902020-01-15 12:27:36 -0800174 artifact = 'com.google.protobuf:protoc:3.0.0'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700175
176 generateProtoTasks {
177 all().each { task ->
178 task.builtins {
179 remove java
180 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700181 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800182 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800183 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530184 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700185 }
186 }
187 }
188 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700189 }
190}