build.gradle 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. srcDirs = ['protos/', 'protos_overrides/']
  71. }
  72. }
  73. androidTest {
  74. res.srcDirs = ['tests/res']
  75. java.srcDirs = ['tests/src', 'tests/tapl']
  76. manifest.srcFile "tests/AndroidManifest-common.xml"
  77. }
  78. androidTestDebug {
  79. manifest.srcFile "tests/AndroidManifest.xml"
  80. }
  81. aosp {
  82. java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
  83. }
  84. aospWithoutQuickstep {
  85. manifest.srcFile "AndroidManifest.xml"
  86. }
  87. aospWithQuickstep {
  88. manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
  89. }
  90. l3go {
  91. res.srcDirs = ['go/res']
  92. java.srcDirs = ['go/src']
  93. manifest.srcFile "go/AndroidManifest.xml"
  94. }
  95. l3goWithoutQuickstepDebug {
  96. manifest.srcFile "AndroidManifest.xml"
  97. }
  98. l3goWithQuickstepDebug {
  99. manifest.srcFile "quickstep/AndroidManifest-launcher.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. }
  110. }
  111. allprojects {
  112. repositories {
  113. maven { url "../../../prebuilts/sdk/current/androidx/m2repository" }
  114. maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
  115. maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
  116. mavenCentral()
  117. google()
  118. }
  119. }
  120. dependencies {
  121. implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
  122. implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
  123. implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
  124. implementation project(':IconLoader')
  125. withQuickstepImplementation project(':SharedLibWrapper')
  126. // Recents lib dependency
  127. withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/quickstep/libs", include: 'sysui_shared.jar')
  128. // Required for AOSP to compile. This is already included in the sysui_shared.jar
  129. withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
  130. testImplementation 'junit:junit:4.12'
  131. androidTestImplementation "org.mockito:mockito-core:1.9.5"
  132. androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
  133. androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
  134. androidTestImplementation 'com.android.support.test:runner:1.0.0'
  135. androidTestImplementation 'com.android.support.test:rules:1.0.0'
  136. androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
  137. androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
  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. }