build.gradle 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. withoutQuickstep {
  54. dimension "recents"
  55. }
  56. }
  57. // Disable release builds for now
  58. android.variantFilter { variant ->
  59. if (variant.buildType.name.endsWith('release')) {
  60. variant.setIgnore(true)
  61. }
  62. }
  63. sourceSets {
  64. main {
  65. res.srcDirs = ['res']
  66. java.srcDirs = ['src', 'src_plugins']
  67. manifest.srcFile 'AndroidManifest-common.xml'
  68. proto {
  69. srcDirs = ['protos/', 'protos_overrides/']
  70. }
  71. }
  72. androidTest {
  73. res.srcDirs = ['tests/res']
  74. java.srcDirs = ['tests/src', 'tests/tapl']
  75. manifest.srcFile "tests/AndroidManifest-common.xml"
  76. }
  77. androidTestDebug {
  78. manifest.srcFile "tests/AndroidManifest.xml"
  79. }
  80. aosp {
  81. java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
  82. }
  83. aospWithoutQuickstep {
  84. manifest.srcFile "AndroidManifest.xml"
  85. }
  86. aospWithQuickstep {
  87. manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
  88. }
  89. l3go {
  90. res.srcDirs = ['go/res']
  91. java.srcDirs = ['go/src']
  92. manifest.srcFile "go/AndroidManifest.xml"
  93. }
  94. l3goWithoutQuickstepDebug {
  95. manifest.srcFile "AndroidManifest.xml"
  96. }
  97. l3goWithQuickstepDebug {
  98. manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
  99. }
  100. withoutQuickstep {
  101. java.srcDirs = ['src_ui_overrides']
  102. }
  103. withQuickstep {
  104. res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
  105. java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
  106. manifest.srcFile "quickstep/AndroidManifest.xml"
  107. }
  108. }
  109. }
  110. allprojects {
  111. repositories {
  112. maven { url "../../../prebuilts/sdk/current/androidx/m2repository" }
  113. maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
  114. maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
  115. mavenCentral()
  116. google()
  117. }
  118. }
  119. dependencies {
  120. implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
  121. implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
  122. implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
  123. implementation project(':IconLoader')
  124. withQuickstepImplementation project(':SharedLibWrapper')
  125. // Recents lib dependency
  126. withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
  127. // Required for AOSP to compile. This is already included in the sysui_shared.jar
  128. withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
  129. testImplementation 'junit:junit:4.12'
  130. androidTestImplementation "org.mockito:mockito-core:1.9.5"
  131. androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
  132. androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
  133. androidTestImplementation 'com.android.support.test:runner:1.0.0'
  134. androidTestImplementation 'com.android.support.test:rules:1.0.0'
  135. androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
  136. androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
  137. api 'com.airbnb.android:lottie:3.3.0'
  138. }
  139. protobuf {
  140. // Configure the protoc executable
  141. protoc {
  142. artifact = "com.google.protobuf:protoc:${protocVersion}"
  143. }
  144. generateProtoTasks {
  145. all().each { task ->
  146. task.builtins {
  147. remove java
  148. java {
  149. option "lite"
  150. }
  151. }
  152. }
  153. }
  154. }