blob: 4ae6600ee334fcea75e20a53f892bcf0e9d569ee [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 Goyal42137832018-04-23 14:03:04 -07007 classpath 'com.android.tools.build:gradle:3.2.0-alpha12'
8 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
Sunny Goyaledf329a2015-08-29 23:16:27 -07009 }
10}
11
Sunny Goyal42137832018-04-23 14:03:04 -070012final String SUPPORT_LIBS_VERSION = '28.0.0-SNAPSHOT'
13
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
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070027 testInstrumentationRunner "android.support.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'
60 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070061 }
Sunny Goyal9d341962017-10-30 10:03:34 -070062
63 // Disable release builds for now
64 android.variantFilter { variant ->
65 if (variant.buildType.name.endsWith('release')) {
66 variant.setIgnore(true);
67 }
68 }
69
Sunny Goyaledf329a2015-08-29 23:16:27 -070070 sourceSets {
71 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080072 res.srcDirs = ['res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070073 java.srcDirs = ['src']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070074 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070075 proto {
76 srcDir 'protos/'
77 srcDir 'proto_overrides/'
78 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070079 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070080
Sunny Goyal9d341962017-10-30 10:03:34 -070081 debug {
82 manifest.srcFile "AndroidManifest.xml"
83 }
84
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070085 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070086 res.srcDirs = ['tests/res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070087 java.srcDirs = ['tests/src']
Sunny Goyal658058b2017-01-21 01:33:02 -080088 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070089 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070090
Sunny Goyal9d341962017-10-30 10:03:34 -070091 androidTestDebug {
92 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070093 }
Sunny Goyal658058b2017-01-21 01:33:02 -080094
Sunny Goyal9d341962017-10-30 10:03:34 -070095 aosp {
Sunny Goyal8b0a6472017-11-06 21:09:23 -080096 java.srcDirs = ['src_flags', "src_ui_overrides"]
Sunny Goyal658058b2017-01-21 01:33:02 -080097 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070098
99 l3go {
100 res.srcDirs = ['go/res']
Sunny Goyal8b0a6472017-11-06 21:09:23 -0800101 java.srcDirs = ['go/src_flags', "src_ui_overrides"]
Sunny Goyal9d341962017-10-30 10:03:34 -0700102 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700103 }
104
Sunny Goyal9d341962017-10-30 10:03:34 -0700105 quickstep {
106 res.srcDirs = ['quickstep/res']
Sunny Goyal8b0a6472017-11-06 21:09:23 -0800107 java.srcDirs = ['src_flags', 'quickstep/src']
Sunny Goyal9d341962017-10-30 10:03:34 -0700108 manifest.srcFile "quickstep/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700109 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700110 }
111}
112
113repositories {
Sunny Goyal42137832018-04-23 14:03:04 -0700114 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
115 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700116 mavenCentral()
Sunny Goyal42137832018-04-23 14:03:04 -0700117 google()
Sunny Goyaledf329a2015-08-29 23:16:27 -0700118}
119
120dependencies {
Sunny Goyal42137832018-04-23 14:03:04 -0700121 implementation "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
122 implementation "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
123 implementation "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
124 implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700125
Sunny Goyal42137832018-04-23 14:03:04 -0700126 quickstepImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
Sunny Goyal73133392017-11-02 11:04:49 -0700127
Sunny Goyal42137832018-04-23 14:03:04 -0700128 testImplementation 'junit:junit:4.12'
129 androidTestImplementation "org.mockito:mockito-core:1.9.5"
130 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
131 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
132 androidTestImplementation 'com.android.support.test:runner:1.0.0'
133 androidTestImplementation 'com.android.support.test:rules:1.0.0'
134 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
135 androidTestImplementation "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700136}
137
138protobuf {
139 // Configure the protoc executable
140 protoc {
141 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700142
143 generateProtoTasks {
144 all().each { task ->
145 task.builtins {
146 remove java
147 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700148 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800149 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800150 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530151 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700152 }
153 }
154 }
155 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700156 }
157}