blob: a1b3a6037addad83b3d6f7972b9c945e5a2ac00e [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 Goyalf2dd4212017-09-28 11:31:39 -070016 compileSdkVersion 27
17 buildToolsVersion '27.0.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -070018
19 defaultConfig {
Sunny Goyald297be22016-05-10 15:35:02 -070020 minSdkVersion 21
Sunny Goyalf2dd4212017-09-28 11:31:39 -070021 targetSdkVersion 27
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 Goyal4a4b49f2016-08-25 22:21:40 -070043 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070044 sourceSets {
45 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080046 res.srcDirs = ['res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070047 java.srcDirs = ['src']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070048 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070049 proto {
50 srcDir 'protos/'
51 srcDir 'proto_overrides/'
52 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070053 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070054
55 androidTest {
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070056 res.srcDirs = ['tests/res']
Sunny Goyal64a75aa2017-07-03 13:50:52 -070057 java.srcDirs = ['tests/src']
Sunny Goyal658058b2017-01-21 01:33:02 -080058 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070059 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070060
61 aosp {
Sunny Goyal64a75aa2017-07-03 13:50:52 -070062 java.srcDirs = ['src_flags']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070063 manifest.srcFile "AndroidManifest.xml"
64 }
Sunny Goyal658058b2017-01-21 01:33:02 -080065
66 aospAndroidTest {
67 manifest.srcFile "tests/AndroidManifest.xml"
68 }
Sunny Goyal64a75aa2017-07-03 13:50:52 -070069
70 l3go {
71 res.srcDirs = ['go/res']
72 java.srcDirs = ['go/src_flags']
73 // Note: we are using the Launcher3 manifest here because the gradle manifest-merger uses
74 // different attributes than the build system.
75 manifest.srcFile "AndroidManifest.xml"
76 }
77
78 l3goAndroidTest {
79 manifest.srcFile "tests/AndroidManifest.xml"
80 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070081 }
82}
83
84repositories {
85 mavenCentral()
Sunny Goyal889495d2017-04-13 11:24:54 -070086 jcenter()
Sunny Goyaledf329a2015-08-29 23:16:27 -070087}
88
Sunny Goyalf2dd4212017-09-28 11:31:39 -070089final String SUPPORT_LIBS_VERSION = '27.0.0-SNAPSHOT'
Sunny Goyaledf329a2015-08-29 23:16:27 -070090dependencies {
Sunny Goyala52ecb02016-12-16 15:04:51 -080091 compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
Rajeev Kumar4bfa4662017-06-14 19:04:10 -070092 compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
Sunny Goyala52ecb02016-12-16 15:04:51 -080093 compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
Sunny Goyal64a75aa2017-07-03 13:50:52 -070094 compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070095
96 testCompile 'junit:junit:4.12'
Sunny Goyal64a75aa2017-07-03 13:50:52 -070097 androidTestCompile "org.mockito:mockito-core:1.9.5"
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070098 androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
99 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
Sunny Goyaleb045072016-02-25 14:50:53 -0800100 androidTestCompile 'com.android.support.test:runner:0.5'
101 androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Sunny Goyal3e9be432017-01-05 15:22:41 -0800102 androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -0700103}
104
105protobuf {
106 // Configure the protoc executable
107 protoc {
108 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700109
110 generateProtoTasks {
111 all().each { task ->
112 task.builtins {
113 remove java
114 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -0700115 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -0800116 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800117 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530118 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700119 }
120 }
121 }
122 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700123 }
124}