blob: 16ede3d51287044285c6ed61889057eb34030168 [file] [log] [blame]
Sunny Goyaledf329a2015-08-29 23:16:27 -07001buildscript {
2 repositories {
3 mavenCentral()
Sunny Goyal889495d2017-04-13 11:24:54 -07004 jcenter()
Amir Zaidi09319c82018-01-23 15:26:30 +01005 google()
Sunny Goyaledf329a2015-08-29 23:16:27 -07006 }
7 dependencies {
Sunny Goyal889495d2017-04-13 11:24:54 -07008 classpath 'com.android.tools.build:gradle:2.3.1'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -07009 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -070010 }
11}
12
13apply plugin: 'com.android.application'
14apply plugin: 'com.google.protobuf'
15
16android {
Amir Zaidi09319c82018-01-23 15:26:30 +010017 compileSdkVersion 27
Sunny Goyal889495d2017-04-13 11:24:54 -070018 buildToolsVersion '26.0.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -070019
20 defaultConfig {
Sunny Goyald297be22016-05-10 15:35:02 -070021 minSdkVersion 21
Amir Zaidi09319c82018-01-23 15:26:30 +010022 targetSdkVersion 27
Sunny Goyaledf329a2015-08-29 23:16:27 -070023 versionCode 1
Amir Zaidiedd07f32018-01-27 14:01:53 +010024 versionName "3.1"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070025
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070026 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
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
34 productFlavors {
35 aosp {
Amir Zaidif70a20e2018-01-23 15:26:50 +010036 applicationId 'com.google.android.apps.nexuslauncher'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070037 testApplicationId 'com.android.launcher3.tests'
38 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070039
40 l3go {
41 applicationId 'com.android.launcher3'
42 testApplicationId 'com.android.launcher3.tests'
43 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070044 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070045 sourceSets {
46 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080047 res.srcDirs = ['res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070048 java.srcDirs = ['src']
Amir Zaidi7ef33762018-01-23 15:39:27 +010049 assets.srcDirs = ['assets']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070050 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070051 proto {
52 srcDir 'protos/'
53 srcDir 'proto_overrides/'
Amir Zaidi6c6d4212018-01-23 15:40:20 +010054 srcDir 'proto_pixel/'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070055 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070056 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070057
58 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070059 res.srcDirs = ['tests/res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070060 java.srcDirs = ['tests/src']
Sunny Goyal658058b2017-01-21 01:33:02 -080061 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070062 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070063
64 aosp {
Sunny Goyal64a75aa2017-07-03 13:50:52 -070065 java.srcDirs = ['src_flags']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070066 manifest.srcFile "AndroidManifest.xml"
67 }
Sunny Goyal658058b2017-01-21 01:33:02 -080068
69 aospAndroidTest {
70 manifest.srcFile "tests/AndroidManifest.xml"
71 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070072
73 l3go {
74 res.srcDirs = ['go/res']
75 java.srcDirs = ['go/src_flags']
76 // Note: we are using the Launcher3 manifest here because the gradle manifest-merger uses
77 // different attributes than the build system.
78 manifest.srcFile "AndroidManifest.xml"
79 }
80
81 l3goAndroidTest {
82 manifest.srcFile "tests/AndroidManifest.xml"
83 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070084 }
85}
86
87repositories {
88 mavenCentral()
Sunny Goyal889495d2017-04-13 11:24:54 -070089 jcenter()
Amir Zaidi09319c82018-01-23 15:26:30 +010090 google()
Sunny Goyaledf329a2015-08-29 23:16:27 -070091}
92
Amir Zaidi09319c82018-01-23 15:26:30 +010093final String SUPPORT_LIBS_VERSION = '26.0.+'
Sunny Goyaledf329a2015-08-29 23:16:27 -070094dependencies {
Sunny Goyala52ecb02016-12-16 15:04:51 -080095 compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
Rajeev Kumar4bfa4662017-06-14 19:04:10 -070096 compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
Sunny Goyala52ecb02016-12-16 15:04:51 -080097 compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
98 compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}"
Sunny Goyal64a75aa2017-07-03 13:50:52 -070099 compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -0700100
101 testCompile 'junit:junit:4.12'
Sunny Goyal64a75aa2017-07-03 13:50:52 -0700102 androidTestCompile "org.mockito:mockito-core:1.9.5"
Sunny Goyalf0ba8b72016-09-09 15:47:55 -0700103 androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
104 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
Sunny Goyaleb045072016-02-25 14:50:53 -0800105 androidTestCompile 'com.android.support.test:runner:0.5'
106 androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Sunny Goyal3e9be432017-01-05 15:22:41 -0800107 androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700108}
109
110protobuf {
111 // Configure the protoc executable
112 protoc {
113 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700114
115 generateProtoTasks {
116 all().each { task ->
117 task.builtins {
118 remove java
119 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700120 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800121 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800122 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530123 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700124 }
125 }
126 }
127 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700128 }
129}