1buildscript { 2 repositories { 3 mavenCentral() 4 google() 5 } 6 dependencies { 7 classpath GRADLE_CLASS_PATH 8 classpath PROTOBUF_CLASS_PATH 9 } 10} 11 12final String ANDROID_TOP = "${rootDir}/../../.." 13final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/" 14 15apply plugin: 'com.android.application' 16apply plugin: 'com.google.protobuf' 17 18android { 19 compileSdkVersion COMPILE_SDK 20 buildToolsVersion BUILD_TOOLS_VERSION 21 22 defaultConfig { 23 minSdkVersion 25 24 targetSdkVersion 28 25 versionCode 1 26 versionName "1.0" 27 28 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 29 vectorDrawables.useSupportLibrary = true 30 } 31 buildTypes { 32 debug { 33 minifyEnabled false 34 } 35 } 36 37 compileOptions { 38 sourceCompatibility JavaVersion.VERSION_1_8 39 targetCompatibility JavaVersion.VERSION_1_8 40 } 41 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" 45 46 productFlavors { 47 aosp { 48 dimension "app" 49 applicationId 'com.android.launcher3' 50 testApplicationId 'com.android.launcher3.tests' 51 } 52 53 l3go { 54 dimension "app" 55 applicationId 'com.android.launcher3' 56 testApplicationId 'com.android.launcher3.tests' 57 } 58 59 withQuickstep { 60 dimension "recents" 61 62 minSdkVersion 28 63 } 64 65 withoutQuickstep { 66 dimension "recents" 67 } 68 } 69 70 // Disable release builds for now 71 android.variantFilter { variant -> 72 if (variant.buildType.name.endsWith('release')) { 73 variant.setIgnore(true) 74 } 75 } 76 77 sourceSets { 78 main { 79 res.srcDirs = ['res'] 80 java.srcDirs = ['src', 'src_plugins'] 81 manifest.srcFile 'AndroidManifest-common.xml' 82 proto { 83 srcDirs = ['protos/', 'protos_overrides/'] 84 } 85 } 86 87 androidTest { 88 res.srcDirs = ['tests/res'] 89 java.srcDirs = ['tests/src', 'tests/tapl'] 90 manifest.srcFile "tests/AndroidManifest-common.xml" 91 } 92 93 androidTestDebug { 94 manifest.srcFile "tests/AndroidManifest.xml" 95 } 96 97 aosp { 98 java.srcDirs = ['src_flags', 'src_shortcuts_overrides'] 99 } 100 101 aospWithoutQuickstep { 102 manifest.srcFile "AndroidManifest.xml" 103 } 104 105 aospWithQuickstep { 106 manifest.srcFile "quickstep/AndroidManifest-launcher.xml" 107 } 108 109 l3go { 110 res.srcDirs = ['go/res'] 111 java.srcDirs = ['go/src'] 112 manifest.srcFile "go/AndroidManifest.xml" 113 } 114 115 l3goWithoutQuickstepDebug { 116 manifest.srcFile "AndroidManifest.xml" 117 } 118 119 l3goWithQuickstepDebug { 120 manifest.srcFile "quickstep/AndroidManifest-launcher.xml" 121 } 122 123 withoutQuickstep { 124 java.srcDirs = ['src_ui_overrides'] 125 } 126 127 withQuickstep { 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 } 132 } 133} 134 135allprojects { 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 } 143} 144 145dependencies { 146 implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}" 147 implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}" 148 implementation "androidx.preference:preference:${ANDROID_X_VERSION}" 149 implementation project(':IconLoader') 150 withQuickstepImplementation project(':SharedLibWrapper') 151 152 // Recents lib dependency 153 withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar') 154 155 // Required for AOSP to compile. This is already included in the sysui_shared.jar 156 withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar') 157 158 testImplementation 'junit:junit:4.12' 159 androidTestImplementation "org.mockito:mockito-core:1.9.5" 160 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2' 161 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2' 162 androidTestImplementation 'com.android.support.test:runner:1.0.0' 163 androidTestImplementation 'com.android.support.test:rules:1.0.0' 164 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' 165 androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}" 166 167 api 'com.airbnb.android:lottie:3.3.0' 168} 169 170protobuf { 171 // Configure the protoc executable 172 protoc { 173 artifact = "com.google.protobuf:protoc:${protocVersion}" 174 } 175 generateProtoTasks { 176 all().each { task -> 177 task.builtins { 178 remove java 179 java { 180 option "lite" 181 } 182 } 183 } 184 } 185} 186