blob: 79ee111f5d102257bb0dad8031389929e9df126f [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 Goyal889495d2017-04-13 11:24:54 -07007 classpath 'com.android.tools.build:gradle:2.3.1'
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 Goyala52ecb02016-12-16 15:04:51 -080016 compileSdkVersion 26
Sunny Goyal889495d2017-04-13 11:24:54 -070017 buildToolsVersion '26.0.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -070018
19 defaultConfig {
Sunny Goyald297be22016-05-10 15:35:02 -070020 minSdkVersion 21
Sunny Goyala52ecb02016-12-16 15:04:51 -080021 targetSdkVersion 26
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 }
38 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070039 sourceSets {
40 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080041 res.srcDirs = ['res']
Sunny Goyal3d706ad2017-03-06 16:56:39 -080042 java.srcDirs = ['src', 'src_flags']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070043 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyal2385ebe2017-07-19 01:24:07 -070044 proto {
45 srcDir 'protos/'
46 srcDir 'proto_overrides/'
47 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070048 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070049
50 androidTest {
51 java.srcDirs = ['tests/src']
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070052 res.srcDirs = ['tests/res']
Sunny Goyal658058b2017-01-21 01:33:02 -080053 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070054 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070055
56 aosp {
57 manifest.srcFile "AndroidManifest.xml"
58 }
Sunny Goyal658058b2017-01-21 01:33:02 -080059
60 aospAndroidTest {
61 manifest.srcFile "tests/AndroidManifest.xml"
62 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070063 }
64}
65
66repositories {
67 mavenCentral()
Sunny Goyal889495d2017-04-13 11:24:54 -070068 jcenter()
Sunny Goyaledf329a2015-08-29 23:16:27 -070069}
70
Sunny Goyala52ecb02016-12-16 15:04:51 -080071final String SUPPORT_LIBS_VERSION = '26.0.0-SNAPSHOT'
Sunny Goyaledf329a2015-08-29 23:16:27 -070072dependencies {
Sunny Goyala52ecb02016-12-16 15:04:51 -080073 compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
Rajeev Kumar4bfa4662017-06-14 19:04:10 -070074 compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
Sunny Goyala52ecb02016-12-16 15:04:51 -080075 compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
76 compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -070077 compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070078
79 testCompile 'junit:junit:4.12'
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070080 androidTestCompile "org.mockito:mockito-core:1.+"
81 androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
82 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
Sunny Goyaleb045072016-02-25 14:50:53 -080083 androidTestCompile 'com.android.support.test:runner:0.5'
84 androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Sunny Goyal3e9be432017-01-05 15:22:41 -080085 androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -070086}
87
88protobuf {
89 // Configure the protoc executable
90 protoc {
91 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070092
93 generateProtoTasks {
94 all().each { task ->
95 task.builtins {
96 remove java
97 javanano {
Sunny Goyal2385ebe2017-07-19 01:24:07 -070098 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
Sunny Goyal58bcd5a2016-11-09 16:24:30 -080099 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -0800100 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +0530101 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -0700102 }
103 }
104 }
105 }
Sunny Goyaledf329a2015-08-29 23:16:27 -0700106 }
107}