blob: 7ac4127853471a22d9d6473b04c36b7a51023522 [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 {
Sunny Goyald2303072018-08-14 15:21:45 -07007 classpath 'com.android.tools.build:gradle:3.2.0-beta05'
8 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6'
Sunny Goyaledf329a2015-08-29 23:16:27 -07009 }
10}
11
Sunny Goyald2303072018-08-14 15:21:45 -070012final String SUPPORT_LIBS_VERSION = '1.0.0-alpha1'
Sunny Goyal42137832018-04-23 14:03:04 -070013
Sunny Goyaledf329a2015-08-29 23:16:27 -070014apply plugin: 'com.android.application'
15apply plugin: 'com.google.protobuf'
16
17android {
Sunny Goyale1ebc082018-01-26 12:24:10 -080018 compileSdkVersion 28
19 buildToolsVersion '28.0.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -070020
21 defaultConfig {
Sunny Goyald297be22016-05-10 15:35:02 -070022 minSdkVersion 21
Sunny Goyale1ebc082018-01-26 12:24:10 -080023 targetSdkVersion 28
Sunny Goyaledf329a2015-08-29 23:16:27 -070024 versionCode 1
25 versionName "1.0"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070026
Vadim Trysheva3fd1e52018-08-24 17:48:25 -070027 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Sunny Goyal42137832018-04-23 14:03:04 -070028 vectorDrawables.useSupportLibrary = true
Sunny Goyaledf329a2015-08-29 23:16:27 -070029 }
30 buildTypes {
31 debug {
32 minifyEnabled false
33 }
34 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070035
Sunny Goyal42137832018-04-23 14:03:04 -070036 compileOptions {
37 sourceCompatibility JavaVersion.VERSION_1_8
38 targetCompatibility JavaVersion.VERSION_1_8
39 }
40
41 flavorDimensions "default"
42
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070043 productFlavors {
44 aosp {
Sunny Goyal42137832018-04-23 14:03:04 -070045 dimension "default"
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 {
Sunny Goyal42137832018-04-23 14:03:04 -070051 dimension "default"
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
56 quickstep {
Sunny Goyal42137832018-04-23 14:03:04 -070057 dimension "default"
Sunny Goyal9d341962017-10-30 10:03:34 -070058 applicationId 'com.android.launcher3'
59 testApplicationId 'com.android.launcher3.tests'
Sunny Goyald2303072018-08-14 15:21:45 -070060
61 minSdkVersion 28
Sunny Goyal9d341962017-10-30 10:03:34 -070062 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070063 }
Sunny Goyal9d341962017-10-30 10:03:34 -070064
65 // Disable release builds for now
66 android.variantFilter { variant ->
67 if (variant.buildType.name.endsWith('release')) {
68 variant.setIgnore(true);
69 }
70 }
71
Sunny Goyaledf329a2015-08-29 23:16:27 -070072 sourceSets {
73 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080074 res.srcDirs = ['res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070075 java.srcDirs = ['src']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070076 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070077 proto {
78 srcDir 'protos/'
79 srcDir 'proto_overrides/'
80 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070081 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070082
Sunny Goyal9d341962017-10-30 10:03:34 -070083 debug {
84 manifest.srcFile "AndroidManifest.xml"
85 }
86
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070087 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070088 res.srcDirs = ['tests/res']
Sunny Goyald2303072018-08-14 15:21:45 -070089 java.srcDirs = ['tests/src', 'tests/tapl']
Sunny Goyal658058b2017-01-21 01:33:02 -080090 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070091 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070092
Sunny Goyal9d341962017-10-30 10:03:34 -070093 androidTestDebug {
94 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070095 }
Sunny Goyal658058b2017-01-21 01:33:02 -080096
Sunny Goyal9d341962017-10-30 10:03:34 -070097 aosp {
Sunny Goyal8b0a6472017-11-06 21:09:23 -080098 java.srcDirs = ['src_flags', "src_ui_overrides"]
Sunny Goyal658058b2017-01-21 01:33:02 -080099 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700100
101 l3go {
102 res.srcDirs = ['go/res']
Sunny Goyal8b0a6472017-11-06 21:09:23 -0800103 java.srcDirs = ['go/src_flags', "src_ui_overrides"]
Sunny Goyal9d341962017-10-30 10:03:34 -0700104 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700105 }
106
Sunny Goyal9d341962017-10-30 10:03:34 -0700107 quickstep {
108 res.srcDirs = ['quickstep/res']
Sunny Goyal8b0a6472017-11-06 21:09:23 -0800109 java.srcDirs = ['src_flags', 'quickstep/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700110 manifest.srcFile "quickstep/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700111 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700112 }
113}
114
115repositories {
Sunny Goyal42137832018-04-23 14:03:04 -0700116 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
117 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700118 mavenCentral()
Sunny Goyal42137832018-04-23 14:03:04 -0700119 google()
Sunny Goyaledf329a2015-08-29 23:16:27 -0700120}
121
122dependencies {
Sunny Goyald2303072018-08-14 15:21:45 -0700123 implementation "androidx.dynamicanimation:dynamicanimation:${SUPPORT_LIBS_VERSION}"
124 implementation "androidx.recyclerview:recyclerview:${SUPPORT_LIBS_VERSION}"
Sunny Goyal42137832018-04-23 14:03:04 -0700125 implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700126
Sunny Goyal42137832018-04-23 14:03:04 -0700127 quickstepImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
Sunny Goyal73133392017-11-02 11:04:49 -0700128
Sunny Goyal42137832018-04-23 14:03:04 -0700129 testImplementation 'junit:junit:4.12'
130 androidTestImplementation "org.mockito:mockito-core:1.9.5"
131 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
132 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
133 androidTestImplementation 'com.android.support.test:runner:1.0.0'
134 androidTestImplementation 'com.android.support.test:rules:1.0.0'
135 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Sunny Goyald2303072018-08-14 15:21:45 -0700136 androidTestImplementation "androidx.annotation:annotation:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700137}
138
139protobuf {
140 // Configure the protoc executable
141 protoc {
142 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700143
144 generateProtoTasks {
145 all().each { task ->
146 task.builtins {
147 remove java
148 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700149 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800150 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800151 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530152 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700153 }
154 }
155 }
156 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700157 }
158}