blob: e296455bec73af85f6f1dd40c9d70ca99939b38e [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 {
Sunny Goyal8c48d8b2019-01-25 15:10:18 -080023 minSdkVersion 25
Sunny Goyale1ebc082018-01-26 12:24:10 -080024 targetSdkVersion 28
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
Kevin28578712019-01-04 17:54:51 -080065 withQuickstepIconRecents {
66 dimension "recents"
67
68 minSdkVersion 28
69 }
70
Kevin61ad3012019-01-04 16:30:24 -080071 withoutQuickstep {
72 dimension "recents"
73 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070074 }
Sunny Goyal9d341962017-10-30 10:03:34 -070075
76 // Disable release builds for now
77 android.variantFilter { variant ->
78 if (variant.buildType.name.endsWith('release')) {
Kevin28578712019-01-04 17:54:51 -080079 variant.setIgnore(true)
80 }
81
82 // Icon recents is Go only
83 if (name.contains("WithQuickstepIconRecents") && !name.contains("l3go")) {
84 variant.setIgnore(true)
Sunny Goyal9d341962017-10-30 10:03:34 -070085 }
86 }
87
Sunny Goyaledf329a2015-08-29 23:16:27 -070088 sourceSets {
89 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080090 res.srcDirs = ['res']
Kevinab874002019-01-04 15:55:42 -080091 java.srcDirs = ['src', 'src_plugins']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070092 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070093 proto {
94 srcDir 'protos/'
95 srcDir 'proto_overrides/'
96 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070097 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070098
Sunny Goyal9d341962017-10-30 10:03:34 -070099 debug {
100 manifest.srcFile "AndroidManifest.xml"
101 }
102
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700103 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -0700104 res.srcDirs = ['tests/res']
Sunny Goyald2303072018-08-14 15:21:45 -0700105 java.srcDirs = ['tests/src', 'tests/tapl']
Sunny Goyal658058b2017-01-21 01:33:02 -0800106 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700107 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700108
Sunny Goyal9d341962017-10-30 10:03:34 -0700109 androidTestDebug {
110 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700111 }
Sunny Goyal658058b2017-01-21 01:33:02 -0800112
Sunny Goyal9d341962017-10-30 10:03:34 -0700113 aosp {
Kevin61ad3012019-01-04 16:30:24 -0800114 java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
115 manifest.srcFile "AndroidManifest.xml"
Sunny Goyal658058b2017-01-21 01:33:02 -0800116 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700117
118 l3go {
119 res.srcDirs = ['go/res']
Kevin61ad3012019-01-04 16:30:24 -0800120 java.srcDirs = ['go/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700121 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700122 }
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 }
133
134 withQuickstepIconRecents {
135 res.srcDirs = ['quickstep/res', 'go/quickstep/res']
136 java.srcDirs = ['quickstep/src', 'go/quickstep/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700137 manifest.srcFile "quickstep/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700138 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700139 }
140}
141
142repositories {
Sunny Goyal42137832018-04-23 14:03:04 -0700143 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
144 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700145 mavenCentral()
Sunny Goyal42137832018-04-23 14:03:04 -0700146 google()
Sunny Goyaledf329a2015-08-29 23:16:27 -0700147}
148
149dependencies {
Hyunyoung Song719eee22018-11-01 23:12:54 -0700150 implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
151 implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
152 implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
Hyunyoung Song719eee22018-11-01 23:12:54 -0700153 implementation project(':IconLoader')
Kevinddb9fe12019-03-15 13:39:00 -0700154 implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'launcher_protos.jar')
Hyunyoung Song719eee22018-11-01 23:12:54 -0700155
Kevin61ad3012019-01-04 16:30:24 -0800156 // Recents lib dependency
Kevinddb9fe12019-03-15 13:39:00 -0700157 withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700158
Kevin28578712019-01-04 17:54:51 -0800159 // Recents lib dependency for Go
Kevinddb9fe12019-03-15 13:39:00 -0700160 withQuickstepIconRecentsImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
Kevin28578712019-01-04 17:54:51 -0800161
Kevin61ad3012019-01-04 16:30:24 -0800162 // Required for AOSP to compile. This is already included in the sysui_shared.jar
Kevinddb9fe12019-03-15 13:39:00 -0700163 withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
Sunny Goyal73133392017-11-02 11:04:49 -0700164
Sunny Goyal42137832018-04-23 14:03:04 -0700165 testImplementation 'junit:junit:4.12'
166 androidTestImplementation "org.mockito:mockito-core:1.9.5"
167 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
168 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
169 androidTestImplementation 'com.android.support.test:runner:1.0.0'
170 androidTestImplementation 'com.android.support.test:rules:1.0.0'
171 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Hyunyoung Song719eee22018-11-01 23:12:54 -0700172 androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700173}
174
175protobuf {
176 // Configure the protoc executable
177 protoc {
178 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700179
180 generateProtoTasks {
181 all().each { task ->
182 task.builtins {
183 remove java
184 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700185 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800186 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800187 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530188 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700189 }
190 }
191 }
192 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700193 }
194}