build.gradle 5.8 KB

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