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