blob: 5d4288e2011da9e28cd36d25a9d8f67f0f005306 [file] [log] [blame]
Sunny Goyaledf329a2015-08-29 23:16:27 -07001buildscript {
2 repositories {
3 mavenCentral()
4 }
5 dependencies {
Sunny Goyal7c74e4a2016-12-15 15:53:17 -08006 classpath 'com.android.tools.build:gradle:2.2.3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -07007 classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -07008 }
9}
10
11apply plugin: 'com.android.application'
12apply plugin: 'com.google.protobuf'
13
14android {
Sunny Goyala52ecb02016-12-16 15:04:51 -080015 compileSdkVersion 26
Sunny Goyalb20cbb22016-07-07 15:01:26 -070016 buildToolsVersion '24.0.0'
Sunny Goyaledf329a2015-08-29 23:16:27 -070017
18 defaultConfig {
Sunny Goyald297be22016-05-10 15:35:02 -070019 minSdkVersion 21
Sunny Goyala52ecb02016-12-16 15:04:51 -080020 targetSdkVersion 26
Sunny Goyaledf329a2015-08-29 23:16:27 -070021 versionCode 1
22 versionName "1.0"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070023
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070024 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Sunny Goyaledf329a2015-08-29 23:16:27 -070025 }
26 buildTypes {
27 debug {
28 minifyEnabled false
29 }
30 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070031
32 productFlavors {
33 aosp {
34 applicationId 'com.android.launcher3'
35 testApplicationId 'com.android.launcher3.tests'
36 }
37 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070038 sourceSets {
39 main {
Sunny Goyalbd822502016-02-18 15:09:21 -080040 res.srcDirs = ['res']
Sunny Goyald83a67a2016-05-23 21:40:53 -070041 java.srcDirs = ['src', 'src_config']
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070042 manifest.srcFile 'AndroidManifest-common.xml'
Sunny Goyaledf329a2015-08-29 23:16:27 -070043 proto.srcDirs 'protos/'
44 }
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070045
46 androidTest {
47 java.srcDirs = ['tests/src']
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070048 res.srcDirs = ['tests/res']
Sunny Goyal658058b2017-01-21 01:33:02 -080049 manifest.srcFile "tests/AndroidManifest-common.xml"
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070050 }
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070051
52 aosp {
53 manifest.srcFile "AndroidManifest.xml"
54 }
Sunny Goyal658058b2017-01-21 01:33:02 -080055
56 aospAndroidTest {
57 manifest.srcFile "tests/AndroidManifest.xml"
58 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070059 }
60}
61
62repositories {
63 mavenCentral()
64}
65
Sunny Goyala52ecb02016-12-16 15:04:51 -080066final String SUPPORT_LIBS_VERSION = '26.0.0-SNAPSHOT'
Sunny Goyaledf329a2015-08-29 23:16:27 -070067dependencies {
Sunny Goyala52ecb02016-12-16 15:04:51 -080068 compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
69 compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
70 compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -070071 compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'
Sunny Goyal3d1c0ff2015-10-16 17:18:54 -070072
73 testCompile 'junit:junit:4.12'
Sunny Goyalf0ba8b72016-09-09 15:47:55 -070074 androidTestCompile "org.mockito:mockito-core:1.+"
75 androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
76 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
Sunny Goyaleb045072016-02-25 14:50:53 -080077 androidTestCompile 'com.android.support.test:runner:0.5'
78 androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
Sunny Goyal3e9be432017-01-05 15:22:41 -080079 androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
Sunny Goyaledf329a2015-08-29 23:16:27 -070080}
81
82protobuf {
83 // Configure the protoc executable
84 protoc {
85 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070086
87 generateProtoTasks {
88 all().each { task ->
89 task.builtins {
90 remove java
91 javanano {
Sunny Goyal58bcd5a2016-11-09 16:24:30 -080092 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
Sunny Goyalb26d8b62017-03-07 09:10:06 -080093 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
Sunny Goyal6c46a6d2016-11-23 02:24:32 +053094 option "enum_style=java"
Sunny Goyal4a4b49f2016-08-25 22:21:40 -070095 }
96 }
97 }
98 }
Sunny Goyaledf329a2015-08-29 23:16:27 -070099 }
100}