blob: 15a35133e33712f33c3a42bc059eb597544afad5 [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 {
Sunny Goyala5de7c72019-01-30 11:40:38 -080016 compileSdkVersion COMPILE_SDK
Hyunyoung Song719eee22018-11-01 23:12:54 -070017 buildToolsVersion BUILD_TOOLS_VERSION
Sunny Goyaledf329a2015-08-29 23:16:27 -070018
19 defaultConfig {
Sunny Goyal8c48d8b2019-01-25 15:10:18 -080020 minSdkVersion 25
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
Kevin61ad3012019-01-04 16:30:24 -080039 // The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep)
40 // See: https://developer.android.com/studio/build/build-variants#flavor-dimensions
41 flavorDimensions "app", "recents"
Sunny Goyal42137832018-04-23 14:03:04 -070042
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070043 productFlavors {
44 aosp {
Kevin61ad3012019-01-04 16:30:24 -080045 dimension "app"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070046 applicationId 'com.android.launcher3'
47 testApplicationId 'com.android.launcher3.tests'
48 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070049
50 l3go {
Kevin61ad3012019-01-04 16:30:24 -080051 dimension "app"
Sunny Goyal64a75aa2017-07-03 13:50:52 -070052 applicationId 'com.android.launcher3'
53 testApplicationId 'com.android.launcher3.tests'
54 }
Sunny Goyal9d341962017-10-30 10:03:34 -070055
Kevin61ad3012019-01-04 16:30:24 -080056 withQuickstep {
57 dimension "recents"
Sunny Goyald2303072018-08-14 15:21:45 -070058
59 minSdkVersion 28
Sunny Goyal9d341962017-10-30 10:03:34 -070060 }
Kevin61ad3012019-01-04 16:30:24 -080061
Kevin28578712019-01-04 17:54:51 -080062 withQuickstepIconRecents {
63 dimension "recents"
64
65 minSdkVersion 28
66 }
67
Kevin61ad3012019-01-04 16:30:24 -080068 withoutQuickstep {
69 dimension "recents"
70 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070071 }
Sunny Goyal9d341962017-10-30 10:03:34 -070072
73 // Disable release builds for now
74 android.variantFilter { variant ->
75 if (variant.buildType.name.endsWith('release')) {
Kevin28578712019-01-04 17:54:51 -080076 variant.setIgnore(true)
77 }
78
79 // Icon recents is Go only
80 if (name.contains("WithQuickstepIconRecents") && !name.contains("l3go")) {
81 variant.setIgnore(true)
Sunny Goyal9d341962017-10-30 10:03:34 -070082 }
83 }
84
Sunny Goyaledf329a2015-08-29 23:16:27 -070085 sourceSets {
86 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080087 res.srcDirs = ['res']
Kevinab874002019-01-04 15:55:42 -080088 java.srcDirs = ['src', 'src_plugins']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070089 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070090 proto {
91 srcDir 'protos/'
92 srcDir 'proto_overrides/'
93 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070094 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070095
Sunny Goyal9d341962017-10-30 10:03:34 -070096 debug {
97 manifest.srcFile "AndroidManifest.xml"
98 }
99
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700100 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -0700101 res.srcDirs = ['tests/res']
Sunny Goyald2303072018-08-14 15:21:45 -0700102 java.srcDirs = ['tests/src', 'tests/tapl']
Sunny Goyal658058b2017-01-21 01:33:02 -0800103 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700104 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700105
Sunny Goyal9d341962017-10-30 10:03:34 -0700106 androidTestDebug {
107 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700108 }
Sunny Goyal658058b2017-01-21 01:33:02 -0800109
Sunny Goyal9d341962017-10-30 10:03:34 -0700110 aosp {
Kevin61ad3012019-01-04 16:30:24 -0800111 java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
112 manifest.srcFile "AndroidManifest.xml"
Sunny Goyal658058b2017-01-21 01:33:02 -0800113 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700114
115 l3go {
116 res.srcDirs = ['go/res']
Kevin61ad3012019-01-04 16:30:24 -0800117 java.srcDirs = ['go/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700118 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700119 }
120
Kevin61ad3012019-01-04 16:30:24 -0800121 withoutQuickstep {
122 java.srcDirs = ['src_ui_overrides']
123 }
124
125 withQuickstep {
Kevin28578712019-01-04 17:54:51 -0800126 res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
127 java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
128 manifest.srcFile "quickstep/AndroidManifest.xml"
129 }
130
131 withQuickstepIconRecents {
132 res.srcDirs = ['quickstep/res', 'go/quickstep/res']
133 java.srcDirs = ['quickstep/src', 'go/quickstep/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700134 manifest.srcFile "quickstep/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700135 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700136 }
137}
138
139repositories {
Sunny Goyal42137832018-04-23 14:03:04 -0700140 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
141 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700142 mavenCentral()
Sunny Goyal42137832018-04-23 14:03:04 -0700143 google()
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')
Kevin34380b42019-01-04 16:00:36 -0800151 implementation fileTree(dir: "libs", include: 'launcher_protos.jar')
Hyunyoung Song719eee22018-11-01 23:12:54 -0700152
Kevin61ad3012019-01-04 16:30:24 -0800153 // Recents lib dependency
154 withQuickstepImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700155
Kevin28578712019-01-04 17:54:51 -0800156 // Recents lib dependency for Go
157 withQuickstepIconRecentsImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
158
Kevin61ad3012019-01-04 16:30:24 -0800159 // Required for AOSP to compile. This is already included in the sysui_shared.jar
160 withoutQuickstepImplementation fileTree(dir: "libs", include: 'plugin_core.jar')
Sunny Goyal73133392017-11-02 11:04:49 -0700161
Sunny Goyal42137832018-04-23 14:03:04 -0700162 testImplementation 'junit:junit:4.12'
163 androidTestImplementation "org.mockito:mockito-core:1.9.5"
164 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
165 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
166 androidTestImplementation 'com.android.support.test:runner:1.0.0'
167 androidTestImplementation 'com.android.support.test:rules:1.0.0'
168 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Hyunyoung Song719eee22018-11-01 23:12:54 -0700169 androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700170}
171
172protobuf {
173 // Configure the protoc executable
174 protoc {
175 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700176
177 generateProtoTasks {
178 all().each { task ->
179 task.builtins {
180 remove java
181 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700182 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800183 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800184 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530185 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700186 }
187 }
188 }
189 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700190 }
191}