Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 1 | buildscript { |
| 2 | repositories { |
| 3 | mavenCentral() |
Sunny Goyal | 889495d | 2017-04-13 11:24:54 -0700 | [diff] [blame^] | 4 | jcenter() |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 5 | } |
| 6 | dependencies { |
Sunny Goyal | 889495d | 2017-04-13 11:24:54 -0700 | [diff] [blame^] | 7 | classpath 'com.android.tools.build:gradle:2.3.1' |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 8 | classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0' |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 9 | } |
| 10 | } |
| 11 | |
| 12 | apply plugin: 'com.android.application' |
| 13 | apply plugin: 'com.google.protobuf' |
| 14 | |
| 15 | android { |
Sunny Goyal | a52ecb0 | 2016-12-16 15:04:51 -0800 | [diff] [blame] | 16 | compileSdkVersion 26 |
Sunny Goyal | 889495d | 2017-04-13 11:24:54 -0700 | [diff] [blame^] | 17 | buildToolsVersion '26.0.0' |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 18 | |
| 19 | defaultConfig { |
Sunny Goyal | d297be2 | 2016-05-10 15:35:02 -0700 | [diff] [blame] | 20 | minSdkVersion 21 |
Sunny Goyal | a52ecb0 | 2016-12-16 15:04:51 -0800 | [diff] [blame] | 21 | targetSdkVersion 26 |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 22 | versionCode 1 |
| 23 | versionName "1.0" |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 24 | |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 25 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 26 | } |
| 27 | buildTypes { |
| 28 | debug { |
| 29 | minifyEnabled false |
| 30 | } |
| 31 | } |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 32 | |
| 33 | productFlavors { |
| 34 | aosp { |
| 35 | applicationId 'com.android.launcher3' |
| 36 | testApplicationId 'com.android.launcher3.tests' |
| 37 | } |
| 38 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 39 | sourceSets { |
| 40 | main { |
Sunny Goyal | bd82250 | 2016-02-18 15:09:21 -0800 | [diff] [blame] | 41 | res.srcDirs = ['res'] |
Sunny Goyal | d83a67a | 2016-05-23 21:40:53 -0700 | [diff] [blame] | 42 | java.srcDirs = ['src', 'src_config'] |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 43 | manifest.srcFile 'AndroidManifest-common.xml' |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 44 | proto.srcDirs 'protos/' |
| 45 | } |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 46 | |
| 47 | androidTest { |
| 48 | java.srcDirs = ['tests/src'] |
Sunny Goyal | f0ba8b7 | 2016-09-09 15:47:55 -0700 | [diff] [blame] | 49 | res.srcDirs = ['tests/res'] |
Sunny Goyal | 658058b | 2017-01-21 01:33:02 -0800 | [diff] [blame] | 50 | manifest.srcFile "tests/AndroidManifest-common.xml" |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 51 | } |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 52 | |
| 53 | aosp { |
| 54 | manifest.srcFile "AndroidManifest.xml" |
| 55 | } |
Sunny Goyal | 658058b | 2017-01-21 01:33:02 -0800 | [diff] [blame] | 56 | |
| 57 | aospAndroidTest { |
| 58 | manifest.srcFile "tests/AndroidManifest.xml" |
| 59 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 60 | } |
| 61 | } |
| 62 | |
| 63 | repositories { |
| 64 | mavenCentral() |
Sunny Goyal | 889495d | 2017-04-13 11:24:54 -0700 | [diff] [blame^] | 65 | jcenter() |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 66 | } |
| 67 | |
Sunny Goyal | a52ecb0 | 2016-12-16 15:04:51 -0800 | [diff] [blame] | 68 | final String SUPPORT_LIBS_VERSION = '26.0.0-SNAPSHOT' |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 69 | dependencies { |
Sunny Goyal | a52ecb0 | 2016-12-16 15:04:51 -0800 | [diff] [blame] | 70 | compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}" |
| 71 | compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}" |
| 72 | compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}" |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 73 | compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2' |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 74 | |
| 75 | testCompile 'junit:junit:4.12' |
Sunny Goyal | f0ba8b7 | 2016-09-09 15:47:55 -0700 | [diff] [blame] | 76 | androidTestCompile "org.mockito:mockito-core:1.+" |
| 77 | androidTestCompile 'com.google.dexmaker:dexmaker:1.2' |
| 78 | androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' |
Sunny Goyal | eb04507 | 2016-02-25 14:50:53 -0800 | [diff] [blame] | 79 | androidTestCompile 'com.android.support.test:runner:0.5' |
| 80 | androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' |
Sunny Goyal | 3e9be43 | 2017-01-05 15:22:41 -0800 | [diff] [blame] | 81 | androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}" |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | protobuf { |
| 85 | // Configure the protoc executable |
| 86 | protoc { |
| 87 | artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3' |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 88 | |
| 89 | generateProtoTasks { |
| 90 | all().each { task -> |
| 91 | task.builtins { |
| 92 | remove java |
| 93 | javanano { |
Sunny Goyal | 58bcd5a | 2016-11-09 16:24:30 -0800 | [diff] [blame] | 94 | option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano" |
Sunny Goyal | 6c46a6d | 2016-11-23 02:24:32 +0530 | [diff] [blame] | 95 | option "enum_style=java" |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 96 | } |
| 97 | } |
| 98 | } |
| 99 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 100 | } |
| 101 | } |