build.gradle 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. buildscript {
  2. repositories {
  3. mavenCentral()
  4. google()
  5. }
  6. dependencies {
  7. classpath GRADLE_CLASS_PATH
  8. classpath PROTOBUF_CLASS_PATH
  9. }
  10. }
  11. final String ANDROID_TOP = "${rootDir}/../../.."
  12. final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/framework_intermediates/"
  13. apply plugin: 'com.android.application'
  14. apply plugin: 'com.google.protobuf'
  15. android {
  16. compileSdkVersion COMPILE_SDK
  17. buildToolsVersion BUILD_TOOLS_VERSION
  18. defaultConfig {
  19. minSdkVersion 25
  20. targetSdkVersion 28
  21. versionCode 1
  22. versionName "1.0"
  23. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  24. vectorDrawables.useSupportLibrary = true
  25. }
  26. buildTypes {
  27. debug {
  28. minifyEnabled false
  29. }
  30. }
  31. compileOptions {
  32. sourceCompatibility JavaVersion.VERSION_1_8
  33. targetCompatibility JavaVersion.VERSION_1_8
  34. }
  35. // The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep)
  36. // See: https://developer.android.com/studio/build/build-variants#flavor-dimensions
  37. flavorDimensions "app", "recents"
  38. productFlavors {
  39. aosp {
  40. dimension "app"
  41. applicationId 'com.android.launcher3'
  42. testApplicationId 'com.android.launcher3.tests'
  43. }
  44. l3go {
  45. dimension "app"
  46. applicationId 'com.android.launcher3'
  47. testApplicationId 'com.android.launcher3.tests'
  48. }
  49. withQuickstep {
  50. dimension "recents"
  51. minSdkVersion 28
  52. }
  53. withQuickstepIconRecents {
  54. dimension "recents"
  55. minSdkVersion 28
  56. }
  57. withoutQuickstep {
  58. dimension "recents"
  59. }
  60. }
  61. // Disable release builds for now
  62. android.variantFilter { variant ->
  63. if (variant.buildType.name.endsWith('release')) {
  64. variant.setIgnore(true)
  65. }
  66. // Icon recents is Go only
  67. if (name.contains("WithQuickstepIconRecents") && !name.contains("l3go")) {
  68. variant.setIgnore(true)
  69. }
  70. }
  71. sourceSets {
  72. main {
  73. res.srcDirs = ['res']
  74. java.srcDirs = ['src', 'src_plugins']
  75. manifest.srcFile 'AndroidManifest-common.xml'
  76. proto {
  77. srcDir 'protos/'
  78. srcDir 'proto_overrides/'
  79. }
  80. }
  81. debug {
  82. manifest.srcFile "AndroidManifest.xml"
  83. }
  84. androidTest {
  85. res.srcDirs = ['tests/res']
  86. java.srcDirs = ['tests/src', 'tests/tapl']
  87. manifest.srcFile "tests/AndroidManifest-common.xml"
  88. }
  89. androidTestDebug {
  90. manifest.srcFile "tests/AndroidManifest.xml"
  91. }
  92. aosp {
  93. java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
  94. manifest.srcFile "AndroidManifest.xml"
  95. }
  96. l3go {
  97. res.srcDirs = ['go/res']
  98. java.srcDirs = ['go/src']
  99. manifest.srcFile "go/AndroidManifest.xml"
  100. }
  101. withoutQuickstep {
  102. java.srcDirs = ['src_ui_overrides']
  103. }
  104. withQuickstep {
  105. res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
  106. java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
  107. manifest.srcFile "quickstep/AndroidManifest.xml"
  108. }
  109. withQuickstepIconRecents {
  110. res.srcDirs = ['quickstep/res', 'go/quickstep/res']
  111. java.srcDirs = ['quickstep/src', 'go/quickstep/src']
  112. manifest.srcFile "quickstep/AndroidManifest.xml"
  113. }
  114. }
  115. }
  116. repositories {
  117. maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
  118. maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
  119. mavenCentral()
  120. google()
  121. }
  122. dependencies {
  123. implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
  124. implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
  125. implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
  126. implementation project(':IconLoader')
  127. implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'launcher_protos.jar')
  128. // Recents lib dependency
  129. withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
  130. // Recents lib dependency for Go
  131. withQuickstepIconRecentsImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
  132. // Required for AOSP to compile. This is already included in the sysui_shared.jar
  133. withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
  134. testImplementation 'junit:junit:4.12'
  135. androidTestImplementation "org.mockito:mockito-core:1.9.5"
  136. androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
  137. androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
  138. androidTestImplementation 'com.android.support.test:runner:1.0.0'
  139. androidTestImplementation 'com.android.support.test:rules:1.0.0'
  140. androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
  141. androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
  142. }
  143. protobuf {
  144. // Configure the protoc executable
  145. protoc {
  146. artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
  147. generateProtoTasks {
  148. all().each { task ->
  149. task.builtins {
  150. remove java
  151. javanano {
  152. option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
  153. option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
  154. option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
  155. option "enum_style=java"
  156. }
  157. }
  158. }
  159. }
  160. }
  161. }