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() |
Amir Zaidi | 09319c8 | 2018-01-23 15:26:30 +0100 | [diff] [blame] | 5 | google() |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 6 | } |
| 7 | dependencies { |
Sunny Goyal | 889495d | 2017-04-13 11:24:54 -0700 | [diff] [blame] | 8 | classpath 'com.android.tools.build:gradle:2.3.1' |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 9 | classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0' |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 10 | } |
| 11 | } |
| 12 | |
| 13 | apply plugin: 'com.android.application' |
| 14 | apply plugin: 'com.google.protobuf' |
| 15 | |
| 16 | android { |
Amir Zaidi | 09319c8 | 2018-01-23 15:26:30 +0100 | [diff] [blame] | 17 | compileSdkVersion 27 |
Sunny Goyal | 889495d | 2017-04-13 11:24:54 -0700 | [diff] [blame] | 18 | buildToolsVersion '26.0.0' |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 19 | |
| 20 | defaultConfig { |
Sunny Goyal | d297be2 | 2016-05-10 15:35:02 -0700 | [diff] [blame] | 21 | minSdkVersion 21 |
Amir Zaidi | 09319c8 | 2018-01-23 15:26:30 +0100 | [diff] [blame] | 22 | targetSdkVersion 27 |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 23 | versionCode 1 |
Amir Zaidi | edd07f3 | 2018-01-27 14:01:53 +0100 | [diff] [blame] | 24 | versionName "3.1" |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 25 | |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 26 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 27 | } |
| 28 | buildTypes { |
| 29 | debug { |
| 30 | minifyEnabled false |
| 31 | } |
| 32 | } |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 33 | |
| 34 | productFlavors { |
| 35 | aosp { |
Amir Zaidi | f70a20e | 2018-01-23 15:26:50 +0100 | [diff] [blame] | 36 | applicationId 'com.google.android.apps.nexuslauncher' |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 37 | testApplicationId 'com.android.launcher3.tests' |
| 38 | } |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 39 | |
| 40 | l3go { |
| 41 | applicationId 'com.android.launcher3' |
| 42 | testApplicationId 'com.android.launcher3.tests' |
| 43 | } |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 44 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 45 | sourceSets { |
| 46 | main { |
Sunny Goyal | bd82250 | 2016-02-18 15:09:21 -0800 | [diff] [blame] | 47 | res.srcDirs = ['res'] |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 48 | java.srcDirs = ['src'] |
Amir Zaidi | 7ef3376 | 2018-01-23 15:39:27 +0100 | [diff] [blame] | 49 | assets.srcDirs = ['assets'] |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 50 | manifest.srcFile 'AndroidManifest-common.xml' |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 51 | proto { |
| 52 | srcDir 'protos/' |
| 53 | srcDir 'proto_overrides/' |
Amir Zaidi | 6c6d421 | 2018-01-23 15:40:20 +0100 | [diff] [blame] | 54 | srcDir 'proto_pixel/' |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 55 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 56 | } |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 57 | |
| 58 | androidTest { |
Sunny Goyal | f0ba8b7 | 2016-09-09 15:47:55 -0700 | [diff] [blame] | 59 | res.srcDirs = ['tests/res'] |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 60 | java.srcDirs = ['tests/src'] |
Sunny Goyal | 658058b | 2017-01-21 01:33:02 -0800 | [diff] [blame] | 61 | manifest.srcFile "tests/AndroidManifest-common.xml" |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 62 | } |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 63 | |
| 64 | aosp { |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 65 | java.srcDirs = ['src_flags'] |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 66 | manifest.srcFile "AndroidManifest.xml" |
| 67 | } |
Sunny Goyal | 658058b | 2017-01-21 01:33:02 -0800 | [diff] [blame] | 68 | |
| 69 | aospAndroidTest { |
| 70 | manifest.srcFile "tests/AndroidManifest.xml" |
| 71 | } |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 72 | |
| 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 Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 84 | } |
| 85 | } |
| 86 | |
| 87 | repositories { |
| 88 | mavenCentral() |
Sunny Goyal | 889495d | 2017-04-13 11:24:54 -0700 | [diff] [blame] | 89 | jcenter() |
Amir Zaidi | 09319c8 | 2018-01-23 15:26:30 +0100 | [diff] [blame] | 90 | google() |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 91 | } |
| 92 | |
Amir Zaidi | 09319c8 | 2018-01-23 15:26:30 +0100 | [diff] [blame] | 93 | final String SUPPORT_LIBS_VERSION = '26.0.+' |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 94 | dependencies { |
Sunny Goyal | a52ecb0 | 2016-12-16 15:04:51 -0800 | [diff] [blame] | 95 | compile "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}" |
Rajeev Kumar | 4bfa466 | 2017-06-14 19:04:10 -0700 | [diff] [blame] | 96 | compile "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}" |
Sunny Goyal | a52ecb0 | 2016-12-16 15:04:51 -0800 | [diff] [blame] | 97 | compile "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}" |
| 98 | compile "com.android.support:palette-v7:${SUPPORT_LIBS_VERSION}" |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 99 | compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7' |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 100 | |
| 101 | testCompile 'junit:junit:4.12' |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 102 | androidTestCompile "org.mockito:mockito-core:1.9.5" |
Sunny Goyal | f0ba8b7 | 2016-09-09 15:47:55 -0700 | [diff] [blame] | 103 | androidTestCompile 'com.google.dexmaker:dexmaker:1.2' |
| 104 | androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' |
Sunny Goyal | eb04507 | 2016-02-25 14:50:53 -0800 | [diff] [blame] | 105 | androidTestCompile 'com.android.support.test:runner:0.5' |
| 106 | androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' |
Sunny Goyal | 3e9be43 | 2017-01-05 15:22:41 -0800 | [diff] [blame] | 107 | androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}" |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 108 | } |
| 109 | |
| 110 | protobuf { |
| 111 | // Configure the protoc executable |
| 112 | protoc { |
| 113 | artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3' |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 114 | |
| 115 | generateProtoTasks { |
| 116 | all().each { task -> |
| 117 | task.builtins { |
| 118 | remove java |
| 119 | javanano { |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 120 | option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano" |
Sunny Goyal | 58bcd5a | 2016-11-09 16:24:30 -0800 | [diff] [blame] | 121 | option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano" |
Sunny Goyal | b26d8b6 | 2017-03-07 09:10:06 -0800 | [diff] [blame] | 122 | option "java_package=launcher_dump.proto|com.android.launcher3.model.nano" |
Sunny Goyal | 6c46a6d | 2016-11-23 02:24:32 +0530 | [diff] [blame] | 123 | option "enum_style=java" |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 124 | } |
| 125 | } |
| 126 | } |
| 127 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 128 | } |
| 129 | } |