Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 1 | buildscript { |
| 2 | repositories { |
| 3 | mavenCentral() |
Sunny Goyal | 4213783 | 2018-04-23 14:03:04 -0700 | [diff] [blame] | 4 | google() |
Amos Bianchi | dda7490 | 2020-01-15 12:27:36 -0800 | [diff] [blame] | 5 | jcenter() |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 6 | } |
| 7 | dependencies { |
Hyunyoung Song | 719eee2 | 2018-11-01 23:12:54 -0700 | [diff] [blame] | 8 | classpath GRADLE_CLASS_PATH |
| 9 | classpath PROTOBUF_CLASS_PATH |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 10 | } |
| 11 | } |
| 12 | |
Kevin | ddb9fe1 | 2019-03-15 13:39:00 -0700 | [diff] [blame] | 13 | final String ANDROID_TOP = "${rootDir}/../../.." |
| 14 | final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/" |
| 15 | |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 16 | apply plugin: 'com.android.application' |
| 17 | apply plugin: 'com.google.protobuf' |
| 18 | |
| 19 | android { |
Sunny Goyal | a5de7c7 | 2019-01-30 11:40:38 -0800 | [diff] [blame] | 20 | compileSdkVersion COMPILE_SDK |
Hyunyoung Song | 719eee2 | 2018-11-01 23:12:54 -0700 | [diff] [blame] | 21 | buildToolsVersion BUILD_TOOLS_VERSION |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 22 | |
| 23 | defaultConfig { |
Sunny Goyal | 8c48d8b | 2019-01-25 15:10:18 -0800 | [diff] [blame] | 24 | minSdkVersion 25 |
Sunny Goyal | e1ebc08 | 2018-01-26 12:24:10 -0800 | [diff] [blame] | 25 | targetSdkVersion 28 |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 26 | versionCode 1 |
| 27 | versionName "1.0" |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 28 | |
Vadim Tryshev | a3fd1e5 | 2018-08-24 17:48:25 -0700 | [diff] [blame] | 29 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
Sunny Goyal | 4213783 | 2018-04-23 14:03:04 -0700 | [diff] [blame] | 30 | vectorDrawables.useSupportLibrary = true |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 31 | } |
| 32 | buildTypes { |
| 33 | debug { |
| 34 | minifyEnabled false |
| 35 | } |
| 36 | } |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 37 | |
Sunny Goyal | 4213783 | 2018-04-23 14:03:04 -0700 | [diff] [blame] | 38 | compileOptions { |
| 39 | sourceCompatibility JavaVersion.VERSION_1_8 |
| 40 | targetCompatibility JavaVersion.VERSION_1_8 |
| 41 | } |
| 42 | |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 43 | // The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep) |
| 44 | // See: https://developer.android.com/studio/build/build-variants#flavor-dimensions |
| 45 | flavorDimensions "app", "recents" |
Sunny Goyal | 4213783 | 2018-04-23 14:03:04 -0700 | [diff] [blame] | 46 | |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 47 | productFlavors { |
| 48 | aosp { |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 49 | dimension "app" |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 50 | applicationId 'com.android.launcher3' |
| 51 | testApplicationId 'com.android.launcher3.tests' |
| 52 | } |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 53 | |
| 54 | l3go { |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 55 | dimension "app" |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 56 | applicationId 'com.android.launcher3' |
| 57 | testApplicationId 'com.android.launcher3.tests' |
| 58 | } |
Sunny Goyal | 9d34196 | 2017-10-30 10:03:34 -0700 | [diff] [blame] | 59 | |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 60 | withQuickstep { |
| 61 | dimension "recents" |
Sunny Goyal | d230307 | 2018-08-14 15:21:45 -0700 | [diff] [blame] | 62 | |
| 63 | minSdkVersion 28 |
Sunny Goyal | 9d34196 | 2017-10-30 10:03:34 -0700 | [diff] [blame] | 64 | } |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 65 | |
| 66 | withoutQuickstep { |
| 67 | dimension "recents" |
| 68 | } |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 69 | } |
Sunny Goyal | 9d34196 | 2017-10-30 10:03:34 -0700 | [diff] [blame] | 70 | |
| 71 | // Disable release builds for now |
| 72 | android.variantFilter { variant -> |
| 73 | if (variant.buildType.name.endsWith('release')) { |
Kevin | 2857871 | 2019-01-04 17:54:51 -0800 | [diff] [blame] | 74 | variant.setIgnore(true) |
| 75 | } |
Sunny Goyal | 9d34196 | 2017-10-30 10:03:34 -0700 | [diff] [blame] | 76 | } |
| 77 | |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 78 | sourceSets { |
| 79 | main { |
Sunny Goyal | bd82250 | 2016-02-18 15:09:21 -0800 | [diff] [blame] | 80 | res.srcDirs = ['res'] |
Kevin | ab87400 | 2019-01-04 15:55:42 -0800 | [diff] [blame] | 81 | java.srcDirs = ['src', 'src_plugins'] |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 82 | manifest.srcFile 'AndroidManifest-common.xml' |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 83 | proto { |
thiruram | cbeb13d | 2021-01-27 14:45:58 -0800 | [diff] [blame] | 84 | srcDirs = ['protos/', 'protos_overrides/'] |
Sunny Goyal | 2385ebe | 2017-07-19 01:24:07 -0700 | [diff] [blame] | 85 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 86 | } |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 87 | |
| 88 | androidTest { |
Sunny Goyal | f0ba8b7 | 2016-09-09 15:47:55 -0700 | [diff] [blame] | 89 | res.srcDirs = ['tests/res'] |
Sunny Goyal | d230307 | 2018-08-14 15:21:45 -0700 | [diff] [blame] | 90 | java.srcDirs = ['tests/src', 'tests/tapl'] |
Sunny Goyal | 658058b | 2017-01-21 01:33:02 -0800 | [diff] [blame] | 91 | manifest.srcFile "tests/AndroidManifest-common.xml" |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 92 | } |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 93 | |
Sunny Goyal | 9d34196 | 2017-10-30 10:03:34 -0700 | [diff] [blame] | 94 | androidTestDebug { |
| 95 | manifest.srcFile "tests/AndroidManifest.xml" |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 96 | } |
Sunny Goyal | 658058b | 2017-01-21 01:33:02 -0800 | [diff] [blame] | 97 | |
Sunny Goyal | 9d34196 | 2017-10-30 10:03:34 -0700 | [diff] [blame] | 98 | aosp { |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 99 | java.srcDirs = ['src_flags', 'src_shortcuts_overrides'] |
Amos Bianchi | dda7490 | 2020-01-15 12:27:36 -0800 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | aospWithoutQuickstep { |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 103 | manifest.srcFile "AndroidManifest.xml" |
Sunny Goyal | 658058b | 2017-01-21 01:33:02 -0800 | [diff] [blame] | 104 | } |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 105 | |
Amos Bianchi | dda7490 | 2020-01-15 12:27:36 -0800 | [diff] [blame] | 106 | aospWithQuickstep { |
| 107 | manifest.srcFile "quickstep/AndroidManifest-launcher.xml" |
| 108 | } |
| 109 | |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 110 | l3go { |
| 111 | res.srcDirs = ['go/res'] |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 112 | java.srcDirs = ['go/src'] |
Sunny Goyal | 9d34196 | 2017-10-30 10:03:34 -0700 | [diff] [blame] | 113 | manifest.srcFile "go/AndroidManifest.xml" |
Sunny Goyal | 64a75aa | 2017-07-03 13:50:52 -0700 | [diff] [blame] | 114 | } |
| 115 | |
Amos Bianchi | dda7490 | 2020-01-15 12:27:36 -0800 | [diff] [blame] | 116 | l3goWithoutQuickstepDebug { |
| 117 | manifest.srcFile "AndroidManifest.xml" |
| 118 | } |
| 119 | |
| 120 | l3goWithQuickstepDebug { |
| 121 | manifest.srcFile "quickstep/AndroidManifest-launcher.xml" |
| 122 | } |
| 123 | |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 124 | withoutQuickstep { |
| 125 | java.srcDirs = ['src_ui_overrides'] |
| 126 | } |
| 127 | |
| 128 | withQuickstep { |
Kevin | 2857871 | 2019-01-04 17:54:51 -0800 | [diff] [blame] | 129 | res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res'] |
| 130 | java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src'] |
| 131 | manifest.srcFile "quickstep/AndroidManifest.xml" |
| 132 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 133 | } |
| 134 | } |
| 135 | |
Amos Bianchi | dda7490 | 2020-01-15 12:27:36 -0800 | [diff] [blame] | 136 | allprojects { |
| 137 | repositories { |
| 138 | maven { url "../../../prebuilts/sdk/current/androidx/m2repository" } |
| 139 | maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" } |
| 140 | maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" } |
| 141 | mavenCentral() |
| 142 | google() |
| 143 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | dependencies { |
Hyunyoung Song | 719eee2 | 2018-11-01 23:12:54 -0700 | [diff] [blame] | 147 | implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}" |
| 148 | implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}" |
| 149 | implementation "androidx.preference:preference:${ANDROID_X_VERSION}" |
Hyunyoung Song | 719eee2 | 2018-11-01 23:12:54 -0700 | [diff] [blame] | 150 | implementation project(':IconLoader') |
Amos Bianchi | dda7490 | 2020-01-15 12:27:36 -0800 | [diff] [blame] | 151 | withQuickstepImplementation project(':SharedLibWrapper') |
Hyunyoung Song | 719eee2 | 2018-11-01 23:12:54 -0700 | [diff] [blame] | 152 | |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 153 | // Recents lib dependency |
Kevin | ddb9fe1 | 2019-03-15 13:39:00 -0700 | [diff] [blame] | 154 | withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar') |
Sunny Goyal | 3d1c0ff | 2015-10-16 17:18:54 -0700 | [diff] [blame] | 155 | |
Kevin | 61ad301 | 2019-01-04 16:30:24 -0800 | [diff] [blame] | 156 | // Required for AOSP to compile. This is already included in the sysui_shared.jar |
Kevin | ddb9fe1 | 2019-03-15 13:39:00 -0700 | [diff] [blame] | 157 | withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar') |
Sunny Goyal | 7313339 | 2017-11-02 11:04:49 -0700 | [diff] [blame] | 158 | |
Sunny Goyal | 4213783 | 2018-04-23 14:03:04 -0700 | [diff] [blame] | 159 | testImplementation 'junit:junit:4.12' |
| 160 | androidTestImplementation "org.mockito:mockito-core:1.9.5" |
| 161 | androidTestImplementation 'com.google.dexmaker:dexmaker:1.2' |
| 162 | androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2' |
| 163 | androidTestImplementation 'com.android.support.test:runner:1.0.0' |
| 164 | androidTestImplementation 'com.android.support.test:rules:1.0.0' |
| 165 | androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' |
Hyunyoung Song | 719eee2 | 2018-11-01 23:12:54 -0700 | [diff] [blame] | 166 | androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}" |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 167 | } |
| 168 | |
| 169 | protobuf { |
| 170 | // Configure the protoc executable |
| 171 | protoc { |
Winson Chung | f993518 | 2020-10-23 09:26:44 -0700 | [diff] [blame] | 172 | artifact = "com.google.protobuf:protoc:${protocVersion}" |
| 173 | } |
| 174 | generateProtoTasks { |
| 175 | all().each { task -> |
| 176 | task.builtins { |
| 177 | remove java |
| 178 | java { |
| 179 | option "lite" |
Sunny Goyal | 4a4b49f | 2016-08-25 22:21:40 -0700 | [diff] [blame] | 180 | } |
| 181 | } |
| 182 | } |
Sunny Goyal | edf329a | 2015-08-29 23:16:27 -0700 | [diff] [blame] | 183 | } |
thiruram | cbeb13d | 2021-01-27 14:45:58 -0800 | [diff] [blame] | 184 | } |