blob: e40df06e47c1f980937ad6fc088a7c7cf656fdb4 [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 {
Hyunyoung Song719eee22018-11-01 23:12:54 -070016 compileSdkVersion COMPILE_SDK.toInteger()
17 buildToolsVersion BUILD_TOOLS_VERSION
Sunny Goyaledf329a2015-08-29 23:16:27 -070018
19 defaultConfig {
Sunny Goyald297be22016-05-10 15:35:02 -070020 minSdkVersion 21
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
62 withoutQuickstep {
63 dimension "recents"
64 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070065 }
Sunny Goyal9d341962017-10-30 10:03:34 -070066
67 // Disable release builds for now
68 android.variantFilter { variant ->
69 if (variant.buildType.name.endsWith('release')) {
70 variant.setIgnore(true);
71 }
72 }
73
Sunny Goyaledf329a2015-08-29 23:16:27 -070074 sourceSets {
75 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080076 res.srcDirs = ['res']
Kevinab874002019-01-04 15:55:42 -080077 java.srcDirs = ['src', 'src_plugins']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070078 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070079 proto {
80 srcDir 'protos/'
81 srcDir 'proto_overrides/'
82 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070083 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070084
Sunny Goyal9d341962017-10-30 10:03:34 -070085 debug {
86 manifest.srcFile "AndroidManifest.xml"
87 }
88
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070089 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']
101 manifest.srcFile "AndroidManifest.xml"
Sunny Goyal658058b2017-01-21 01:33:02 -0800102 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700103
104 l3go {
105 res.srcDirs = ['go/res']
Kevin61ad3012019-01-04 16:30:24 -0800106 java.srcDirs = ['go/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700107 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700108 }
109
Kevin61ad3012019-01-04 16:30:24 -0800110 withoutQuickstep {
111 java.srcDirs = ['src_ui_overrides']
112 }
113
114 withQuickstep {
Sunny Goyal9d341962017-10-30 10:03:34 -0700115 res.srcDirs = ['quickstep/res']
Kevin61ad3012019-01-04 16:30:24 -0800116 java.srcDirs = ['quickstep/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700117 manifest.srcFile "quickstep/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700118 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700119 }
120}
121
122repositories {
Sunny Goyal42137832018-04-23 14:03:04 -0700123 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
124 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700125 mavenCentral()
Sunny Goyal42137832018-04-23 14:03:04 -0700126 google()
Sunny Goyaledf329a2015-08-29 23:16:27 -0700127}
128
129dependencies {
Hyunyoung Song719eee22018-11-01 23:12:54 -0700130 implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
131 implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
132 implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
Hyunyoung Song719eee22018-11-01 23:12:54 -0700133 implementation project(':IconLoader')
Kevin34380b42019-01-04 16:00:36 -0800134 implementation fileTree(dir: "libs", include: 'launcher_protos.jar')
Hyunyoung Song719eee22018-11-01 23:12:54 -0700135
Kevin61ad3012019-01-04 16:30:24 -0800136 // Recents lib dependency
137 withQuickstepImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700138
Kevin61ad3012019-01-04 16:30:24 -0800139 // Required for AOSP to compile. This is already included in the sysui_shared.jar
140 withoutQuickstepImplementation fileTree(dir: "libs", include: 'plugin_core.jar')
Sunny Goyal73133392017-11-02 11:04:49 -0700141
Sunny Goyal42137832018-04-23 14:03:04 -0700142 testImplementation 'junit:junit:4.12'
143 androidTestImplementation "org.mockito:mockito-core:1.9.5"
144 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
145 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
146 androidTestImplementation 'com.android.support.test:runner:1.0.0'
147 androidTestImplementation 'com.android.support.test:rules:1.0.0'
148 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Hyunyoung Song719eee22018-11-01 23:12:54 -0700149 androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700150}
151
152protobuf {
153 // Configure the protoc executable
154 protoc {
155 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700156
157 generateProtoTasks {
158 all().each { task ->
159 task.builtins {
160 remove java
161 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700162 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800163 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800164 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530165 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700166 }
167 }
168 }
169 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700170 }
171}