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 withQuickstepIconRecents { 66 dimension "recents" 67 68 minSdkVersion 28 69 } 70 71 withoutQuickstep { 72 dimension "recents" 73 } 74 } 75 76 // Disable release builds for now 77 android.variantFilter { variant -> 78 if (variant.buildType.name.endsWith('release')) { 79 variant.setIgnore(true) 80 } 81 82 // Icon recents is Go only 83 if (name.contains("WithQuickstepIconRecents") && !name.contains("l3go")) { 84 variant.setIgnore(true) 85 } 86 } 87 88 sourceSets { 89 main { 90 res.srcDirs = ['res'] 91 java.srcDirs = ['src', 'src_plugins'] 92 manifest.srcFile 'AndroidManifest-common.xml' 93 proto { 94 srcDir 'protos/' 95 srcDir 'proto_overrides/' 96 } 97 } 98 99 debug { 100 manifest.srcFile "AndroidManifest.xml" 101 } 102 103 androidTest { 104 res.srcDirs = ['tests/res'] 105 java.srcDirs = ['tests/src', 'tests/tapl'] 106 manifest.srcFile "tests/AndroidManifest-common.xml" 107 } 108 109 androidTestDebug { 110 manifest.srcFile "tests/AndroidManifest.xml" 111 } 112 113 aosp { 114 java.srcDirs = ['src_flags', 'src_shortcuts_overrides'] 115 manifest.srcFile "AndroidManifest.xml" 116 } 117 118 l3go { 119 res.srcDirs = ['go/res'] 120 java.srcDirs = ['go/src'] 121 manifest.srcFile "go/AndroidManifest.xml" 122 } 123 124 withoutQuickstep { 125 java.srcDirs = ['src_ui_overrides'] 126 } 127 128 withQuickstep { 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 } 133 134 withQuickstepIconRecents { 135 res.srcDirs = ['quickstep/res', 'go/quickstep/res'] 136 java.srcDirs = ['quickstep/src', 'go/quickstep/src'] 137 manifest.srcFile "quickstep/AndroidManifest.xml" 138 } 139 } 140} 141 142repositories { 143 maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" } 144 maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" } 145 mavenCentral() 146 google() 147} 148 149dependencies { 150 implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}" 151 implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}" 152 implementation "androidx.preference:preference:${ANDROID_X_VERSION}" 153 implementation project(':IconLoader') 154 implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'launcher_protos.jar') 155 156 // Recents lib dependency 157 withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar') 158 159 // Recents lib dependency for Go 160 withQuickstepIconRecentsImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar') 161 162 // Required for AOSP to compile. This is already included in the sysui_shared.jar 163 withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar') 164 165 testImplementation 'junit:junit:4.12' 166 androidTestImplementation "org.mockito:mockito-core:1.9.5" 167 androidTestImplementation 'com.google.dexmaker:dexmaker:1.2' 168 androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2' 169 androidTestImplementation 'com.android.support.test:runner:1.0.0' 170 androidTestImplementation 'com.android.support.test:rules:1.0.0' 171 androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' 172 androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}" 173} 174 175protobuf { 176 // Configure the protoc executable 177 protoc { 178 artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3' 179 180 generateProtoTasks { 181 all().each { task -> 182 task.builtins { 183 remove java 184 javanano { 185 option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano" 186 option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano" 187 option "java_package=launcher_dump.proto|com.android.launcher3.model.nano" 188 option "enum_style=java" 189 } 190 } 191 } 192 } 193 } 194} 195