blob: 0030b8bfc13310a0db4f2901ffbd4fb48b4eeddd [file] [log] [blame]
Sunny Goyaledf329a2015-08-29 23:16:27 -07001buildscript {
2 repositories {
3 mavenCentral()
Sunny Goyal889495d2017-04-13 11:24:54 -07004 jcenter()
Sunny Goyaledf329a2015-08-29 23:16:27 -07005 }
6 dependencies {
Sunny Goyal5bc6b6f2017-10-26 15:36:10 -07007 classpath 'com.android.tools.build:gradle:2.3.3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -07008 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -07009 }
10}
11
12apply plugin: 'com.android.application'
13apply plugin: 'com.google.protobuf'
14
15android {
Sunny Goyale1ebc082018-01-26 12:24:10 -080016 compileSdkVersion 28
17 buildToolsVersion '28.0.0'
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
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070025 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Sunny Goyaledf329a2015-08-29 23:16:27 -070026 }
27 buildTypes {
28 debug {
29 minifyEnabled false
30 }
31 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070032
33 productFlavors {
34 aosp {
35 applicationId 'com.android.launcher3'
36 testApplicationId 'com.android.launcher3.tests'
37 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070038
39 l3go {
40 applicationId 'com.android.launcher3'
41 testApplicationId 'com.android.launcher3.tests'
42 }
Sunny Goyal9d341962017-10-30 10:03:34 -070043
44 quickstep {
45 applicationId 'com.android.launcher3'
46 testApplicationId 'com.android.launcher3.tests'
47 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070048 }
Sunny Goyal9d341962017-10-30 10:03:34 -070049
50 // Disable release builds for now
51 android.variantFilter { variant ->
52 if (variant.buildType.name.endsWith('release')) {
53 variant.setIgnore(true);
54 }
55 }
56
Sunny Goyaledf329a2015-08-29 23:16:27 -070057 sourceSets {
58 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080059 res.srcDirs = ['res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070060 java.srcDirs = ['src']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070061 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070062 proto {
63 srcDir 'protos/'
64 srcDir 'proto_overrides/'
65 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070066 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070067
Sunny Goyal9d341962017-10-30 10:03:34 -070068 debug {
69 manifest.srcFile "AndroidManifest.xml"
70 }
71
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070072 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070073 res.srcDirs = ['tests/res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070074 java.srcDirs = ['tests/src']
Sunny Goyal658058b2017-01-21 01:33:02 -080075 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070076 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070077
Sunny Goyal9d341962017-10-30 10:03:34 -070078 androidTestDebug {
79 manifest.srcFile "tests/AndroidManifest.xml"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070080 }
Sunny Goyal658058b2017-01-21 01:33:02 -080081
Sunny Goyal9d341962017-10-30 10:03:34 -070082 aosp {
Sunny Goyal8b0a6472017-11-06 21:09:23 -080083 java.srcDirs = ['src_flags', "src_ui_overrides"]
Sunny Goyal658058b2017-01-21 01:33:02 -080084 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070085
86 l3go {
87 res.srcDirs = ['go/res']
Sunny Goyal8b0a6472017-11-06 21:09:23 -080088 java.srcDirs = ['go/src_flags', "src_ui_overrides"]
Sunny Goyal9d341962017-10-30 10:03:34 -070089 manifest.srcFile "go/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -070090 }
91
Sunny Goyal9d341962017-10-30 10:03:34 -070092 quickstep {
93 res.srcDirs = ['quickstep/res']
Sunny Goyal8b0a6472017-11-06 21:09:23 -080094 java.srcDirs = ['src_flags', 'quickstep/src']
Sunny Goyal9d341962017-10-30 10:03:34 -070095 manifest.srcFile "quickstep/AndroidManifest.xml"
Sunny Goyal64a75aa2017-07-03 13:50:52 -070096 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070097 }
98}
99
100repositories {
101 mavenCentral()
Sunny Goyal889495d2017-04-13 11:24:54 -0700102 jcenter()
Sunny Goyaledf329a2015-08-29 23:16:27 -0700103}
104
Sunny Goyale1ebc082018-01-26 12:24:10 -0800105final String SUPPORT_LIBS_VERSION = '28.0.0-SNAPSHOT'
Sunny Goyaledf329a2015-08-29 23:16:27 -0700106dependencies {
Sunny Goyala52ecb02016-12-16 15:04:51 -0800107 compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
Rajeev Kumar4bfa4662017-06-14 19:04:10 -0700108 compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
Sunny Goyala52ecb02016-12-16 15:04:51 -0800109 compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700110 compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700111
Sunny Goyal73133392017-11-02 11:04:49 -0700112 quickstepCompile fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
113
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700114 testCompile 'junit:junit:4.12'
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700115 androidTestCompile "org.mockito:mockito-core:1.9.5"
Sunny Goyalf0ba8b72016-09-09 15:47:55 -0700116 androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
117 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
Sunny Goyal8b0a6472017-11-06 21:09:23 -0800118 androidTestCompile 'com.android.support.test:runner:1.0.0'
119 androidTestCompile 'com.android.support.test:rules:1.0.0'
Sunny Goyaleb045072016-02-25 14:50:53 -0800120 androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Sunny Goyal3e9be432017-01-05 15:22:41 -0800121 androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700122}
123
124protobuf {
125 // Configure the protoc executable
126 protoc {
127 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700128
129 generateProtoTasks {
130 all().each { task ->
131 task.builtins {
132 remove java
133 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700134 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800135 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800136 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530137 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700138 }
139 }
140 }
141 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700142 }
143}